New vSphere Plugin - Datastore Monitoring by %

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
logisbk
Posts: 24
Joined: Mon Nov 08, 2021 1:00 pm

New vSphere Plugin - Datastore Monitoring by %

Post 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.
bbahn
Posts: 379
Joined: Thu Jan 12, 2023 5:42 pm

Re: New vSphere Plugin - Datastore Monitoring by %

Post 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.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
logisbk
Posts: 24
Joined: Mon Nov 08, 2021 1:00 pm

Re: New vSphere Plugin - Datastore Monitoring by %

Post 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?
bbahn
Posts: 379
Joined: Thu Jan 12, 2023 5:42 pm

Re: New vSphere Plugin - Datastore Monitoring by %

Post 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
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
bbahn
Posts: 379
Joined: Thu Jan 12, 2023 5:42 pm

Re: New vSphere Plugin - Datastore Monitoring by %

Post 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
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
Post Reply