Page 1 of 1

Plugin check_xenvm.pl

Posted: Mon Jul 11, 2011 11:59 pm
by srrhd
Hi,

I am trying to use the check_xenvm.pl to monitor the virtual machine on a XEN server.
I had a right problem that i have fixed by adding the user nagios to the sudoers. So now the execution of the plugin as nagios on the Xen server works properly:

Code: Select all

[root@xen]# sudo -u nagios /usr/lib/nagios/plugins/check_xenvm.sh -w 1 -c 1
OK: Xen Hypervisor "xen.srrhd.re" is running Xen VMs: vm1, vm2
But when i execute this plugin throught the NRPE agent from the nagiosXI server i got :

Code: Select all

[root@nagiosxi libexec]# ./check_nrpe -H X.X.X.X -n -t 30 -c check_xen -a '-w 1 -c 1'
Critical Xen VMs Usage - Total NB: 0 - detected VMs:
I tryied adding the plugins directory as sudoers for nagios:

Code: Select all

nagios ALL=(ALL) NOPASSWD:/usr/sbin/xm list
nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/
But the error remain.

Does anyone got an idea ? When executing the check_nrpe, isn't the user nagios that executes the plugin on the remote server ?

Aurelien.

Re: Plugin check_xenvm.pl

Posted: Tue Jul 12, 2011 9:24 am
by agriffin
Can you post your nrpe command definition for check_xen? You can also check that the dont_blame_nrpe option is set to 1 in your nrpe.cfg.

Re: Plugin check_xenvm.pl

Posted: Wed Jul 13, 2011 12:09 am
by srrhd
Yes the dont_blame_nrpe is set to 1. The NRPE part works perfectly. I might be wrong, but i always pass the argument throught the check_nrpe to be able to configure everything from the NagiosXI server and all my others checks works.

When NRPE logs are activated i just got any.

Here is the command definition :

Code: Select all

command[check_xen]=/usr/lib/nagios/plugins/check_xenvm.sh $ARG1$

Re: Plugin check_xenvm.pl

Posted: Wed Jul 13, 2011 9:42 am
by agriffin
Can you try the steps outlined here? I know he says he's using check_xenvm.sh with SSH instead of NRPE, but it's worth a shot. I have no Xen servers to test this on. You'll need to substitute /check_xenvm.sh with /usr/lib/nagios/plugins/check_xenvm.sh.

Re: Plugin check_xenvm.pl

Posted: Fri Jul 15, 2011 6:22 am
by srrhd
Thanks to force me to check what i have done !!

I forgot to add into /etc/sudoers

Code: Select all

Defaults:nagios !requiretty
Everything works now !

Re: Plugin check_xenvm.pl

Posted: Fri Jul 15, 2011 9:36 am
by mguthrie
Good deal, glad it's working for you!