Alert mail is not getting for a custom service check
Posted: Wed Mar 30, 2016 4:14 am
HI Support,
I have configured Nagios 4 on CentOS 6.6 64-bit server. And its working properly.
What is my issue is that, I have created a custom service definition for checking a custom service running OR Not. In the webpage, status of that particular service showing correctly. But I didn't getting any alert mail if the service Stopped ( Critical ). So is there any configuration missing for sending alert mail for any custom service.
Version : Nagios Core 4.0.4
OS: CentOS 6.6 64 bit
Checking service definition in Libexec
This is done by creating a simple bash script, which is
#vim /usr/loca/nagios/libexec/check_xxxx
#!/bin/bash
if ps ax | grep -v grep | grep /usr/sbin/XXXXD > /dev/null
then
echo "OK, XXXX service is running"
exit 0
else
echo "CRITICAL , XXXX service is not running"
exit 2
fi
Service definition in localhost.cfg
# vim /usr/local/nagios/etc/objects/localhost.cfg
define service{
use local-service ; Name of service template to use
host_name localhost
service_description XXXX Service
check_command check_xxxx
notifications_enabled 0
}
Command definition in commands.cfg
# vim /usr/local/nagios/etc/objects/commands.cfg
define command{
command_name check_xxxx
command_line $USER1$/check_xxxx -H $HOSTADDRESS$ $ARG1$
}
Kindly check this and advice me, what is the reason for alert mailings is not getting for this custom service check.
Thanks to all in advance.
Regards
Satheesh
I have configured Nagios 4 on CentOS 6.6 64-bit server. And its working properly.
What is my issue is that, I have created a custom service definition for checking a custom service running OR Not. In the webpage, status of that particular service showing correctly. But I didn't getting any alert mail if the service Stopped ( Critical ). So is there any configuration missing for sending alert mail for any custom service.
Version : Nagios Core 4.0.4
OS: CentOS 6.6 64 bit
Checking service definition in Libexec
This is done by creating a simple bash script, which is
#vim /usr/loca/nagios/libexec/check_xxxx
#!/bin/bash
if ps ax | grep -v grep | grep /usr/sbin/XXXXD > /dev/null
then
echo "OK, XXXX service is running"
exit 0
else
echo "CRITICAL , XXXX service is not running"
exit 2
fi
Service definition in localhost.cfg
# vim /usr/local/nagios/etc/objects/localhost.cfg
define service{
use local-service ; Name of service template to use
host_name localhost
service_description XXXX Service
check_command check_xxxx
notifications_enabled 0
}
Command definition in commands.cfg
# vim /usr/local/nagios/etc/objects/commands.cfg
define command{
command_name check_xxxx
command_line $USER1$/check_xxxx -H $HOSTADDRESS$ $ARG1$
}
Kindly check this and advice me, what is the reason for alert mailings is not getting for this custom service check.
Thanks to all in advance.
Regards
Satheesh