Problem:no notifications have been recorded

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Problem:no notifications have been recorded

Post 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?

Code: Select all

contact_groups sagroup
Thank you.

Kind Regards,

Gary Shergill

EDIT:
You are using SMS for the notifications? Could you post those command definitions please?
whhan
Posts: 9
Joined: Wed Mar 20, 2013 4:33 am

Re: Problem:no notifications have been recorded

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem:no notifications have been recorded

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
whhan
Posts: 9
Joined: Wed Mar 20, 2013 4:33 am

Re: Problem:no notifications have been recorded

Post 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!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Problem:no notifications have been recorded

Post 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.
Locked