VMware Plugin Issue
Re: VMware Plugin Issue
Also check the permissions on the files under /usr/share/perl5/VMware and edit /usr/local/nagios/libexec/check_esx3.pl, changing the second line from:
# nagios: +epn
to:
# nagios: -epn
This is a permissions issue but for the life of me I haven't been able to reproduce it. Do you have any additional security on the machine like selinux enabled:
sestatus
?
# nagios: +epn
to:
# nagios: -epn
This is a permissions issue but for the life of me I haven't been able to reproduce it. Do you have any additional security on the machine like selinux enabled:
sestatus
?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: VMware Plugin Issue
# ls -al /usr/share/perl5/VMware/
total 3448
drwxr-xr-x. 3 root root 4096 Feb 23 13:14 .
drwxr-xr-x. 54 root root 4096 Feb 23 13:14 ..
-r--r--r--. 1 root root 6605 Feb 23 13:14 LookupService.pm
drwxr-xr-x. 2 root root 4096 Feb 23 13:14 pyexe
-r-xr-xr-x. 1 root root 3356 Feb 23 13:14 SSOConnection.pm
-r--r--r--. 1 root root 90818 Feb 23 13:14 VICommon.pm
-r--r--r--. 1 root root 41509 Feb 23 13:14 VICredStore.pm
-r--r--r--. 1 root root 27760 Feb 23 13:14 VIExt.pm
-r--r--r--. 1 root root 23736 Feb 23 13:14 VILib.pm
-r--r--r--. 1 root root 234786 Feb 23 13:14 VIM25Runtime.pm
-r--r--r--. 1 root root 2225566 Feb 23 13:14 VIM25Stub.pm
-r--r--r--. 1 root root 87988 Feb 23 13:14 VIM2Runtime.pm
-r--r--r--. 1 root root 741859 Feb 23 13:14 VIM2Stub.pm
-r--r--r--. 1 root root 2150 Feb 23 13:14 VIMRuntime.pm
-r--r--r--. 1 root root 498 Feb 23 13:14 VIRuntime.pm
Changed check_esx3.pl:
#!/usr/bin/perl -w
# nagios: -epn
SELinux is enabled, but is in permissive mode:
# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
total 3448
drwxr-xr-x. 3 root root 4096 Feb 23 13:14 .
drwxr-xr-x. 54 root root 4096 Feb 23 13:14 ..
-r--r--r--. 1 root root 6605 Feb 23 13:14 LookupService.pm
drwxr-xr-x. 2 root root 4096 Feb 23 13:14 pyexe
-r-xr-xr-x. 1 root root 3356 Feb 23 13:14 SSOConnection.pm
-r--r--r--. 1 root root 90818 Feb 23 13:14 VICommon.pm
-r--r--r--. 1 root root 41509 Feb 23 13:14 VICredStore.pm
-r--r--r--. 1 root root 27760 Feb 23 13:14 VIExt.pm
-r--r--r--. 1 root root 23736 Feb 23 13:14 VILib.pm
-r--r--r--. 1 root root 234786 Feb 23 13:14 VIM25Runtime.pm
-r--r--r--. 1 root root 2225566 Feb 23 13:14 VIM25Stub.pm
-r--r--r--. 1 root root 87988 Feb 23 13:14 VIM2Runtime.pm
-r--r--r--. 1 root root 741859 Feb 23 13:14 VIM2Stub.pm
-r--r--r--. 1 root root 2150 Feb 23 13:14 VIMRuntime.pm
-r--r--r--. 1 root root 498 Feb 23 13:14 VIRuntime.pm
Changed check_esx3.pl:
#!/usr/bin/perl -w
# nagios: -epn
SELinux is enabled, but is in permissive mode:
# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
Re: VMware Plugin Issue
Running the check command as the nagios user still errors out: ESX3 CRITICAL - HOST CPU Unknown error
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: VMware Plugin Issue
@benjohns, Please try using the updated plugin that I've attached to this post. Don't forget to give it the permissions:
Code: Select all
chmod +x 777 check_esx3.plYou do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: VMware Plugin Issue
Installed the new plugin:
-rwxr-xr-x. 1 apache nagios 169439 Mar 2 15:54 check_esx3.pl
Then ran chmod:
-rwxrwxrwx. 1 apache nagios 169439 Mar 2 15:54 check_esx3.pl
Now XI is throwing this error when trying to run the check:
(No output on stdout) stderr: Can't locate Nagios/Plugin/Functions.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
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_esx3.pl line 40.
-rwxr-xr-x. 1 apache nagios 169439 Mar 2 15:54 check_esx3.pl
Then ran chmod:
-rwxrwxrwx. 1 apache nagios 169439 Mar 2 15:54 check_esx3.pl
Now XI is throwing this error when trying to run the check:
(No output on stdout) stderr: Can't locate Nagios/Plugin/Functions.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
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_esx3.pl line 40.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: VMware Plugin Issue
@benjohns, Please try the following command to install the missing module:
Code: Select all
yum install perl-Nagios-Plugin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: VMware Plugin Issue
After installing perl-Nagios-Plugin, the checks are again timing out from within XI:
(Service check timed out after 180.01 seconds)
Running the check command from within CCM yields the following output:
[nagios@HOST ~]$ /usr/local/nagios/libexec/check_esx3.pl -H "ESXi IP" -f "/usr/local/nagiosxi/etc/components/vmware/ESXiFQDN_auth.txt" -l "CPU"
I am testing these checks each time against multiple ESXi hosts; all of our ESXi hosts are on the same VMware build.
(Service check timed out after 180.01 seconds)
Running the check command from within CCM yields the following output:
[nagios@HOST ~]$ /usr/local/nagios/libexec/check_esx3.pl -H "ESXi IP" -f "/usr/local/nagiosxi/etc/components/vmware/ESXiFQDN_auth.txt" -l "CPU"
I am testing these checks each time against multiple ESXi hosts; all of our ESXi hosts are on the same VMware build.
Re: VMware Plugin Issue
First, disable selinux and see if that fixes the issue.
Sometimes permissive mode causes issues.
Second, verify that the username and password in the auth file is correct.
Third, verify that the permissions for the auth file is correct.
This is an example of how they should be set.
Let us know if any of the above is causing the issue.
Sometimes permissive mode causes issues.
Second, verify that the username and password in the auth file is correct.
Code: Select all
/usr/local/nagiosxi/etc/components/vmware/ESXiFQDN_auth.txtThis is an example of how they should be set.
Code: Select all
-rw-r--r-- 1 apache nagios esx_auth.txtBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: VMware Plugin Issue
1 - $ sestatus
SELinux status: disabled
2 - Credentials are correct
3 - -rw-r--r--. 1 apache nagios 37 Feb 27 15:00 [HOST]_auth.txt
I disabled SELinux, then verified the other two. Service checks are still timing out:
(Service check timed out after 180.01 seconds)
SELinux status: disabled
2 - Credentials are correct
3 - -rw-r--r--. 1 apache nagios 37 Feb 27 15:00 [HOST]_auth.txt
I disabled SELinux, then verified the other two. Service checks are still timing out:
(Service check timed out after 180.01 seconds)
Re: VMware Plugin Issue
Let's turn on debugging in Nagios so we can see what the issue is when the check is ran.
Edit the /usr/local/nagios/etc/nagios.cfg file and change the following options to the values in the example below.
Save the changes and restart nagios by running
Then, let the check run notmally in the XI GUI and when it times out, look in the debug file
And post any information on how the check was ran and any errors.
FYI, the debug file fills up quickly so if you miss the entries, you may have to try again.
Edit the /usr/local/nagios/etc/nagios.cfg file and change the following options to the values in the example below.
Code: Select all
debug_level=-1
debug_verbosity=1Code: Select all
service nagios restartCode: Select all
/usr/local/nagios/var/nagios.debugFYI, the debug file fills up quickly so if you miss the entries, you may have to try again.
Be sure to check out our Knowledgebase for helpful articles and solutions!