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.
whhan
Posts: 9
Joined: Wed Mar 20, 2013 4:33 am

Problem:no notifications have been recorded

Post by whhan »

I encountered a stange problem, my nagios did not send notifications when host goes down & up, the 'Nagios.log' only recorded host and service alerts, but no host and service notifications, I checked nagios web interface, it shows 'no notifications have been recorded in current log file',I really do not know what the reason is,please help,thanks.
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,

Some more details are needed.

Were notifications working before for all hosts and services?
Are notifications not working for all hosts and services anymore? Or just a specific host is not sending out any notifications?

Thank you.

Kind Regards,

Gary Shergill
whhan
Posts: 9
Joined: Wed Mar 20, 2013 4:33 am

Re: Problem:no notifications have been recorded

Post by whhan »

Thanks for your respond!
The notifications did not work from the beginning for all hosts and services.
I asked for help in Spiceworks community, this is the link:http://community.spiceworks.com/topic/post/2119829
whhan
Posts: 9
Joined: Wed Mar 20, 2013 4:33 am

Re: Problem:no notifications have been recorded

Post by whhan »

This is an old topic last year, it seems that I get the same problem.------http://support.nagios.com/forum/viewtop ... ile#p40684
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,
The notifications did not work from the beginning for all hosts and services.
Regarding the notification setup, have you done the following;

1. Set up a mail server
2. Set up contacts with emails
3. Configure the notification commands
4. Assign hosts/services a contact or contact group

Thank you.

Kind Regards,

Gary Shergill
whhan
Posts: 9
Joined: Wed Mar 20, 2013 4:33 am

Re: Problem:no notifications have been recorded

Post by whhan »

Thanks.
I setup a mail server, and email can be sent by mail command.
I configure contacts.cfg, notifications commands,and host/service contact group, the configuration is checked pass with command "nagios -v nagios.cfg". I can not find out the answer.
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,

If there is nothing appearing your nagios.log file, then it means Nagios doesn't even know to send out a notification (even with the incorrect mail server configured, it would still show in your nagios.log).

Could you post your contacts.cfg and hosts.cfg, as well as any templates being used by them please? Make sure to edit any sensitive information.

Thank you.

Kind Regards,

Gary Shergill
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 »

Again Gary is correct, can you also grep you nagios.log for "NOTIFICATION"
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 »

Thanks very much.
One of my host defined in hosts.cfg:
define host {
host_name test
alias test
address 172.26.28.83
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
check_period 24x7
process_perf_data 0
retain_nonstatus_information 1
contact_groups sagroup
notification_interval 30
notification_period 24x7
notification_options d,u,r
notifications_enabled 1
}

contacts.cfg:
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user

email alert@***.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
service_notifications_enabled 1
host_notifications_enabled 1
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands service-by-sms
host_notification_commands host-by-sms

}
nagios.log:
[1366819200] LOG ROTATION: DAILY
[1366819200] LOG VERSION: 2.0
[1366819200] CURRENT HOST STATE: test;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 3.62 ms
[1366819200] CURRENT HOST STATE: web-bak;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 0.51 ms
[1366819200] CURRENT SERVICE STATE: test;check-host-alive;OK;HARD;1;PING OK - Packet loss = 0%, RTA = 6.01 ms
[1366819200] CURRENT SERVICE STATE: web-bak;check-host-alive;OK;HARD;1;PING OK - Packet loss = 0%, RTA = 0.67 ms
[1366819738] Auto-save of retention data completed successfully.
[1366823338] Auto-save of retention data completed successfully.
[1366880458] SERVICE ALERT: test;check-host-alive;CRITICAL;SOFT;1;CRITICAL - Host Unreachable (172.26.28.83)
[1366880468] HOST ALERT: test;DOWN;SOFT;1;CRITICAL - Host Unreachable (172.26.28.83)
[1366880518] SERVICE ALERT: test;check-host-alive;CRITICAL;SOFT;2;CRITICAL - Host Unreachable (172.26.28.83)
[1366880538] HOST ALERT: test;DOWN;SOFT;2;CRITICAL - Host Unreachable (172.26.28.83)
[1366880578] SERVICE ALERT: test;check-host-alive;CRITICAL;HARD;3;CRITICAL - Host Unreachable (172.26.28.83)
[1366880608] HOST ALERT: test;DOWN;SOFT;3;CRITICAL - Host Unreachable (172.26.28.83)
[1366880638] SERVICE ALERT: test;check-host-alive;OK;HARD;3;PING OK - Packet loss = 0%, RTA = 7.33 ms
[1366880648] HOST ALERT: test;UP;SOFT;4;PING OK - Packet loss = 0%, RTA = 3.62 ms
[1366880674] Caught SIGTERM, shutting down...
[1366880674] Successfully shutdown... (PID=11597)
[1366880819] Nagios 3.2.3 starting... (PID=32688)
[1366880819] Local time is Thu Apr 25 17:06:59 CST 2013
whhan
Posts: 9
Joined: Wed Mar 20, 2013 4:33 am

Re: Problem:no notifications have been recorded

Post by whhan »

attached nagios.cfg file(the file extention .cfg is not allowed tu upload, I added .txt to it).
Attachments
nagios.cfg.txt
nagios.cfg
(42.98 KiB) Downloaded 577 times
Locked