I have setup the Nagios in my Linux machine and put my own plug in to check the services running in remote host.
I installed NRPE and setup is fine.
Remote host has some application services running and I want to monitor them.i wrote a plugin to monitor the services and send the output to nagios.
Problem here is, all services are running fine in the remote host, but its showing SUCCESS to few and FAILURE to few services in nagios webpage (See attached png file)
I checked it from command line aswell through the nagios server, it says the same.. please advise
Nagios Server:
#################################################################
root@xxxxx:libexec> ./check_nrpe -H 192.0.145.143 -c check_services3
MarketsStaticData is running fine.
PID for MarketsStaticData = 2232
root@xxxxx:libexec> ./check_nrpe -H 192.0.145.143 -c check_services2
ToolboxLogstashCollector is OFFLINE.
CRITICAL-
################################################################
Remote server (NRPE)
###############################################################
root@AAAA:ToolboxNagiosRemote> /usr/local/nagios/libexe :> ./check_services.sh ToolboxLogstashCollector
ToolboxLogstashCollector is running fine.
PID for ToolboxLogstashCollector = 2008
OK-
###############################################################
May I know the reason why few services showing correct but few are not.. I checked all the config files but none of them seems incorrect
See below for the config files.
#### Nagios Server #####
vi /usr/local/nagios/etc/nagios.cfg
/usr/local/nagios/etc/objects/ipokit-dev_sg.cfg
/usr/local/nagios/etc/objects/commands.cfg
vi /usr/local/nagios/etc/objects/ipokit-dev_sg.cfg
check_command check_nrpe!memory_usage
check_command check_nrpe!check_services1
check_command check_nrpe!check_services2
check_command check_nrpe!check_services3
check_command check_nrpe!check_services4
check_command check_nrpe!check_services5
check_command check_nrpe!check_services6
vi /usr/local/nagios/etc/objects/commands.cfg
# memory usage command definition
define command{
command_name memory_usage
command_line $USER1$/memory_usage.sh
}
define command{
command_name check_services1
command_line $USER1$/check_services.sh $ARG1$
}
define command{
command_name check_services2
command_line $USER1$/check_services.sh $ARG1$
}
define command{
command_name check_services3
command_line $USER1$/check_services.sh $ARG1$
}
define command{
command_name check_services4
command_line $USER1$/check_services.sh $ARG1$
}
define command{
command_name check_services5
command_line $USER1$/check_services.sh $ARG1$
}
define command{
command_name check_services6
command_line $USER1$/check_services.sh $ARG1$
}
define command{
command_name check_services7
command_line $USER1$/check_services.sh $ARG1$
}
define command{
command_name check_services8
command_line $USER1$/check_services.sh $ARG1$
}
##### NRPE Server ######
vi /etc/xinetd.d/nrpe
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe_ipokit-dev_sg.cfg --inetd
only_from = 127.0.0.1 192.168.143.243 # Nagios Master server - maap server
vi /usr/local/nagios/etc/nrpe_ipokit-dev_sg.cfg
command[memory_usage]=/usr/local/nagios/libexec/memory_usage.sh
command[check_services1]=/usr/local/nagios/libexec/check_services.sh ToolboxLogstashCollector
command[check_services2]=/usr/local/nagios/libexec/check_services.sh ToolboxLogService
command[check_services3]=/usr/local/nagios/libexec/check_services.sh ToolboxProxy
command[check_services4]=/usr/local/nagios/libexec/check_services.sh ToolboxPolicyFileServer
command[check_services5]=/usr/local/nagios/libexec/check_services.sh ToolboxUserAdminFrontend
command[check_services6]=/usr/local/nagios/libexec/check_services.sh IpoToolFrontend