Trouble working with the vSphere module

Hi,

I have spent so many hours troubleshooting this now I come for help. I’m wanting to setup monitoring directly of my vSphere to get a better overview of internet traffic drops and disk congestion directly on the hardware. However, I’m facing some issues even after spending hours in the documentation.

So I have added my vsphere.conf here:
/etc/netdata/go.d/vsphere.conf

It contains the nessescary details:

  - name: VMware vCenter
    url: https://192.168.20.15
    username: administrator@vsphere.local
    password: ###############
    host_include: [ '/*' ]
    vm_include: [ '/*' ]

However, upon loading the module in here:
/usr/libexec/netdata/plugins.d

I get 0 modules loaded, I saw other issues with yaml formatting but I’ve tried so many different spacings now it cant be that.
[root@netdata plugins.d]# ./go.d.plugin -d -m vsphere.conf
[ DEBUG ] main[main] main.go:111 plugin: name=go.d, version=v0.27.0
[ DEBUG ] main[main] main.go:113 current user: name=root, uid=0
[ INFO ] main[main] agent.go:106 instance is started
[ INFO ] main[main] setup.go:39 loading config file
[ INFO ] main[main] setup.go:47 looking for ‘go.d.conf’ in [/etc/netdata /usr/lib/netdata/conf.d]
[ INFO ] main[main] setup.go:54 found '/etc/netdata/go.d.conf
[ INFO ] main[main] setup.go:61 config successfully loaded
[ INFO ] main[main] agent.go:110 using config: enabled ‘true’, default_run ‘true’, max_procs ‘0’
[ INFO ] main[main] setup.go:66 loading modules
[ INFO ] main[main] setup.go:85 enabled/registered modules: 0/58
[ INFO ] main[main] agent.go:122 no modules to run

[root@netdata plugins.d]# cat /etc/netdata/go.d.conf 
# netdata go.d.plugin configuration
#
**# This file is in YAML format.**

**# Enable/disable the whole go.d.plugin.**
**enabled: yes**

**# Enable/disable default value for all modules.**
**default_run: yes**

**# Maximum number of used CPUs. Zero means no limit.**
**max_procs: 0**

**# Enable/disable specific g.d.plugin module**
**# If you want to change any value, you need to uncomment out it first.**
**# IMPORTANT: Do not remove all spaces, just remove # symbol. There should be a space before module name.**
**modules:**
**#  vcsa: yes**
**  vsphere: yes**

I removed some modules for simplicity. Anyone know what causes the module not to load?

Hi @labber253, lets try to debug the problem

-m means a module name, so it should be vsphere, not vsphere.conf. There is an example in the readme.


Lets see the the debug output

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

1 Like

Thank you, that did help a lot

[root@netdata plugins.d]#  ./go.d.plugin -d -m vsphere
[ DEBUG ] main[main] main.go:111 plugin: name=go.d, version=v0.27.0
[ DEBUG ] main[main] main.go:113 current user: name=root, uid=0
[ INFO  ] main[main] agent.go:106 instance is started
[ INFO  ] main[main] setup.go:39 loading config file
[ INFO  ] main[main] setup.go:47 looking for 'go.d.conf' in [/etc/netdata /usr/lib/netdata/conf.d]
[ INFO  ] main[main] setup.go:54 found '/etc/netdata/go.d.conf
[ INFO  ] main[main] setup.go:61 config successfully loaded
[ INFO  ] main[main] agent.go:110 using config: enabled 'true', default_run 'true', max_procs '0'
[ INFO  ] main[main] setup.go:66 loading modules
[ INFO  ] main[main] setup.go:85 enabled/registered modules: 1/58
[ INFO  ] main[main] setup.go:90 building discovery config
[ INFO  ] main[main] setup.go:116 looking for 'vsphere.conf' in [/etc/netdata/go.d /usr/lib/netdata/conf.d/go.d]
[ INFO  ] main[main] setup.go:123 found '/etc/netdata/go.d/vsphere.conf
[ INFO  ] main[main] setup.go:128 dummy/read/watch paths: 0/1/0
[ INFO  ] discovery[manager] manager.go:90 registered discoverers: [file discovery: [file reader]]
[ INFO  ] discovery[manager] manager.go:95 instance is started
[ INFO  ] run[manager] run.go:30 instance is started
[ INFO  ] build[manager] build.go:106 instance is started
[ INFO  ] discovery[file manager] discovery.go:71 instance is started
[ INFO  ] discovery[file reader] read.go:39 instance is started
[ INFO  ] discovery[file reader] read.go:40 instance is stopped
[ DEBUG ] build[manager] build.go:153 received config group ('/etc/netdata/go.d/vsphere.conf'): 0 jobs (added: 0, removed: 0)
[ DEBUG ] run[manager] run.go:41 tick 0
[ DEBUG ] run[manager] run.go:41 tick 1
[ DEBUG ] run[manager] run.go:41 tick 2
[ DEBUG ] run[manager] run.go:41 tick 3

