BaldMansMojo / check_vmware_esx

chech_vmware_esx Fork of check_vmware_api.pl
GNU General Public License v2.0
124 stars 67 forks source link

Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 717. #177

Open skupjoe opened 4 years ago

skupjoe commented 4 years ago
admin@monsvc-uni-2a:~$ sudo docker exec -t icinga2 /usr/lib/nagios/plugins/check_vmware_esx.pl \
>     -H lax01w01esx01.us-west1.univoip.local \
>     --datacenter lax01m01vc01.us-west1.univoip.local \
>     --authfile /usr/share/icinga2/authfiles/vdb-vc-auth.env \
>     --nosession \
>     --trace=1 \
>     --select=runtime \
>     --subselect=temp
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 717.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 717.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 717.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 717.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 733.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 733.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 733.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/modules/check_vmware_esx/host_runtime_info.pm line 733.
OK: All 4 temperature checks are GREEN.
Ok:  = 44
Ok:  = 39
Ok:  = 29
Ok:  = 23|''=44;;;; ''=39;;;; ''=29;;;; ''=23;;;;

All other checks that come along the default vmware-esx-soap-host monitoring set for Icinga2 work well, but this one produces single quote marks for the perfata.

This in turn causes the Icinga2 Prometheus exporter metrics page (via plugin of which I am also using separately for storage) to fail to render.

Let me know if there is any other info that I can provide thank you

System Info

VMware ESXi, 6.7.0, 16075168 VMware vCenter 6.7.0, 16243230 PowerEdge R730xd Temps show up from vsphere: image

skupjoe commented 4 years ago

Similar to issue #158

Chrisnet46 commented 3 years ago

I had the same problem.

In host_runtime_info.pm line 694

I changed

name => $1,

to

name => $_->name,

Seems to work now

BaldMansMojo commented 2 years ago

I can't reproduce.

BaldMansMojo commented 2 years ago

I can't reproduce.

jhuebner79 commented 1 year ago

I can reproduce and @Chrisnet46's proposed solution helps.

Output before the change:

# /usr/lib/nagios/custom-plugins/check_vmware_esx.pl -H redacted.somewhwere.net -u icinga -p redacted -S runtime -s temp
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 751.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 751.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 751.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 751.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 767.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 767.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 767.
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/nagios/custom-plugins/modules/host_runtime_info.pm line 767.
OK: All 4 temperature checks are GREEN.
Ok:  = 33
Ok:  = 21
Ok:  = 44
Ok:  = 46|''=33;;;; ''=21;;;; ''=44;;;; ''=46;;;;

and after:

# /usr/lib/nagios/custom-plugins/check_vmware_esx.pl -H redacted.somewhwere.net -u icinga -p redacted -S runtime -s temp
OK: All 4 temperature checks are GREEN.
Ok: System Board 1 Exhaust Temp = 32
Ok: System Board 1 Inlet Temp = 21
Ok: Processor 2 Temp = 41
Ok: Processor 1 Temp = 46|'System Board 1 Exhaust Temp'=32;;;; 'System Board 1 Inlet Temp'=21;;;; 'Processor 2 Temp'=41;;;; 'Processor 1 Temp'=46;;;;

What do you need to debug? Maybe it's not related to the VMware server or its version but rather to the Perl version on the Icinga2 node? This one here is Debian 10 (yes, I know, we can and should upgrade somewhen not too far in the future - on the other hand there's still support for it until June 30th, 2024) sporting This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux-gnu-thread-multi.

Thanks for your time and the good work!

jhuebner79 commented 1 year ago

Forgot to mention: in my case it was line 728 in the file where I had to fix it, we're using the version from the master branch, which as of today is 1.2.5.

jhuebner79 commented 1 year ago

Thanks for reopening. In the meantime I had the chance to upgrade two satellites to Debian 11, but with the same result. Now it's This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-gnu-thread-multi