@scottwilkerson I copied my script check_runserver under /usr/local/nagios/libexec directory and made it executable as well.
And added command in nrpe.cfg file
# The following examples use hardcoded command arguments...
# This is by far the most secure method of using NRPE
Code: Select all
command [check_runserver]=/usr/local/nagios/libexec/check_runserver
After that restarted nrpe service o remote host
I have added this command in my command.cfg file on my Nagios server.
#'check_runserver' command definition
Code: Select all
define command{
command_name check_runserver
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_runserver
}
Added these lines in linux_server.cfg
Code: Select all
define service{
use local-service ; Name of service template to use
host_name Sales-Demo
service_description Python
check_command check_nrpe!check_runserver
contact_groups Nagios
notification_options w,u,c,r
notification_interval 10
notification_period 24x7
}
After that restarted nagios service on Nagios server. Now I am getting Unknown error NRPE: Command 'check_runserver' not defined
I have gone through the both the servers logs [ Ngaios server and as well as remote host].
Remote host log /usr/local/nagios/var/nrpe.log getting this error.
[1528194540] CONN_CHECK_PEER: checking if host is allowed: 10.10.102.25 port 28840
[1528194540] Connection from 10.10.102.25 port 28840
[1528194540] is_an_allowed_host (AF_INET): is host >10.10.102.25< an allowed host >10.10.102.25<
[1528194540] is_an_allowed_host (AF_INET): is host >10.10.102.25< an allowed host >10.10.102.25<
[1528194540] is_an_allowed_host (AF_INET): host is in allowed host list!
[1528194540] Host address is in allowed_hosts
[1528194541] Host 10.10.102.25 is asking for command 'check_runserver' to be run...
[1528194541] NRPE: Command 'check_runserver' not defined
[1528194541] Return Code: 3, Output: NRPE: Command 'check_runserver' not defined
[1528194541] Connection from 10.10.102.25 closed
Nagios sever logs /usr/local/nagios/var/nagios.log
[1528193232] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;Sales-Demo;Python;1528193230
[1528193412] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;Sales-Demo;Python;1528193411
[1528193879] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;Sales-Demo;Python;1528193878
[1528194540] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;Sales-Demo;Python;1528194538
Please help me here, I want to get rid of this problem.