Page 2 of 2
Re: Problem:no notifications have been recorded
Posted: Thu Apr 25, 2013 7:19 am
by gshergill
Hi whhan,
When you run the check command, or restart nagios, are there any errors?
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Also you mention a contact group in your host definitions, could you post it's config?
Thank you.
Kind Regards,
Gary Shergill
EDIT:
You are using SMS for the notifications? Could you post those command definitions please?
Re: Problem:no notifications have been recorded
Posted: Thu Apr 25, 2013 7:32 am
by whhan
contactgroups.cfg:
define contactgroup{
contactgroup_name sagroup
alias Nagios Administrators
members nagiosadmin
}
run "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg", there was no errors and warnings.
SMS configuration is:
# 'notify-service-by-sms' command definition
define command{
command_name service-by-sms
command_line /bin/echo -n "$NOTIFICATIONTYPE$ $HOSTNAME$/$HOSTADDRESS$:Service is $SERVICESTATE$\nDate/Time: $LONGDATETIME$" | /usr/bin/gnokii --sendsms 13818888**** 2>&1 > /dev/null
}
I use commands to test mail and gnokii, they are working well.
Re: Problem:no notifications have been recorded
Posted: Thu Apr 25, 2013 9:41 am
by scottwilkerson
According to your log, the only item that reached a HARD down state was this
Code: Select all
[1366880578] SERVICE ALERT: test;check-host-alive;CRITICAL;HARD;3;CRITICAL - Host Unreachable (172.26.28.83)
Can you post the cfg file for this service
test;check-host-alive
Re: Problem:no notifications have been recorded
Posted: Thu Apr 25, 2013 10:11 am
by whhan
services.cfg :
define service {
host_name test
service_description check-host-alive
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
notifications_enabled 1
check_command check-host-alive
}
Thank you!
Best Regards!
Re: Problem:no notifications have been recorded
Posted: Thu Apr 25, 2013 11:07 am
by slansing
max_check_attempts: This directive is used to define the number of times that Nagios will retry the host check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the host check. Note: If you do not want to check the status of the host, you must still set this to a minimum value of 1. To bypass the host check, just leave the check_command option blank.
Your service would have had to have been checked 3 times before an alert was generated, is this consistent with the OK and warning/critical state change timestamps?
Also, what version of Nagios are you using? There are a number of examples on this page as far as correctly building host/service configuration files:
http://nagios.sourceforge.net/docs/3_0/ ... rvicegroup
Some of your check settings seem a bit strange, "normal_check_interval" as opposed to "check_interval." You 'should' be able to use both, but the newest definition options can be found on that page.