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

Undefined subroutine &Vim::unset_logout_on_disconnect called at ./check_vmware_esx.pl line 1833 #120

Closed frayber closed 6 years ago

frayber commented 7 years ago

Hi, when I execute:

./check_vmware_esx.pl -H host -u 'nagios' -p 'password' -S cpu

I get 2 different errors, depending on host:

length() used on @array (did you mean "scalar(@array)"?) at /usr/lib64/perl5/IO/Compress/Zlib/Extra.pm line 198. Undefined subroutine &Vim::unset_logout_on_disconnect called at ./check_vmware_esx.pl line 1833. End Disconnect

or

length() used on @array (did you mean "scalar(@array)"?) at /usr/lib64/perl5/IO/Compress/Zlib/Extra.pm line 198. Use of uninitialized value in concatenation (.) or string at modules/process_perfdata.pm line 117. Host does not exist

I checked the Net-HTTP version (as reported in #54 issue) and the version reported by yum is 6.06-2, from cpan 6.16. I don't know if is this the problem. My plugin version is 0.9.26. Any ideas?

frayber commented 7 years ago

I updated the perl library and the first warning (length() used on @array...) disappeared:

cpan IO::Compress::Zlib::Extra

the other errors remain

BaldMansMojo commented 7 years ago

Which SDK version? 6.x? Unsupported and not needed. SDK 6.x is buggy. Use latest 5.x. 6.x is not needed unless I use features of that version.

All your error messages are belongin to the SDK. So please first test the SDK with the Vmware CLI tools deliverd with the SDK. Normally when these tools are working you have noch problems with the plugin. And be sure - if I will use 6.x it will be tested. I will close this issue for now. Ich CLI works and you still have problems feel free to reopen this issue.

Regards - Martin

BaldMansMojo commented 7 years ago

Sorry - I read to fast. So I reopened this issue. It may happen that the SDK don't interact correctly with your VMware server. In this case such messages happen. But I can't fix this in the plugin because the error does'nt happen within the plugin.

frayber commented 7 years ago

Hi Martin, I use 5.5 version. I'll test the SDK, I'll let you know. Thank you very much.

frayber commented 7 years ago

Which vcli command should I test? For testing this error:

Use of uninitialized value in concatenation (.) or string at modules/process_perfdata.pm line 117. Host does not exist

if I use Ip address instead of hostname I get:

Undefined subroutine &Vim::unset_logout_on_disconnect called at ./check_vmware_esx.pl line 1833. End Disconnect

pat2858 commented 6 years ago

Same problem here.

When i execute _"./check_vmwareesx.pl --host 10.10.10.10 --username user --password secret --select cpu" i get _"Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/plugins/thirdparty/check_vmware_esx-master/modules/processperfdata.pm line 117. Host does not exist" with SDK 5.5 and SDK 6.5. Tried both.

Test of SDK "./vminfo.pl --server 10.10.10.10 --username user --password secret" works fine.

Any idea?

BaldMansMojo commented 6 years ago

Have you tried -H instead of --host?

pat2858 commented 6 years ago

Same.

"Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/plugins/thirdparty/check_vmware_esx-master/modules/process_perfdata.pm line 117. Host does not exist"

pat2858 commented 6 years ago

Tested it with check_vmware_api Plugin ang get the similar message, that the Host "" does not exist. Any idea? VMWare Host is on VMWare 6.5 Should that work or is that consilation untested?

BaldMansMojo commented 6 years ago

[root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl -H 192.168.3.14 -u nagios -p mon_pass -S cpu --ignore_unknown CPU wait=661965.00 ms - CPU ready=7820.00 ms - CPU usage=17.32%|'cpu_wait'=661965.00ms;;;; 'cpu_ready'=7820.00ms;;;; 'cpu_usage'=17.32%;;;; [root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl -H 192.168.3.14 -u nagios -p mon_pass --select cpu --ignore_unknown CPU wait=653691.00 ms - CPU ready=7985.00 ms - CPU usage=20.88%|'cpu_wait'=653691.00ms;;;; 'cpu_ready'=7985.00ms;;;; 'cpu_usage'=20.88%;;;; [root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl -H 192.168.3.14 -u nagios --password mon_pass --select cpu CPU wait=636546.00 ms - CPU ready=7918.00 ms - CPU usage=29.50%|'cpu_wait'=636546.00ms;;;; 'cpu_ready'=7918.00ms;;;; 'cpu_usage'=29.50%;;;; [root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl -H 192.168.3.14 -u nagios --password=mon_pass --select cpu CPU wait=636546.00 ms - CPU ready=7918.00 ms - CPU usage=29.50%|'cpu_wait'=636546.00ms;;;; 'cpu_ready'=7918.00ms;;;; 'cpu_usage'=29.50%;;;; [root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl --host 192.168.3.14 -u nagios --password=mon_pass --select cpu CPU wait=636455.00 ms - CPU ready=7548.00 ms - CPU usage=30.17%|'cpu_wait'=636455.00ms;;;; 'cpu_ready'=7548.00ms;;;; 'cpu_usage'=30.17%;;;; [root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl --host=192.168.3.14 -u nagios --password=mon_pass --select cpu CPU wait=657566.00 ms - CPU ready=7663.00 ms - CPU usage=21.00%|'cpu_wait'=657566.00ms;;;; 'cpu_ready'=7663.00ms;;;; 'cpu_usage'=21.00%;;;; [root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl --host=192.168.3.14 --user nagios --password=mon_pass --select cpu CPU wait=656580.00 ms - CPU ready=7770.00 ms - CPU usage=21.13%|'cpu_wait'=656580.00ms;;;; 'cpu_ready'=7770.00ms;;;; 'cpu_usage'=21.13%;;;; [root@nagioshost ~]# /usr/lib/nagios/vmware/check_vmware_esx.pl --host=192.168.3.14 --user=nagios --password=mon_pass --select cpu CPU wait=656580.00 ms - CPU ready=7770.00 ms - CPU usage=21.13%|'cpu_wait'=656580.00ms;;;; 'cpu_ready'=7770.00ms;;;; 'cpu_usage'=21.13%;;;;

As you can see I tested it with any combination to pass the options to the plugin. Worx. OS: CentOS/RHEL 6.5 SDK: 5.x (6.5 ist reported ot work too but not tested by me) WSX: VMware ESXi 6.0.0 build-5224934 VMware, Inc. x86_64

I think the error is within your configuration. Especially if it happens with the other plugin too. You can try to debug it with Perl Data::Dumper.

Try to get the data with esxcli . This also uses the SOAP interface.. Sorry - can't help you.

pat2858 commented 6 years ago

Happens only with ESXi 6.5 in my setup. ESXi 6.0 (that you tested) works here too. Do you have the opportunity to test it with ESXi 6.5?

BaldMansMojo commented 6 years ago

Currently not.Only 6.0.0. But when it happens with 6.5 and nor with 6.0 neither the plugin nor the SDK will be the fault. The API will be stable. So your 6.5 seems to deliver scrap. As mentioned earlier use esxcli for testing.