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 $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711 #158

Closed Claudio75IT closed 5 years ago

Claudio75IT commented 5 years ago

I am trying to get temperatures for check vmware host with Nagios, and i have some problems.

I run the script with this syntax:

./check_vmware_esx.pl -H [cut] -u [cut] -p [cut] -S, --select=runtime -s, --subselect=temp --multiline

And the output is something like:

Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. [repeated several times]

Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. [repeated several times]

OK: All 27 temperature checks are GREEN.
Ok: = 25
Ok: = 30
Ok: = 25
Ok: = 25
Ok: = 28
Ok: = 29
Ok: = 29
Ok: = 28
Ok: = 24
Ok: = 40
Ok: = 40
Ok: = 26
Ok: = 27
Ok: = 27
Ok: = 26
Ok: = 31
Ok: = 36
Ok: = 27
Ok: = 20
Ok: = 41
Ok: = 24
Ok: = 26
Ok: = 26
Ok: = 26
Ok: = 40
Ok: = 40
Ok: = 16|''=25;;;; ''=30;;;; ''=25;;;; ''=25;;;; ''=28;;;; ''=29;;;; ''=29;;;; ''=28;;;; ''=24;;;; ''=40;;;; ''=40;;;; ''=26;;;; ''=27;;;; ''=27;;;; ''=26;;;; ''=31;;;; ''=36;;;; ''=27;;;; ''=20;;;; ''=41;;;; ''=24;;;; ''=26;;;; ''=26;;;; ''=26;;;; ''=40;;;; ''=40;;;; ''=16;;;;

If i try to use this with nagios, nagios report me an error like "(No output on stdout) stderr: /bin/sh: 1: Syntax error: Unterminated quoted string"

Some configuration data:

Used VmWare: HPE Customized Image ESXi 6.7.0 Update 1 version 670.U1.10.3.5 Used Linux as Nagios Server: Ubuntu 16.04.6 LTS Perl version: perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux-gnu-thread-multi Nagios version: Nagios Core 4.2.0

Service configuration under Nagios:

define command{ command_name check_vmware_esx.pl command_line $USER1$/check_vmware_esx.pl $ARG1$ }

define service{ use external-service host_name [striped] service_description Temperature Check check_command check_vmware_esx.pl!-H [cut] -u nagios -p [cut] -S, --select=runtime -s, --subselect=temp --multiline" }

Note: other checks, like CPU check and Snapshots check works without problems.

BaldMansMojo commented 5 years ago

Linux / Unix for beginners: NOT -S, --select=runtime -s, --subselect=temp. --select=runtime OR -S runtime --subselect=temp OR -s temp

And for any plugin testing:

1) test it from the command line using the user your monitoring system runs with. 2) If there are nore errors you should implement the check.

This should help. If there are still problems reopen this issue.

Claudio75IT commented 5 years ago

I am sorry to inform the problem still remains, as you can see below:

su - nagios -c "/usr/local/nagios/libexec/check_vmware_esx.pl -H [CUT] -u [CUT] -p [CUT] -S runtime --subselect=temp --multiline" No directory, logging in with HOME=/ Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 695. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. Use of uninitialized value $name in concatenation (.) or string at /opt/check_vmware_esx/modules/host_runtime_info.pm line 711. OK: All 27 temperature checks are GREEN.
Ok: = 25
Ok: = 30
Ok: = 26
Ok: = 25
Ok: = 28
Ok: = 29
Ok: = 29
Ok: = 28
Ok: = 24
Ok: = 40
Ok: = 40
Ok: = 26
Ok: = 27
Ok: = 27
Ok: = 26
Ok: = 31
Ok: = 36
Ok: = 27
Ok: = 20
Ok: = 41
Ok: = 24
Ok: = 26
Ok: = 26
Ok: = 26
Ok: = 40
Ok: = 40
Ok: = 16|''=25;;;; ''=30;;;; ''=26;;;; ''=25;;;; ''=28;;;; ''=29;;;; ''=29;;;; ''=28;;;; ''=24;;;; ''=40;;;; ''=40;;;; ''=26;;;; ''=27;;;; ''=27;;;; ''=26;;;; ''=31;;;; ''=36;;;; ''=27;;;; ''=20;;;; ''=41;;;; ''=24;;;; ''=26;;;; ''=26;;;; ''=26;;;; ''=40;;;; ''=40;;;; ''=16;;;;

