vsphere

package
v0.56.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2023 License: GPL-3.0 Imports: 13 Imported by: 1

README

vCenter Server collector

VMware vCenter Server is advanced server management software that provides a centralized platform for controlling your VMware vSphere environments.

This module collects hosts and vms performance statistics from one or more vCenter servers depending on configuration.

Warning: The vsphere collector cannot re-login and continue collecting metrics after a vCenter reboot. go.d.plugin needs to be restarted.

Collected metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

Virtual Machine

These metrics refer to the Virtual Machine.

Labels:

Label Description
datacenter Datacenter name
cluster Cluster name
host Host name
vm Virtual Machine name

Metrics:

Metric Scope Dimensions Units
vsphere.vm_cpu_utilization virtual machine used percentage
vsphere.vm_mem_utilization virtual machine used percentage
vsphere.vm_mem_usage virtual machine granted, consumed, active, shared KiB
vsphere.vm_mem_swap_usage virtual machine swapped KiB
vsphere.vm_mem_swap_io virtual machine in, out KiB/s
vsphere.vm_disk_io virtual machine read, write KiB/s
vsphere.vm_disk_max_latency virtual machine latency milliseconds
vsphere.vm_net_traffic virtual machine rx, tx KiB/s
vsphere.vm_net_packets virtual machine rx, tx packets
vsphere.vm_net_drops virtual machine rx, tx packets
vsphere.vm_overall_status virtual machine green, red, yellow, gray status
vsphere.vm_system_uptime virtual machine uptime seconds
Host

These metrics refer to the ESXi host.

Labels:

Label Description
datacenter Datacenter name
cluster Cluster name
host Host name

Metrics:

Metric Scope Dimensions Units
vsphere.host_cpu_utilization host used percentage
vsphere.host_mem_utilization host used percentage
vsphere.host_mem_usage host granted, consumed, active, shared, sharedcommon KiB
vsphere.host_mem_swap_io host in, out KiB/s
vsphere.host_disk_io host read, write KiB/s
vsphere.host_disk_max_latency host latency milliseconds
vsphere.host_net_traffic host received, sent KiB/s
vsphere.host_net_packets host received, sent packets
vsphere.host_net_drops host received, sent packets
vsphere.host_net_errors host received, sent errors
vsphere.host_overall_status host green, red, yellow, gray status
vsphere.host_system_uptime host uptime seconds

Configuration

Edit the go.d/vsphere.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/vsphere.conf

Needs only url, username and password. Here is an example for 2 servers:

jobs:
  - name: vcenter1
    url: https://203.0.113.0
    username: admin@vsphere.local
    password: somepassword
    host_include: ['/*']
    vm_include: ['/*']

  - name: vcenter2
    url: https://203.0.113.10
    username: admin@vsphere.local
    password: somepassword
    host_include: ['/*']
    vm_include: ['/*']

For all available options please see module configuration file.

Hosts/vms filtering

Module supports filtering hosts and vms. Filtering options are host_include and vm_include.

  • host_include is a list of match patterns: /Dc pattern[/Cluster pattern/Host pattern].
  • vm_include is a list of match patterns: /Dc pattern[/Cluster pattern/Host pattern/VM name].

Pattern should start with /. It matches name, syntax: simple patterns.

Examples:

    host_include: # filter all hosts
      - '/!*'
    vm_include: # allow all vms
      - '/*'

host_include: # allow all DC1 datacenter hosts and DC2 datacenter hosts except HOST2
  - '/DC1/*'
  - '/DC2/*/!HOST2 *'
vm_include: # allow all vms from datacenters whose names starts with DC1 and from all hosts except HOST1 and HOST2
  - '/DC1*/*/!HOST1 !HOST2 */*'

Update every

Default update_every is 20 seconds, and it doesn't make sense to decrease the value. VMware real-time statistics are generated at the 20-seconds specificity.

It is likely that 20 seconds is not enough for big installations and the value should be tuned.

To get better view we recommend to run the collector in debug mode and see how much time it will take to collect metrics.

Example (all not related debug lines were removed):

