i am using Nrpe plugin on Ubuntu from nagios exchange check_mysql_slavestatus.
Manually its working from :
root@Bastion-01:/usr/local/nagios/libexec# ./check_mysql_slavestatus -H Slave-ip -P 3306 -u root -p xxxxx -w 10 -c 20
OK: Slave SQL running: Yes Slave IO running: Yes / master: 172.31.20.9 / slave is 0 seconds behind master | delay=0s
Similarly it works from Master DB
root@DB-01:/usr/lib/nagios/plugins# ./check_mysql_slavestatus -H Slave-ip -P 3306 -u root -p xxxxx -w 10 -c 20
OK: Slave SQL running: Yes Slave IO running: Yes / master: 172.31.20.9 / slave is 0 seconds behind master | delay=0s
Getting Error
root@Bastion-01:/usr/local/nagios/libexec# ./check_nrpe -H Master-ip -c check_mysql_slavestatus
NRPE: Unable to read output
On Nagios Server
In Command.cfg
define command{
command_name check_mysql_slavestatus
command_line $USER1$/check_mysql_slavestatus -H $HOSTADDRESS$ -P $ARG1$ -u $ARG2$ -p $ARG3$ -w $ARG4$ -c $ARG5$
}
vim /usr/local/nagios/etc/objects/nagios_DB1.cfg
define service{
use generic-service
host_name DB-01
service_description check_mysql_slavestatus
check_command check_nrpe!check_mysql_slavestatus!hostname!portnumber!username!passwd!15!50
}
Output On Nagios
check_mysql_slavestatus
CRITICAL 06-09-2015 13:51:51 0d 2h 45m 12s 3/3 (No output on stdout) stderr: execvp(/check_nrpe, ...) failed. errno is 2: No such file or directory
Please let me know where i am wrong
Followed troubleshooting doc https://assets.nagios.com/downloads/nagiosxi/docs/NRPE-Troubleshooting-and-Common-Solutions.pdf
vim /etc/sudoers
nagios ALL= NOPASSWD: sudo /usr/lib/nagios/plugins/check_mysql_slavestatus