Scalix 11.x and Nagios/NRPE (v2.5.x) issues

Best practice information from Scalix users relating to integration of Scalix with other products.

Moderator: ScalixSupport

LinuxETC

Scalix 11.x and Nagios/NRPE (v2.5.x) issues

Postby LinuxETC » Thu Oct 04, 2007 6:59 pm

Folks:

I have been working some with the Nagios NRPE plugins provided via the Scalix Wiki. The two (present) issues I have are with the with "check_sxqueue.py" and "check_daemon.py" scripts via NRPE. The error messages I get from the Nagios host end is "NRPE: Unable to read output". When I run these as "non-NRPE" via the command line on the Scalix box, output is received on the CLI. When I run them via "check_nrpe -H localhost -c <insert NRPE variant here>", I also get the same "Unable to read output." results. So this tells me it is something with the NRPE configuration potentially.

For reference, both the Nagios servers (there are two involved here, same results with both) and the Scalix server are CentOS 5.0. The NRPE and Nagios components outside of the Scalix portions are from the DAG repo and current as of this posting.

Thoughts and comments are welcomed here. Thanks in advance.

xinux

Postby xinux » Wed Oct 24, 2007 9:03 am

hi,

there are a few possible reasons.

-is nrpe running (check if port 5666 is open on the host)

-is a check_nrpe -H hostip successful?

-is the nrpe.cfg on the host correctly configured? There should be a line like:

command[check_sxqueue.py]=/usr/lib/nagios/plugins/sxqueue.py (or any other path where your check-scripts are)

-is the nagios-check-script executable for the user who executes the script (should be nagios or daemon)

-did you restart nrpe after changing the configuration?


hope i could help

nlindq
Posts: 33
Joined: Wed Feb 20, 2008 5:56 pm

Postby nlindq » Thu Oct 23, 2008 5:53 pm

I"m posting this reply for anyone else who might be having trouble, despite it being a year later. :-)

I ran into this exact problem, and it turned out to be related to the use of sudo in nrpe.cfg.

When debug=1 is enabled in /etc/nagios/nrpe.cfg, you'll likely see messages like these in your syslog:

Code: Select all

Oct 23 15:42:25 scalix sudo(pam_unix)[11467]: authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=nagios
Oct 23 15:42:26 scalix sudo(pam_unix)[11471]: authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=nagios


By default, the nagios user isn't allowed to execute anything via sudo (which elevates privileges to root level) until you explicitly change the /etc/sudoers file to do so.

As root, run visudo (the secure editor explicitly intended for sudo configuration) and set up something like the following (you likely have slightly different paths):

Code: Select all

nagios      ALL=(ALL)   NOPASSWD:/usr/lib/nagios/plugins/scalix/check_daemons.py
nagios      ALL=(ALL)   NOPASSWD:/usr/lib/nagios/plugins/scalix/check_inet_connections.py
nagios      ALL=(ALL)   NOPASSWD:/usr/lib/nagios/plugins/scalix/check_inode.py
nagios      ALL=(ALL)   NOPASSWD:/usr/lib/nagios/plugins/scalix/check_memory.py
nagios      ALL=(ALL)   NOPASSWD:/usr/lib/nagios/plugins/scalix/check_queues.py
nagios      ALL=(ALL)   NOPASSWD:/usr/lib/nagios/plugins/scalix/check_services.py
nagios      ALL=(ALL)   NOPASSWD:/usr/lib/nagios/plugins/scalix/check_test_python.py


These changes will explicitly allow the nagios user to run each of the listed commands via sudo. You could instead use a single line like:

Code: Select all

nagios      ALL=(ALL)   NOPASSWD: ALL


but that makes me less comfortable from a security perspective.


Return to “Third Party Integration”



Who is online

Users browsing this forum: No registered users and 1 guest