Page 1 of 1
New vSphere Plugin - Datastore Monitoring by %
Posted: Mon Jan 13, 2025 12:32 pm
by logisbk
I am looking to see if anyone else is using the new vSphere Plugin (check_vsphere_xi.py) to monitor Datastores and set Warn/Crit thresholds based on Percent Free? The documented approach is to put thresholds of space free in MB I believe, for every datastore, in order.
If a datstore is added, the order will be off until it's adjusted; if one is expanded, the thresholds need to be adjusted. The current checks using the VMware SDK are easy to set thresholds based on % and don't need to be touched after that. It's a big step backward if there isn't a way around this.
Re: New vSphere Plugin - Datastore Monitoring by %
Posted: Tue Jan 14, 2025 11:31 am
by bbahn
Hello @logisbk,
This is currently a problem with Nagios XI's data storage method (RRD), where the order and size of the data needs to remain constant for the .rrds to be processed properly. When running the wizard, it does monitor each host/guest as separate checks, so it will only break for a specific host/guest check. Unfortunately, at the current time, we are unable to fix this issue with the current architecture of Nagios XI as it was not designed for dynamically changing check return formats.
The only way I could see this being resolved within the plugin would be to add an option or subcommand to grab a specific datastore. If this would be desired, I can create an issue to do so, just let me know.
If you would like a workaround in the mean-time, you could create a wrapper for the plugin that parses the output of the plugin and returns only a specified datastore.
Re: New vSphere Plugin - Datastore Monitoring by %
Posted: Wed Jan 15, 2025 10:31 am
by logisbk
Thanks for the info. I was looking at using this
https://exchange.nagios.org/directory/c ... re/details
I tested the check below, which is working
Code: Select all
check_vsphere datastores -s vsphere -u username -p password --warning 90 --critical 95 --vimtype HostSystem --vimname $HOSTADDRESS$
Would you know how to set the environment variable, such as VSPHERE_PASS, to work with Nagios?
Re: New vSphere Plugin - Datastore Monitoring by %
Posted: Wed Jan 15, 2025 6:47 pm
by bbahn
@logisbk
You can define global environment variable for Nagios with the following documentation:
Nagios XI - Defining Global Environment Variables.
You can also update environment variables by modifying
/etc/systemd/system/multi-user.target.wants/nagios.service, adding
Code: Select all
Environment=VSPHERE_PASS=my_vsphere_passMYOTHERENVIRONMENTVARIABLE1=my_other_environment_variable1MYOTHERENVIRONMENTVARIABLES=my_other_environment_variables
Re: New vSphere Plugin - Datastore Monitoring by %
Posted: Thu Jan 30, 2025 3:40 pm
by bbahn
BTW, if you want to select a specific datastore, you can specify the name with
--allowed <regex expression to match> and/or
--banned <regex expression to block> as seen here:
https://omd.consol.de/docs/plugins/chec ... escription