Page 1 of 1
check_vmware_api.pl and datastores
Posted: Fri Jun 14, 2019 7:49 am
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.
Re: check_vmware_api.pl and datastores
Posted: Fri Jun 14, 2019 1:15 pm
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.
Re: check_vmware_api.pl and datastores
Posted: Tue Jun 18, 2019 6:35 am
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.
Re: check_vmware_api.pl and datastores
Posted: Tue Jun 18, 2019 10:42 am
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.
Re: check_vmware_api.pl and datastores
Posted: Tue Jun 18, 2019 12:16 pm
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.
Re: check_vmware_api.pl and datastores
Posted: Tue Jun 18, 2019 1:38 pm
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.
Re: check_vmware_api.pl and datastores
Posted: Tue Jun 18, 2019 6:13 pm
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)
Re: check_vmware_api.pl and datastores
Posted: Wed Jun 19, 2019 8:52 am
by lmiltchev
Fair enough. Let us know if you have any more questions or it's OK to close this topic. Thank you!