[ilyam@pc]$ ./go.d.plugin -d -m vsphere
[ DEBUG ] vsphere[vsphere] discover.go:94 discovering : starting resource discovering process
[ DEBUG ] vsphere[vsphere] discover.go:102 discovering : found 3 dcs, process took 49.329656ms
[ DEBUG ] vsphere[vsphere] discover.go:109 discovering : found 12 folders, process took 49.538688ms
[ DEBUG ] vsphere[vsphere] discover.go:116 discovering : found 3 clusters, process took 47.722692ms
[ DEBUG ] vsphere[vsphere] discover.go:123 discovering : found 2 hosts, process took 52.966995ms
[ DEBUG ] vsphere[vsphere] discover.go:130 discovering : found 2 vms, process took 49.832979ms
[ INFO  ] vsphere[vsphere] discover.go:140 discovering : found 3 dcs, 12 folders, 3 clusters (2 dummy), 2 hosts, 3 vms, process took 249.655993ms
[ DEBUG ] vsphere[vsphere] build.go:12 discovering : building : starting building resources process
[ INFO  ] vsphere[vsphere] build.go:23 discovering : building : built 3/3 dcs, 12/12 folders, 3/3 clusters, 2/2 hosts, 3/3 vms, process took 63.3µs
[ DEBUG ] vsphere[vsphere] hierarchy.go:10 discovering : hierarchy : start setting resources hierarchy process
[ INFO  ] vsphere[vsphere] hierarchy.go:18 discovering : hierarchy : set 3/3 clusters, 2/2 hosts, 3/3 vms, process took 6.522µs
[ DEBUG ] vsphere[vsphere] filter.go:24 discovering : filtering : starting filtering resources process
[ DEBUG ] vsphere[vsphere] filter.go:45 discovering : filtering : removed 0 unmatched hosts
[ DEBUG ] vsphere[vsphere] filter.go:56 discovering : filtering : removed 0 unmatched vms
[ INFO  ] vsphere[vsphere] filter.go:29 discovering : filtering : filtered 0/2 hosts, 0/3 vms, process took 42.973µs
[ DEBUG ] vsphere[vsphere] metric_lists.go:14 discovering : metric lists : starting resources metric lists collection process
[ INFO  ] vsphere[vsphere] metric_lists.go:30 discovering : metric lists : collected metric lists for 2/2 hosts, 3/3 vms, process took 275.60764ms
[ INFO  ] vsphere[vsphere] discover.go:74 discovering : discovered 2/2 hosts, 3/3 vms, the whole process took 525.614041ms
[ INFO  ] vsphere[vsphere] discover.go:11 starting discovery process, will do discovery every 5m0s
[ DEBUG ] vsphere[vsphere] collect.go:11 starting collection process
[ DEBUG ] vsphere[vsphere] scrape.go:48 scraping : scraped metrics for 2/2 hosts, process took 96.257374ms
[ DEBUG ] vsphere[vsphere] scrape.go:60 scraping : scraped metrics for 3/3 vms, process took 57.879697ms
[ DEBUG ] vsphere[vsphere] collect.go:23 metrics collected, process took 154.77997ms

There you can see that discovering took 525.614041ms, collecting metrics took 154.77997ms. Discovering is a separate thread, it doesn't affect collecting.

update_every and timeout parameters should be adjusted based on these numbers.

Troubleshooting

To troubleshoot issues with the vsphere collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
    
  • Switch to the netdata user.

    sudo -u netdata -s
    
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m vsphere
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	web.HTTP          `yaml:",inline"`
	DiscoveryInterval web.Duration       `yaml:"discovery_interval"`
	HostsInclude      match.HostIncludes `yaml:"host_include"`
	VMsInclude        match.VMIncludes   `yaml:"vm_include"`
}

type VSphere

type VSphere struct {
	module.Base
	UpdateEvery int `yaml:"update_every"`
	Config      `yaml:",inline"`
	// contains filtered or unexported fields
}

func New

func New() *VSphere

func (*VSphere) Charts

func (vs *VSphere) Charts() *module.Charts

func (*VSphere) Check

func (vs *VSphere) Check() bool

func (*VSphere) Cleanup

func (vs *VSphere) Cleanup()

func (*VSphere) Collect

func (vs *VSphere) Collect() map[string]int64

func (*VSphere) Init

func (vs *VSphere) Init() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL