Page 3 of 3

Re: Notifications

Posted: Wed Mar 04, 2015 4:22 pm
by jdalrymple

Code: Select all

grep start /var/log/nagios/nagios.log
?

Right now I'm wondering if your config has been reloaded since you enabled notifications for the ssh service - no doubt you noticed it's disabled by default.

Re: Notifications

Posted: Wed Mar 04, 2015 4:31 pm
by NagiosRoss

Code: Select all

[1425256083] Nagios 4.0.8 starting... (PID=19273)
[1425256711] Nagios 4.0.8 starting... (PID=19544)
[1425256711] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 45)
[1425257653] Nagios 4.0.8 starting... (PID=19966)
[1425257653] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 45)
[1425258280] Nagios 4.0.8 starting... (PID=20217)
[1425262196] Nagios 4.0.8 starting... (PID=21356)
[1425262675] Nagios 4.0.8 starting... (PID=21601)
[1425262882] Nagios 4.0.8 starting... (PID=21711)
[1425265502] Nagios 4.0.8 starting... (PID=940)
[1425206057] Nagios 4.0.8 starting... (PID=1732)
[1425206057] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 45)
[1425206525] Nagios 4.0.8 starting... (PID=1890)
[1425206525] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 45)
[1425206774] Nagios 4.0.8 starting... (PID=1981)
[1425206774] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 46)
[1425296125] Nagios 4.0.8 starting... (PID=946)
[1425296125] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 46)
[1425330408] Nagios 4.0.8 starting... (PID=2881)
[1425330408] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 46)
[1425330707] Nagios 4.0.8 starting... (PID=3043)
[1425330707] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 46)
[1425410275] Nagios 4.0.8 starting... (PID=947)
[1425410275] Error: Could not find any host matching 'ssh' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 46)
[1425494319] Nagios 4.0.8 starting... (PID=942)
[1425501728] Nagios 4.0.8 starting... (PID=3661)
[1425502535] SERVICE FLAPPING ALERT: localhost;SSH;STARTED; Service appears to have started flapping (23.4% change >= 20.0% threshold)
I've fixed the error above now, by the way.

Re: Notifications

Posted: Wed Mar 04, 2015 4:54 pm
by jdalrymple
No such thing as a lost cause. Let's try this, change the following lines in your nagios.cfg:

Code: Select all

debug_level=32
debug_verbosity=2
debug_file=/var/log/nagios/nagios.debug
my file is at /etc/nagios/nagios.cfg

Adjust your file to read like that then restart Nagios. Let it run for 10 minutes, then tar up the debug log and PM it.

You may want to change debug_level back to 0 and restart Nagios again afterwords.

Re: Notifications

Posted: Wed Mar 04, 2015 5:54 pm
by NagiosRoss
Sent!

Re: Notifications

Posted: Wed Mar 04, 2015 5:58 pm
by jdalrymple
I received your nagios.log, which may be useful but what we're really looking for is that debug file, go ahead and send that along and I bet we'll find our answer.

Thanks!

Re: Notifications

Posted: Wed Mar 04, 2015 6:52 pm
by NagiosRoss
Sent!

Re: Notifications

Posted: Thu Mar 05, 2015 10:55 am
by jdalrymple
I can't believe I didn't see this sooner. The debug log answers all...

Code: Select all

        service_notification_options    w,u,c,r,f,s,n
Remove the ",n" from the end of that line in contacts.cfg then reload Nagios.

Re: Notifications

Posted: Thu Mar 05, 2015 4:28 pm
by NagiosRoss
jdalrymple wrote:I can't believe I didn't see this sooner. The debug log answers all...

Code: Select all

        service_notification_options    w,u,c,r,f,s,n
Remove the ",n" from the end of that line in contacts.cfg then reload Nagios.
AAAAAAAAAAAAAAHHHHHHHHHH! YESSSSSSSSSSSSSSSSSSSSSSSSSSSSS! THANK YOU!

(What does the n stand for?!)

Re: Notifications

Posted: Thu Mar 05, 2015 4:37 pm
by jdalrymple
Glad we solved it. I'm going to go ahead and lock this thread up. Sorry it took so long to find such a simple little problem.

I've been using Nagios for 10 years or more and I still reference the Object Definition page many times a day.

http://nagios.sourceforge.net/docs/3_0/ ... tions.html

notification_options: This directive is used to determine when notifications for the service should be sent out. Valid options are a combination of one or more of the following: w = send notifications on a WARNING state, u = send notifications on an UNKNOWN state, c = send notifications on a CRITICAL state, r = send notifications on recoveries (OK state), f = send notifications when the service starts and stops flapping, and s = send notifications when scheduled downtime starts and ends. If you specify n (none) as an option, no service notifications will be sent out. If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states. Example: If you specify w,r in this field, notifications will only be sent out when the service goes into a WARNING state and when it recovers from a WARNING state.

Take care