And used as module with nagios, it reports "(No output on stdout) stderr: /bin/sh: 1: Syntax error: Unterminated quoted string ".

BaldMansMojo commented 5 years ago

Sorry - tested it on several servers without any problems. It seems that the plugin doesn't get all values from your VWware host. Have you tested another with some other host?

The Nagios output is nonsense because it's based on the firstline of output from the plugin.

BaldMansMojo commented 5 years ago

This is a vilid output; /usr/lib/nagios/vmware/check_vmware_esx.pl -H 123.123.123.123 -u nagiosuser -p nagiospass -S runtime -s temp OK: All 22 temperature checks are GREEN. Ok: Memory Device 17 DIMM-3F = 35C Ok: Memory Device 16 DIMM-2F = 34C Ok: Memory Device 15 DIMM-1F = 31C Ok: Memory Device 14 DIMM-3E = 31C Ok: Memory Device 13 DIMM-2E = 32C Ok: Memory Device 12 DIMM-1E = 33C Ok: Memory Device 11 DIMM-3D = 28C Ok: Memory Device 10 DIMM-2D = 31C Ok: Memory Device 9 DIMM-1D = 32C Ok: Memory Device 8 DIMM-3C = 28C Ok: Memory Device 7 DIMM-2C = 29C Ok: Memory Device 6 DIMM-1C = 30C Ok: Memory Device 5 DIMM-3B = 27C Ok: Memory Device 4 DIMM-2B = 28C Ok: Memory Device 3 DIMM-1B = 28C Ok: Memory Device 2 DIMM-3A = 25C Ok: Memory Device 1 DIMM-2A = 25C Ok: Memory Device 0 DIMM-1A = 26C Ok: Processor 1 CPU2 = 30C Ok: Processor 0 CPU1 = 30C Ok: System Board 0 Systemboard = 36C Ok: External Environment 0 Ambient = 17.5C|'Memory Device 17 DIMM-3F'=35C;;;; 'Memory Device 16 DIMM-2F'=34C;;;; 'Memory Device 15 DIMM-1F'=31C;;;; 'Memory Device 14 DIMM-3E'=31C;;;; 'Memory Device 13 DIMM-2E'=32C;;;; 'Memory Device 12 DIMM-1E'=33C;;;; 'Memory Device 11 DIMM-3D'=28C;;;; 'Memory Device 10 DIMM-2D'=31C;;;; 'Memory Device 9 DIMM-1D'=32C;;;; 'Memory Device 8 DIMM-3C'=28C;;;; 'Memory Device 7 DIMM-2C'=29C;;;; 'Memory Device 6 DIMM-1C'=30C;;;; 'Memory Device 5 DIMM-3B'=27C;;;; 'Memory Device 4 DIMM-2B'=28C;;;; 'Memory Device 3 DIMM-1B'=28C;;;; 'Memory Device 2 DIMM-3A'=25C;;;; 'Memory Device 1 DIMM-2A'=25C;;;; 'Memory Device 0 DIMM-1A'=26C;;;; 'Processor 1 CPU2'=30C;;;; 'Processor 0 CPU1'=30C;;;; 'System Board 0 Systemboard'=36C;;;; 'External Environment 0 Ambient'=17.5C;;;;

Claudio75IT commented 5 years ago

Sorry but i don't have any other vmware host to test with.

How i can debug this issue?

BaldMansMojo commented 5 years ago

There is nothing to debug because the program has no problem. Your VMware system doesn't answer correctly. Normally this is if CIM server hangs. It is also possible, that your VMware system doesn't show temperature values. So if you can't see such values from your Vcenter/VCSA you can't monitor it. Can you tell me something about your VMware system and your hardware?