check_esx3 0.2 and 0.5 problem with netowrk monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

check_esx3 0.2 and 0.5 problem with netowrk monitoring

Post by Eurocash »

Hi,

I'm trying to add VMware ESXi version 6.5 host to monitoring, and I cannot get network monitoring to work.
CPU, Input/Output, Datastore Usage, Memory, Services and VM Status are working as expected on 0.2 version of plugin.

This is output from original 0.2 plugin:

Code: Select all

[nagios@nagios ~]$ /usr/local/nagios/libexec/check_esx3.pl -H "esxhost" -f "/usr/local/nagiosxi/etc/components/vmware/esxhost_auth.txt" -l "NET"
ESX3 CRITICAL - Can't use an undefined value as an ARRAY reference at /usr/local/nagios/libexec/check_esx3.pl line 872. | net_receive=48.00KB;; net_send=3.00KB;;
On 0.5 Netowrking and Memory is not working. So I have edited just the Networking service by adding v0.5 plugin with other name. But it gives no output:

Code: Select all

[nagios@nagios~]$ /usr/local/nagios/libexec/check_esx3_0.5.pl -H "esxhost" -f "/usr/local/nagiosxi/etc/components/vmware/esxhost_auth.txt" -l "NET"
I assume that VMware Perl SDK is installed correctly, most of services are monitored correctly.
I will add more hosts (also with older VMware ESXi version, I think it was 5.5).

Any advice to get network in monitoring?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_esx3 0.2 and 0.5 problem with netowrk monitoring

Post by lmiltchev »

Do you get any output if you run your checks with increased verbosity?

Examples:

Code: Select all

/usr/local/nagios/libexec/check_esx3_0.5.pl -H "esxhost" -f "/usr/local/nagiosxi/etc/components/vmware/esxhost_auth.txt" -l "NET" -vvv
/usr/local/nagios/libexec/check_esx3_0.5.pl -H "esxhost" -f "/usr/local/nagiosxi/etc/components/vmware/esxhost_auth.txt" -l "MEM" -vvv
What is the SDK version that you installed on the Nagios XI server?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: check_esx3 0.2 and 0.5 problem with netowrk monitoring

Post by Eurocash »

SDK version:
VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.tar.gz

output for NET:

Code: Select all

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
outpu for MEM is the same:

Code: Select all

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
Check_esx version 0.2.1 has no problem with that. And I think that I know now why it is not showing the network in some hosts. I'm not administrator of ESXi so I do not have access to those. But some machines are working with 0.2.1! It looks like hosts have diffrent Networking sections. I have checked with ESX admin and some have the vswitch in networking secition, some of them not. I do not know good enough perl and I have not investigated the script but I think that if there is no vswitch it throughs critical.
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: check_esx3 0.2 and 0.5 problem with netowrk monitoring

Post by Eurocash »

I have one more information. We are using dvswitch (distributed vswitch) is there any option to monitor them instead of standard vswitch?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_esx3 0.2 and 0.5 problem with netowrk monitoring

Post by scottwilkerson »

Eurocash wrote:SDK version:
VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.tar.gz

output for NET:

Code: Select all

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
outpu for MEM is the same:

Code: Select all

Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_esx3_0.5.pl line 31.
Check_esx version 0.2.1 has no problem with that. And I think that I know now why it is not showing the network in some hosts. I'm not administrator of ESXi so I do not have access to those. But some machines are working with 0.2.1! It looks like hosts have diffrent Networking sections. I have checked with ESX admin and some have the vswitch in networking secition, some of them not. I do not know good enough perl and I have not investigated the script but I think that if there is no vswitch it throughs critical.
In this new version you need to edit the plugin and everywhere you find this

Code: Select all

Nagios::Plugin
replace with this

Code: Select all

Nagios::Monitoring::Plugin
Your previous version which we distributed was already modified.
Eurocash wrote:I have one more information. We are using dvswitch (distributed vswitch) is there any option to monitor them instead of standard vswitch?
According to this post they do work in 0.5.0 version
https://support.nagios.com/forum/viewto ... f=6&t=9327
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: check_esx3 0.2 and 0.5 problem with netowrk monitoring

Post by Eurocash »

Thanks for help! Now everything is working and DVSWITCH is indeed monitored correctly.

In attachment modified check_esx3.pl which worked for me. Maybe someone will make use of this too. :)
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_esx3 0.2 and 0.5 problem with netowrk monitoring

Post by scottwilkerson »

Thanks for sharing your modified version for others.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked