Recommendations for esxi vmfs monitoring

Hi there,

as i’ve been searching the internet for some hours now to find a suitable script to check my esxi 6.7 datastores remaining disk space and couldn’t find a working plugin, i want to ask if anyone has recommendations for a working and not outdated check script or how i could achieve this.

Greets
Sebbo

Hi and welcome to our community! :slight_smile:

I built it up last week with my own snmp command. I think you have the possibility to check your storages…

My service:

apply Service for (storage => config in host.vars.storage_esx) {
	import "generic-service"
	check_command = "check-snmp-storage"
	vars += config
	vars.storage = 	"/vmfs/volumes/" + storage
	vars.warn = 	"80"
	vars.crit = 	"90"
	vars.sla = 		"24x7"
	display_name = 	"storage-esx-" + vars.descr 
}

The Host:

object Host		"esxi1" {
    import		"virtual-esx-24x7"
    address =		"IP"
    notes =		""
    vars.storage_esx["NFS-Transfer"] = { descr = "NFS-Transfer" }
    vars.storage_esx["546c8179-60b3b73c-81b9-d89d676058a0"] = { descr = "98ds-sla0-01" }
}

Note: Login to your esxi and go to your volumes directory.
“ls -l” will show the datastores with the name and Oid. Your snmp check must resolv the Oid. You can set your favorite name in { descr = “” }

Hi,

before we recommend anything, which scripts have you tested and evaluated thus far?
Which transport do you use for accessing the host, via VMWare API or with a direct agent connection to that ESXI host?

Cheers,
Michael

uff, i feel like i’ve tried almost every scripts on icinga exchange and some scripts on nagios exchange.
I already use the check_esx_hardware script to monitor my hardware via cim.
Would be great to get the data without the need to install an agent.

Greets
Sebbo

check_vmware_esx querying the VMWare API as well?

Yeah, i tried that last night but got errors regarding missing perl modules like Nagios::Plugin (fixed that by changing the script to Monitoring::Plugin) and now missing help.pm. It was late and i didn’t try any further.
But i was hoping for a script that doesn’t need to install the vmware SDK and so on like with check_esx_hardware.

Greets
Sebbo

Yeah, check_vmware_esx is somehow unmaintained, my PR for better docs isn’t merged since 2017. I cannot fork and maintain that plugin, since I don’t have any test infrastructure

The repository has a Makefile, which should compile all required packages into a single binary, I’d assume that help.pm is then part of this.

make all
cp check_vmware_esx /usr/lib/nagios/plugins/
chmod 755 /usr/lib/nagios/plugins/check_vmware_esx

In terms of check_esxi_hardware, this is well maintained by Claudio Künzler and should work with recent VMWare SDKs.

Cheers,
Michael

1 Like

Using/installing the VMware SDK can be a pain in the ass, but as you already have check_esxi_hardware running, I suppose the SDK is working alright.

I just install the check_vmware_esx script like this

git -C /usr/local/src clone https://github.com/BaldMansMojo/check_vmware_esx.git check_vmware_esx
cd /usr/local/src/check_vmware_esx
make all
cp check_vmware_esx /usr/lib/nagios/plugins/
cd -

