Page 1 of 1

New monitoring VMware plugin return incorrect values

Posted: Fri Jun 21, 2024 9:22 am
by evt
Hello,
I'm trying to use the new monitoring VMware plugin "vSphere" on Nagios XI 2024R1.1.4, but unfortunately, many commands are returning incorrect values.
My Nagios environment:
- Nagios XI 2024R1.1.4
- Nagios Server RHEL 8.10
- check_vsphere_xi.py 1.0.3
My VMWare environment:
- vCenter 8.0.2.00100 (build 22617221)
- Hypervisors ESXi, 7.0.3 (build 22348816)
Incorrect return values:
# python3 check_vsphere_xi.py -H "MyvCenter" -f "auth.txt" --list-clusters
=> return 1 cluster whereas there is 3 clusters
# python3 check_vsphere_xi.py -H "MyvCenter" -f "auth.txt" -C "Cluster" -l "MEM"
=> OK: usage=0.69%, overhead=3909.11 MB, memctl=0.00 MB, consumed=452757.60 MB | mem_usagemb=452757.60MB;; mem_usage=0.69%;; mem_overhead=3909.11MB;; mem_swap=0.00MB;; mem_memctl=0.00MB;;
Memory usage in MB is correct but usage in percent is wrong (right value is 59% and not 0,69%)
# python3 check_vsphere_xi.py -H "MyvCenter" -f "auth.txt" -N "MyVM" -l CPU -s USAGE
=> OK: MyVM usage=273.00% | cpu_usage=273.00%;; (right value is 1%, the VM has only 1 vCPU)
Thanks for your help

Re: New monitoring VMware plugin return incorrect values

Posted: Fri Jun 21, 2024 9:48 am
by lgute
Hi @evt, thanks for reaching out.

I will create a bug report on this.

Re: New monitoring VMware plugin return incorrect values

Posted: Mon Jun 24, 2024 7:53 am
by evt
Hi Laura,

Thanks for your feed back.
Please note some additional issues with other options, always with the same command (check_vsphere_xi.py) :
# python3 check_vsphere_xi.py -H "MyvCenter" -f "auth.txt" -C "MyCluster" -l vmfs
=> OK: LOCAL_ESX1(free)=160355.58 MB (99.07%), LOCAL_ESX2(free)=160892.45 MB (99.07%) | LOCAL_ESX1=160355.58MB;; LOCAL_ESX2=160892.45MB;;
Only ESX local datastores are showed, all my NFS datastores are missing
# python3 check_vsphere_xi.py -H "MyvCenter" -f "auth.txt" -C "MyCluster" -l vmfs -o used
=> OK: LOCAL_ESX1(free)=160355.58 MB (99.07%), LOCAL_ESX2(free)=160892.45 MB (99.07%) | LOCAL_ESX1=160355.58MB;; LOCAL_ESX2=160892.45MB;;
Same result as the first command, no used space report but still free space
# python3 check_vsphere_xi.py -H "MyvCenter" -f "auth.txt" -D "MyDataCenter" -l mem
Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_vsphere_xi.py", line 3248, in <module>
datacenter_mem_info(datacenter, args.subcommand)
File "/usr/local/nagios/libexec/check_vsphere_xi.py", line 2411, in datacenter_mem_info
for dc in datacenter:
TypeError: 'vim.HostSystem' object is not iterable

Same error with commands "io", "vmfs", "runtime"
Thanks

Re: New monitoring VMware plugin return incorrect values

Posted: Mon Jun 24, 2024 1:31 pm
by lgute
Hi @evt,

Thank you for taking the time to provide this information. I will add it to the bug report.

Re: New monitoring VMware plugin return incorrect values

Posted: Wed Oct 30, 2024 2:49 pm
by amoss24
Apologies for hijacking this thread, but I am in a similar boat attempting to deploy the Python based VMware plugin. Looking at the values for datastores, it seems like there must be an incorrect conversion or calculation being done somewhere.
For a given datastore the values returned by the XI plugin look way off:
Data Used: 1756830.37 MB
Data Total: 9895336.21 MB
Percentage in Use: (17.75%)

If I run Get-Datastore from the PowerCLI PowerShell module, the info there seems to confirm this:

Code: Select all

Get-Datastore -Name 'datastore_name'

Name                           FreeSpaceGB      CapacityGB
----                           -----------      ----------
'datastore_name'                1,639.914       9,215.750
I'm not familiar with all the ins and outs of vSphere's API, but I am not certain there is a way to directly return the utilization. At least with PowerCLI, I have found many references online that suggest the utilization must be calculated by subtracting the capacity and free space values manually. It looks to me like the data used and percentage in use values are actually the free space.
-Austin

Re: New monitoring VMware plugin return incorrect values

Posted: Thu Oct 31, 2024 8:42 am
by lgute
Hi @amoss24, thanks for reaching out.

No need to apologize. This helps us keep track of how many people are having issues.

When this issue is resolved, it will show up in the Changelog with the marker [GL:XI#1170].