I'm begginer with Nagios and i'm trying to monitor if a specific process on my unix machine is up or not. Server and client are on the same machine : Trying to monitor that machine from a Nagios runing on it. I've installed Nagios Core 4, nrpe and it's plugins. After looking on the web, I found an answer of how to monitor process using check_procs plugin (up or down) and that's what I actually have in my files :
1- in /etc/nagios/nrpe.cfg
server_address=127.0.0.1
command[check_service]=/usr/lib/nagios/plugins/check_procs -c 1: -C $ARG1$
2- I created a file called "ubunutu_host.cfg" in /usr/local/nagios/etc/servers/ :
# Ubuntu Host configuration file
define host {
use linux-server
host_name ubuntu_host
alias Ubuntu Host
address 127.0.0.1
register 1
}
define service {
host_name ubuntu_host
service_description check_apache2
check_command check_service!apache2
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}
3- In /etc/nagios-plugins/configp/rocs.cfg :
define command{
command_name check_service
command_line /usr/lib/nagios/plugins/check_procs -c 1: -C ‘$ARG1$’
}
My probelm is : when runing this command :
/usr/lib/nagios/plugins/check_procs -c 1: -C apache2
that's what I'm having as a result
PROCS OK: 7 processes with command name 'apache2' | procs=7;;1:;0;
BUT In Nagios, below what I'm having (apache2 is always critical) : Problem proc apache2 is always shown critical