If you are running a Ubuntu system I found that following this blog entry on replacing the lib-www perl package with an old version(https://www.claudiokuenzler.com/blog/650/slow-vmware-perl-sdk-soap-request-error-libwww-version) and installing haveged solves problems with script timeouts. On CentOS systems those don’t seem to be necessary.
This is taken from the docs: https://icinga.com/docs/icinga2/latest/doc/05-service-monitoring/#vmware-monitoring

Other than that the script normally works pretty good.

Recently I have tried the Icinga Web 2 vspheredb module, which gives you a nice overview about your hosts/vms/clusters. But the checks you can run against the module are still very basic, and I have no idea what they will do, if something fails.

3 Likes

Well, got check_vmware_esx.pl finally working…kind of. I copied the modules folder of the git repo to my script folder. Also downgraded to vmware Perl SDK 5.5. Now i get a warning but also the values.

check_esxi_hardware is working well for me. But unfortunately it doesn’t give me any datastore infos.

I’ll continue my tests with check_vmware_esx.pl now until i find something better. As you say it is unmaintained for quite a long time.

Thank you all for your suggestions. If anyone has more input for me, pls keep going. :slight_smile:

Greets
Sebbo

This is normally not necessary, SDk6.5 should also work fine. But the script only uses command from v5.5, so it doesn’t really matter.

About the warnings:
What exactly do they warn about?

I first installed SDK 6.7 and it threw me an error. Something with version blabla. So i installed 5.5 as it is recommended in the script docs.

The Warning i get is:
Possible precedence issue with control flow operator at /usr/share/perl/5.26/VMware/VICommon.pm line 2147.
Warning: The session being saved to ‘/tmp/_session’ is expired or not authenticated.
OK: OK for selected volume(s).

Try this and/or this.

  1. is for the sessions
  2. is for the flow control operator

Wow! This module you recommended is sick!!! :smiley:

I’ll have a look at your last suggestions in a bit. Thank you!

Hi all,

I am stuck and in need for some assistance with installing check_vmware_esx.

Unless I am doing something seriously wrong, I would say that installation of VMWare Perl SDK 6.5 went well.
After several attempts and installing missing Perl modules, I have completed installation and currently all installed binaries are in /usr/bin:

Blockqoute
-r-xr-xr-x. 1 root root 128151 Apr 3 14:23 vmware-uninstall-vSphere-CLI.pl
-r-xr-xr-x. 1 root root 4985 Apr 3 14:23 resxtop
lrwxrwxrwx. 1 root root 13 Apr 3 14:23 esxcfg-iscsi → ./vicfg-iscsi
-r-xr-xr-x. 1 root root 22531 Apr 3 14:23 vicfg-user
lrwxrwxrwx. 1 root root 13 Apr 3 14:23 esxcfg-route → ./vicfg-route
-r-xr-xr-x. 1 root root 23458 Apr 3 14:23 vihostupdate
lrwxrwxrwx. 1 root root 17 Apr 3 14:23 esxcfg-cfgbackup → ./vicfg-cfgbackup
lrwxrwxrwx. 1 root root 11 Apr 3 14:23 esxcfg-dns → ./vicfg-dns
-r-xr-xr-x. 1 root root 76696 Apr 3 14:23 vicfg-iscsi
lrwxrwxrwx. 1 root root 14 Apr 3 14:23 esxcfg-volume → ./vicfg-volume
-r-xr-xr-x. 1 root root 11645 Apr 3 14:23 vicfg-authconfig
-r-xr-xr-x. 1 root root 13304 Apr 3 14:23 vihostupdate35
lrwxrwxrwx. 1 root root 14 Apr 3 14:23 esxcfg-vmknic → ./vicfg-vmknic
lrwxrwxrwx. 1 root root 12 Apr 3 14:23 esxcfg-nics → ./vicfg-nics
lrwxrwxrwx. 1 root root 13 Apr 3 14:23 esxcfg-ipsec → ./vicfg-ipsec
lrwxrwxrwx. 1 root root 18 Apr 3 14:23 esxcfg-authconfig → ./vicfg-authconfig
-r-xr-xr-x. 1 root root 12580 Apr 3 14:23 vicfg-dumppart
-r-xr-xr-x. 1 root root 217 Apr 3 14:23 vicli.bat
-r-xr-xr-x. 1 root root 26398 Apr 3 14:23 vicfg-vmknic
lrwxrwxrwx. 1 root root 11 Apr 3 14:23 esxcfg-ntp → ./vicfg-ntp
lrwxrwxrwx. 1 root root 16 Apr 3 14:23 esxcfg-dumppart → ./vicfg-dumppart
-r–r–r–. 1 root root 31988 Apr 3 14:23 six.pyc
lrwxrwxrwx. 1 root root 11 Apr 3 14:23 esxcfg-nas → ./vicfg-nas
-r-xr-xr-x. 1 root root 9632 Apr 3 14:23 vicfg-advcfg
lrwxrwxrwx. 1 root root 15 Apr 3 14:23 esxcfg-vswitch → ./vicfg-vswitch
-r-xr-xr-x. 1 root root 6872 Apr 3 14:23 vicfg-module
-r-xr-xr-x. 1 root root 20543 Apr 3 14:23 vicfg-mpath
lrwxrwxrwx. 1 root root 12 Apr 3 14:23 esxcfg-user → ./vicfg-user
lrwxrwxrwx. 1 root root 15 Apr 3 14:23 esxcfg-mpath35 → ./vicfg-mpath35
lrwxrwxrwx. 1 root root 14 Apr 3 14:23 esxcfg-module → ./vicfg-module
lrwxrwxrwx. 1 root root 14 Apr 3 14:23 esxcfg-advcfg → ./vicfg-advcfg
-r-xr-xr-x. 1 root root 9140 Apr 3 14:23 vicfg-dns
-r-xr-xr-x. 1 root root 5643 Apr 3 14:23 vicfg-syslog
-r-xr-xr-x. 1 root root 8314 Apr 3 14:23 vicfg-nas
lrwxrwxrwx. 1 root root 16 Apr 3 14:23 esxcfg-scsidevs → ./vicfg-scsidevs
lrwxrwxrwx. 1 root root 13 Apr 3 14:23 esxcfg-mpath → ./vicfg-mpath
lrwxrwxrwx. 1 root root 15 Apr 3 14:23 esxcfg-hostops → ./vicfg-hostops
-r-xr-xr-x. 1 root root 2874 Apr 3 14:23 vicfg-rescan
lrwxrwxrwx. 1 root root 14 Apr 3 14:23 esxcfg-syslog → ./vicfg-syslog
lrwxrwxrwx. 1 root root 12 Apr 3 14:23 esxcfg-snmp → ./vicfg-snmp
-r-xr-xr-x. 1 root root 17079 Apr 3 14:23 vifs
-r-xr-xr-x. 1 root root 13481 Apr 3 14:23 vicfg-route
-r-xr-xr-x. 1 root root 30377 Apr 3 14:23 svmotion
lrwxrwxrwx. 1 root root 14 Apr 3 14:23 esxcfg-rescan → ./vicfg-rescan
-r-xr-xr-x. 1 root root 8920 Apr 3 14:23 vicfg-cfgbackup
-r-xr-xr-x. 1 root root 59908 Apr 3 14:23 vmware-cmd
-r-xr-xr-x. 1 root root 36078 Apr 3 14:23 vicfg-vswitch
lrwxrwxrwx. 1 root root 38 Apr 3 14:23 esxcli → /usr/lib/vmware-vcli/bin/esxcli/esxcli
lrwxrwxrwx. 1 root root 41 Apr 3 14:23 dcli → /usr/lib/vmware-vcli/bin/vmware-dcli/dcli

However, I can not find check_vmware_esx nowhere.

At this point I am not sure what did I miss doing in order to have the installation ready for defining checks.

Please assist.

Kind regards
Marko

check_vmware_esx is a plugin script which uses the VMware SDK for checking vcenters, hosts and VMs.
It does not come with the SDK. You have to download it additionally.

As I have written before, I would recommend the module instead of the SDK+script.

Hi,

Thank you for quick reply.

I have installed director and Icinga for VSphere (not VSphereDB) but I am experiencing an issue when trying to import the Guests.

Details:

  • Via standard configuration in global-templates/groups&service + hosts in zone, I have added VMGuests into Icinga already.

  • Via Icinga2 agent running on these guests, I am monitoring load,memory, services, etc…

Now if I try to add Guests via Director, using name of the VM (not Hostname) I am still seeing errors about object already defined.

Now, what I would like to do, is at least add ESXi VMHosts and monitor them via Director.

Is that possible and would you be so kind to help me with some steps or topic or documentation which provides guidelines?

Kindly awaiting your reply.

Makro Vrgotic

ActiveVIdeo

I would suggest you open a new Topic in the Service Monitoring section.
There you can describe the Problem you have in Detail, including error Messages and the steps you have done so far as well as the versions of icinga2 and the modules.

I personally have never used the vsphere moule for the Director Import source, so without any detailed error description I (and others) can’t help.

Also I would still encourage you to take a look at the vspheredb module.
It works so much better than the check scripts and has a nice Dashboard as well :wink:

Cheers :slight_smile:

1 Like