I want use this check_uptime for my linux servers in the first step I copy the file in the /usr/local/nagios/libexec/ and change the permission to 755 then on the nagios server add this line
define service{
use local-service
host_name testapp
service_description Uptime
check_command check_nrpe!check_uptime!'-w 1 -c 5'
}
but it does not work . what is the problem ?
I am using this :
https://exchange.nagios.org/directory/P ... e2/details
How can add new script to my server
-
- Posts: 8
- Joined: Thu Feb 18, 2021 2:42 pm
Re: How can add new script to my server
On our system on the host, we have a line in the /etc/nrpe.d/base.cfg file as follows-
command[check_uptime]=/usr/lib64/nagios/plugins/check_uptime -c 5 -w 1
Then within the service config, we have it set to run the check as follows-
define service{
use local-service
host_name testapp
service_description Uptime
check_command check_nrpe!check_uptime
}
This should get you your required results.
HTH
command[check_uptime]=/usr/lib64/nagios/plugins/check_uptime -c 5 -w 1
Then within the service config, we have it set to run the check as follows-
define service{
use local-service
host_name testapp
service_description Uptime
check_command check_nrpe!check_uptime
}
This should get you your required results.
HTH
Re: How can add new script to my server
dkstuart23 wrote:On our system on the host, we have a line in the /etc/nrpe.d/base.cfg file as follows-
command[check_uptime]=/usr/lib64/nagios/plugins/check_uptime -c 5 -w 1
Then within the service config, we have it set to run the check as follows-
define service{
use local-service
host_name testapp
service_description Uptime
check_command check_nrpe!check_uptime
}
This should get you your required results.
HTH
I added this in nrpe.cfg
command[check_uptime]=/usr/local/nagios/libexec/check_uptime1 -w $ARG1$ -c $ARG2$
and add this to server.cfg in nagios :
define service{
use local-service
host_name server
service_description Uptime
check_command check_nrpe!check_uptime!'-w 1 -c 3'
}
but it return Error: missing or illegal option value in nagios
although while run script in server that is ok :
[root@server ~]# /usr/local/nagios/libexec/check_uptime1 -w 1 -c 3
OK - uptime is 666 Days, 3 Hours, 03 Minutes
What is the problem ?
Re: How can add new script to my server
Can anyone help me about it ?
Re: How can add new script to my server
Try changing the command definition to the following:
command[check_uptime]=/usr/local/nagios/libexec/check_uptime1 $ARG1$
command[check_uptime]=/usr/local/nagios/libexec/check_uptime1 $ARG1$
Re: How can add new script to my server
gormank wrote:Try changing the command definition to the following:
command[check_uptime]=/usr/local/nagios/libexec/check_uptime1 $ARG1$
Thanks. Solved