NRPE Issue
NRPE Issue
Hi All.
Running a Nagios server with verious clients running the NRPE plugin. I have a script for checking mysql replication. If I run it direct from the main Nagios server /usr/lib/nagios/plugins/check_nrpe -H monitored.com -c check_mysql NRPE: Unable to read output
If you run the following command from the host /usr/local/nagios/libexec/check-mysql-slave.pl
OK - Waiting for master to send event, replicating host xx.xx.xx.xx:3306
This is what is in the client nrpe.cfg command[check_sql]=/usr/local/nagios/libexec/check-mysql-slave.pl
This in on the nagios server
define service{
use generic-service
host_name server102.xxxxxx.co.uk
service_description # SQL replication
#contact_groups ux-admins, noc-op
check_command check_nrpe!check_sql
}
I have a similar script running for a memory check which did not work until I installed apt-get install bc on the Ubuntu box, although I did not see any errors in the syslog. Just wondering if I need something installed along these lines for it to be seen.
This is the debug details
May 24 09:21:44 slave nrpe[25294]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
May 24 09:21:44 slave nrpe[25294]: Handling the connection...
May 24 09:21:44 slave nrpe[25294]: Host is asking for command 'check_sql' to be run...
May 24 09:21:44 slave nrpe[25294]: Running command: /usr/local/nagios/libexec/check-mysql-slave.pl
May 24 09:21:44 slave nrpe[25294]: Command completed with return code 3 and output:
May 24 09:21:44 slave nrpe[25294]: Return Code: 3, Output: NRPE: Unable to read output
The file has the correct permissions and owner. Am a little confused where I may be going wrong here. Can anyone advise me
Running a Nagios server with verious clients running the NRPE plugin. I have a script for checking mysql replication. If I run it direct from the main Nagios server /usr/lib/nagios/plugins/check_nrpe -H monitored.com -c check_mysql NRPE: Unable to read output
If you run the following command from the host /usr/local/nagios/libexec/check-mysql-slave.pl
OK - Waiting for master to send event, replicating host xx.xx.xx.xx:3306
This is what is in the client nrpe.cfg command[check_sql]=/usr/local/nagios/libexec/check-mysql-slave.pl
This in on the nagios server
define service{
use generic-service
host_name server102.xxxxxx.co.uk
service_description # SQL replication
#contact_groups ux-admins, noc-op
check_command check_nrpe!check_sql
}
I have a similar script running for a memory check which did not work until I installed apt-get install bc on the Ubuntu box, although I did not see any errors in the syslog. Just wondering if I need something installed along these lines for it to be seen.
This is the debug details
May 24 09:21:44 slave nrpe[25294]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
May 24 09:21:44 slave nrpe[25294]: Handling the connection...
May 24 09:21:44 slave nrpe[25294]: Host is asking for command 'check_sql' to be run...
May 24 09:21:44 slave nrpe[25294]: Running command: /usr/local/nagios/libexec/check-mysql-slave.pl
May 24 09:21:44 slave nrpe[25294]: Command completed with return code 3 and output:
May 24 09:21:44 slave nrpe[25294]: Return Code: 3, Output: NRPE: Unable to read output
The file has the correct permissions and owner. Am a little confused where I may be going wrong here. Can anyone advise me
Re: NRPE Issue
Just to verify - are you running:
or
Code: Select all
/usr/lib/nagios/plugins/check_nrpe -H monitored.com -c check_mysqlCode: Select all
/usr/lib/nagios/plugins/check_nrpe -H monitored.com -c check_sqlBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE Issue
Sorry for the delay. Did not know I had a reply. I have been tweaking and playing since.
If I run the file directly on the host machine
/usr/local/nagios/libexec/check-mysql-slave.pl
I get the correct responce
OK - Waiting for master to send event, replicating host xx.xx.xx.xx:3306
When I run this using the NRPE check
/usr/local/nagios/libexec/check_nrpe -H localhost -c check-mysql-replication
I get NRPE: Unable to read output
I have the users on the file set as nagios as I should and I have the file set with the correct permissions
If I run the file directly on the host machine
/usr/local/nagios/libexec/check-mysql-slave.pl
I get the correct responce
OK - Waiting for master to send event, replicating host xx.xx.xx.xx:3306
When I run this using the NRPE check
/usr/local/nagios/libexec/check_nrpe -H localhost -c check-mysql-replication
I get NRPE: Unable to read output
I have the users on the file set as nagios as I should and I have the file set with the correct permissions
Re: NRPE Issue
What happens when you run on the client?
Do you get the NRPE version? For example:
Are you using xinetd?
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H localhostCode: Select all
NRPE v2.12Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE Issue
Thanks for the reply
When I run /usr/local/nagios/libexec/check_nrpe -H localhost
It do get NRPE v2.12
I have another script running on there checking memory and this works with no issues at all.
Thanks
When I run /usr/local/nagios/libexec/check_nrpe -H localhost
It do get NRPE v2.12
I have another script running on there checking memory and this works with no issues at all.
Thanks
Re: NRPE Issue
Do you get the correct response when running your script on the system locally as the nagios user?
Code: Select all
su nagios -s /bin/bash -c /usr/local/nagios/libexec/check-mysql-slave.plRe: NRPE Issue
Yes I get the correct responce
OK - Waiting for master to send event, replicating host xx.xx.xx.xx:3306
Thanks
OK - Waiting for master to send event, replicating host xx.xx.xx.xx:3306
Thanks
Re: NRPE Issue
Can you connect to your client from your nagios server?
Run the following commands in terminal on your nagios server and post the output:
or/and
Run the following commands in terminal on your nagios server and post the output:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client_IP>Code: Select all
nc -z <client_IP> 5666Code: Select all
telnet <client_IP> 5666Be sure to check out our Knowledgebase for helpful articles and solutions!