However I’m not sure if this should go directly to my Netdata UI now?

/etc/netdata/go.d/vsphere.conf has no jobs.

check the content, should be

# some comments
jobs:
  - name: ...
    url: ...
1 Like

Thanks. This should be fine:

# ------------------------------------------------MODULE-CONFIGURATION--------------------------------------------------
# [ GLOBAL ]
# update_every        : 20 # do not decrease the value, vmware real-time stats generated at the 20-seconds specificity.
# autodetection_retry : 0
# priority            : 70000
#
# [ JOBS ]
#jobs:
#  - name     : vcenter1
#    url      : https://203.0.113.0
#    username : admin@vsphere.local
#    password : somepassword
#
#  - name     : vcenter2
#    url      : https://203.0.113.10
#    username : admin@vsphere.local
#    password : somepassword
#
   - name: VMware vCenter
     url: https://192.168.20.15
     username: administrator@vsphere.local
     password: r##4######2aNTPn
     host_include: [ '/*' ]
     vm_include: [ '/*' ]

"/etc/netdata/go.d/vsphere.conf" 190L, 5364C

=>

jobs:
1 Like

Thanks very much :slight_smile:

It looks like I’m getting some certificate errors. I don’t run SSL in my Homelab but maybe it’s required for this plugin to function. I can also try the VSCA plugin now that I know more how this works.

[root@netdata plugins.d]# ./go.d.plugin -d -m vsphere
[ DEBUG ] main[main] main.go:111 plugin: name=go.d, version=v0.27.0
[ DEBUG ] main[main] main.go:113 current user: name=root, uid=0
[ INFO  ] main[main] agent.go:106 instance is started
[ INFO  ] main[main] setup.go:39 loading config file
[ INFO  ] main[main] setup.go:47 looking for 'go.d.conf' in [/etc/netdata /usr/lib/netdata/conf.d]
[ INFO  ] main[main] setup.go:54 found '/etc/netdata/go.d.conf
[ INFO  ] main[main] setup.go:61 config successfully loaded
[ INFO  ] main[main] agent.go:110 using config: enabled 'true', default_run 'true', max_procs '0'
[ INFO  ] main[main] setup.go:66 loading modules
[ INFO  ] main[main] setup.go:85 enabled/registered modules: 1/58
[ INFO  ] main[main] setup.go:90 building discovery config
[ INFO  ] main[main] setup.go:116 looking for 'vsphere.conf' in [/etc/netdata/go.d /usr/lib/netdata/conf.d/go.d]
[ INFO  ] main[main] setup.go:123 found '/etc/netdata/go.d/vsphere.conf
[ INFO  ] main[main] setup.go:128 dummy/read/watch paths: 0/1/0
[ INFO  ] discovery[manager] manager.go:90 registered discoverers: [file discovery: [file reader]]
[ INFO  ] run[manager] run.go:30 instance is started
[ INFO  ] discovery[manager] manager.go:95 instance is started
[ INFO  ] build[manager] build.go:106 instance is started
[ INFO  ] discovery[file manager] discovery.go:71 instance is started
[ INFO  ] discovery[file reader] read.go:39 instance is started
[ INFO  ] discovery[file reader] read.go:40 instance is stopped
[ DEBUG ] build[manager] build.go:153 received config group ('/etc/netdata/go.d/vsphere.conf'): 1 jobs (added: 1, removed: 0)
[ DEBUG ] build[manager] build.go:295 building vsphere[VMware_vCenter] job, config: map[__provider__:file reader __source__:/etc/netdata/go.d/vsphere.conf autodetection_retry:0 host_include:[/*] module:vsphere name:VMware_vCenter password:########Pn priority:70000 update_every:20 url:https://192.168.20.15 username:administrator@vsphere.local vm_include:[/*]]
[ ERROR ] vsphere[VMware_vCenter] vsphere.go:159 error on creating vsphere client: Post "https://192.168.20.15/sdk": x509: certificate signed by unknown authority
[ ERROR ] vsphere[VMware_vCenter] job.go:148 init failed
[ DEBUG ] run[manager] run.go:41 tick 0
[ DEBUG ] run[manager] run.go:41 tick 1
[ DEBUG ] run[manager] run.go:41 tick 2
[ DEBUG ] run[manager] run.go:41 tick 3
[ DEBUG ] run[manager] run.go:41 tick 4
[ DEBUG ] run[manager] run.go:41 tick 5

Let’s add tls_skip_verify: yes to the job config

jobs:
   - name: VMware vCenter
     url: https://192.168.20.15
     username: administrator@vsphere.local
     password: r##4######2aNTPn
     host_include: [ '/*' ]
     vm_include: [ '/*' ]
     tls_skip_verify: yes
1 Like

Excellent, it’s looking great :slight_smile:

Thank you so much!