I am trying to monitor a small service on a dummy server via Icinga2 the check_nrpe plugin. I have setup both correctly as I can do the following:
- when I run
/usr/lib/nagios/plugins/check_nrpe -H remote-server-ip
from the main server I getNRPE v2.15
- when I do
/usr/lib/nagios/plugins/check_nrpe -H main-server-ip
from the remote server I get the same result. - when I run
/usr/lib/nagios/plugins/check_nrpe -H remote-server-ip -c check_load
I getWARNING - load average: 5.85, 5.67, 5.55|load1=5.850;15.000;30.000;0; load5=5.670;10.000;25.000;0; load15=5.550;5.000;20.000;0;
Now I am trying to use check_nrpe to run a small script on my remote machine which is placed in /usr/local/lib/
called check_remote_server.py
. For this I did the following:
in /etc/icinga2/conf.d/test.conf
object Service "Test Check" {
import "generic-service"
host_name = "remote-server-ip"
check_command = "check_nrpe"
vars.ARG1 = "check_remote_server"
}
object Host "remote-server-ip" {
import "linux-server"
address = "xx.xx.xx.xx"
groups = [ "test" ]
}
and in /etc/nagios/nrpe.cfg
command[check_remote_server]=/usr/local/lib/check_remote_server.py -w 2 -c 1
However when I restart icinga2 and check the status, I get all sorts of errors from syntax errors, compilation errors etc which only go away after I roll back ALL changes Ive made. I cant figure out for the life of me how to pass arguments with check_nrpe.
Can anyone PLEASE give me a simple quide as to how to configure a custom check via check_nrpe
?
EDIT: Used the icinga tag instead of icinga2 because there is no icinga2 tag.
Edit2: I just tried this from the command line
/usr/lib/nagios/plugins/check_nrpe -H remote-ip -c check_disk -a "-w 20% -c 10%
adn got the error CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.