Page 1 of 1

CHECK_VMWARE_API.PL CRITICAL - Host "" does not exist

Posted: Tue Dec 20, 2022 3:00 am
by lzdravkov
Hello,

I'm facing an issue while using the plugin check_vmware_api.pl .
As it is visible in the error it says that the Host does not exist.

/usr/local/nagios/libexec/check_vmware_api.pl -H myvmware01 -f "/usr/local/nagiosxi/etc/components/vmware/myvmware01_auth.txt" -l "CPU"
Use of uninitialized value in concatenation (.) or string at /usr/local/nagios/libexec/check_vmware_api.pl line 957.
CHECK_VMWARE_API.PL CRITICAL - Host "" does not exist

The DNS is okay and the host exist, so any ideas what could be the problem?
Thanks in advance.

Re: CHECK_VMWARE_API.PL CRITICAL - Host "" does not exist

Posted: Wed Dec 21, 2022 5:27 pm
by gormank
ping myvmware01
Run the check command using the IP instead of the hostname.

Re: CHECK_VMWARE_API.PL CRITICAL - Host "" does not exist

Posted: Tue Jan 03, 2023 5:42 am
by lzdravkov
gormank wrote:ping myvmware01
Run the check command using the IP instead of the hostname.
Thanks for the comment Gormank,

I tried it but it still does not work.

#ping myvmware01
#PING ping myvmware01 (10.10.20.11) 56(84) bytes of data.
#64 bytes from myvmware01 (10.10.20.11): icmp_seq=1 ttl=62 time=1.33 ms

#/usr/local/nagios/libexec/check_vmware_api.pl -H 10.10.20.11 -f "/usr/local/nagiosxi/etc/components/vmware/myvmware01_auth.txt" -l #"CPU"
#Use of uninitialized value in concatenation (.) or string at /usr/local/nagios/libexec/check_vmware_api.pl line 957.
#CHECK_VMWARE_API.PL CRITICAL - Host "" does not exist

The strange here is that I have another host where it works perfectly.


#ping myvmware02
#PING myvmware02 (10.10.10.11) 56(84) bytes of data.
#64 bytes from myvmware02 (10.10.10.11): icmp_seq=1 ttl=64 time=1.04 ms


# /usr/local/nagios/libexec/check_vmware_api.pl -H myvmware02 -f "/usr/local/nagiosxi/etc/components/vmware/myvmware02 _auth.txt" -l "CPU"
CHECK_VMWARE_API.PL OK - cpu usage=16401.00 MHz (24.46%) | cpu_usagemhz=16401.00;; cpu_usage=24.46%;;

Re: CHECK_VMWARE_API.PL CRITICAL - Host "" does not exist

Posted: Wed Jan 04, 2023 1:02 am
by gormank
Maybe try running on a host that doesn't exist and see what the error is?
Try logging into the nonworking host using the uname/passwd from the file?
You know it works on the one host, so it would seem to be an issue in myvmware01.
Finally, have a look at check_vmware_api.pl around line 957 and a bit above to see why you're seeing "uninitialized value in concatenation" at that point.