check_vmware_api.pl and datastores

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
typer100
Posts: 41
Joined: Tue Sep 25, 2018 7:22 am

check_vmware_api.pl and datastores

Post by typer100 »

Hi! Trying to monitor my cluster datastore and the scripts never seems to refresh the values. I haven't add the check to Nagios yet. Just manually running the script. Using root to login to the host.

VC and hosts are at 6.7U2

/usr/local/nagios/libexec/check_vmware_api.pl -H "svpesx0341" -f "/tmp/svpesx0341_auth.txt" -l "VMFS"

CHECK_VMWARE_API.PL CRITICAL - Storages : 'dse40qua023'(free)=255338.00 MB (12.18%), 'dse40qua024'(free)=235515.00 MB (11.23%)

Thanks.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: check_vmware_api.pl and datastores

Post by npolovenko »

Hello, @typer100. What version of the VMWare SDK did you install?

And what is the version of the plugin?

Code: Select all

/usr/local/nagios/libexec/check_vmware_api.pl -V
Can you write down the actual datastore sizes from the VMWare client and post them in this thread? That way we could compare them with the command output.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
typer100
Posts: 41
Joined: Tue Sep 25, 2018 7:22 am

Re: check_vmware_api.pl and datastores

Post by typer100 »

Version is: check_vmware_api.pl 0.7.1
I've checked the CPU also... This is an output of bash script running this command every 5 seconds:

/usr/local/nagios/libexec/check_vmware_api.pl -H "svpesx0341" -f "svpesx0341_auth.txt" -l "CPU"

CHECK_VMWARE_API.PL OK - cpu usage=4402.00 MHz (6.79%) | cpu_usagemhz=4402.00;; cpu_usage=6.79%;;
CHECK_VMWARE_API.PL OK - cpu usage=5060.00 MHz (7.81%) | cpu_usagemhz=5060.00;; cpu_usage=7.81%;;
CHECK_VMWARE_API.PL OK - cpu usage=5060.00 MHz (7.81%) | cpu_usagemhz=5060.00;; cpu_usage=7.81%;;
CHECK_VMWARE_API.PL OK - cpu usage=5060.00 MHz (7.81%) | cpu_usagemhz=5060.00;; cpu_usage=7.81%;;
CHECK_VMWARE_API.PL OK - cpu usage=5060.00 MHz (7.81%) | cpu_usagemhz=5060.00;; cpu_usage=7.81%;;
CHECK_VMWARE_API.PL OK - cpu usage=4095.00 MHz (6.32%) | cpu_usagemhz=4095.00;; cpu_usage=6.32%;;
CHECK_VMWARE_API.PL OK - cpu usage=4095.00 MHz (6.32%) | cpu_usagemhz=4095.00;; cpu_usage=6.32%;;
CHECK_VMWARE_API.PL OK - cpu usage=4095.00 MHz (6.32%) | cpu_usagemhz=4095.00;; cpu_usage=6.32%;;
CHECK_VMWARE_API.PL OK - cpu usage=4165.00 MHz (6.42%) | cpu_usagemhz=4165.00;; cpu_usage=6.42%;;
CHECK_VMWARE_API.PL OK - cpu usage=4165.00 MHz (6.42%) | cpu_usagemhz=4165.00;; cpu_usage=6.42%;;
CHECK_VMWARE_API.PL OK - cpu usage=4165.00 MHz (6.42%) | cpu_usagemhz=4165.00;; cpu_usage=6.42%;;
CHECK_VMWARE_API.PL OK - cpu usage=4165.00 MHz (6.42%) | cpu_usagemhz=4165.00;; cpu_usage=6.42%;;
CHECK_VMWARE_API.PL OK - cpu usage=4621.00 MHz (7.13%) | cpu_usagemhz=4621.00;; cpu_usage=7.13%;;

Anyway to force the script to fetch new data? Nagios already manage the check intervals. I presume, I have the same issue with the datastore usage, but refresh must be really spread apart.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_vmware_api.pl and datastores

Post by lmiltchev »

Nagios should be fetching new data every time the check is run, however if you are running the checks too fast, this may not happen. How often are you going to be running your checks? The "default" check interval set by our wizard is 5 minutes, but you are talking about running the check every 5 seconds?!!!

Keep in mind that vmware checks are very CPU intensive, so using a very small check interval would lead to severely degrading the Nagios XI performance. In my opinion, any checks that are run on an interval shorter than one minute don't make much sense. It will still take some time before contacts are notified (the email gets received), and it will take some time before people react to the notification, and start looking into the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
typer100
Posts: 41
Joined: Tue Sep 25, 2018 7:22 am

Re: check_vmware_api.pl and datastores

Post by typer100 »

lmiltchev, I run the script from the command line...not in nagios yet. It doesn't do what is supposed to do. testing first.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_vmware_api.pl and datastores

Post by lmiltchev »

The plugin receives the data from the vSphere, which samples the performance data every 20 seconds.

https://pubs.vmware.com/vsphere-50/inde ... .18.4.html

So, your checks should be at least 20 seconds apart.
Be sure to check out our Knowledgebase for helpful articles and solutions!
typer100
Posts: 41
Joined: Tue Sep 25, 2018 7:22 am

Re: check_vmware_api.pl and datastores

Post by typer100 »

Yep it's ok for the rest of my checks (CPU, mem, etc...). 20 sec is far from real time, but I can live with that.
But for what I can read. Datastore usage doesn't update every 20 sec. Only in the VC.

I guess I will need to work with alerts within the VC (SNMP and emails)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_vmware_api.pl and datastores

Post by lmiltchev »

Fair enough. Let us know if you have any more questions or it's OK to close this topic. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked