LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 12-16-2008, 02:50 AM   #1
matisq
LQ Newbie
 
Registered: Dec 2008
Posts: 6

Rep: Reputation: 0
Advanced Notifications with Nagios


Now I've got 10 serviced in error state, so I received 10 email about problem every hour. I now the problems. I don't need notifications every hour, or two. I need custom solution for that
Could it be possible to implement such workflow ?

From first error till 24h after that = one email per hour
After 24h till one week = one email every 6 hours
After that until solution = one email per day


Thx in advanced!
 
Old 12-16-2008, 08:56 AM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
You should have searched, this gets asked/answered all of the time.

What you want to do is define host escalations. This is the template -
http://nagios.sourceforge.net/docs/2...hostescalation

Set it up with wildcards so it applies to all hosts. Count the number of emails you'll receive in 24 hours (looks like 24), then have the first escalation kick in. Define it to send one email every 6 hours, and count the total number (24 + (4perday)(6days)) that will be received over the course of the week. Then define a 2nd escalation that comes into effect after that amount of emails (looks like 48, but might be +/-1). Define that to go once every 24 hours forever.

All of this is found on your nagios site as well in the documentation. You could have found it if you did a bit of reading.

Peace,
JimBass
 
Old 12-16-2008, 03:02 PM   #3
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,614

Rep: Reputation: 164Reputation: 164
Welcome to LQ, by the way.
 
Old 12-18-2008, 07:52 AM   #4
matisq
LQ Newbie
 
Registered: Dec 2008
Posts: 6

Original Poster
Rep: Reputation: 0
THX for response!

But I've got many hosts. If I use hostescalation I get info about host problem (reachable or not) or service problems also?

Totally I have 30 services on 10 hosts but 10 of them are in error state. Should I use service escalation? Should I define escalation for each service? If I define escalation, what happened with default e-mail notifications?

Last edited by matisq; 12-18-2008 at 07:54 AM.
 
Old 12-18-2008, 08:22 AM   #5
matisq
LQ Newbie
 
Registered: Dec 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Or maybe a little example?
 
Old 12-18-2008, 09:28 AM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
This page does a good job of talking through service escalations.

http://www.crucialwebhost.com/blog/n...ing-with-nrpe/

The use of the wildcard (*) will work for all services, or hosts. Some people report that instead of a wildcard, they have to use .* to have it work, but one of those 2 will send escalations for every service. You could also form a a list if you want, like have one escalation for smtp,pop3,imap and a different one for http. You can also define host escalations.

Again, check your documentation. Nagios is not new technology, there are gigabytes of data all across the internet about its use and configuration. All I did to find the example above was to put "nagios email escalation" into google (without the quotes).

By the way, having 10 hosts/services in an error state state probably indicates you either have bad settings for your nagios install or your network is in very bad shape!

Peace,
JimBass
 
Old 12-19-2008, 01:52 AM   #7
matisq
LQ Newbie
 
Registered: Dec 2008
Posts: 6

Original Poster
Rep: Reputation: 0
THX for response!

I've been looking for Details about service escalation, but I don't have really a lot of time (other task to do).
Generally I don't use default Nagios plugins: I develop 5 or 6 custom plugins. 10 plugins in error state means only that host has problem with low disk space or some program just stop working. I tried to create Service Escalation Definition:

Send one e-mail every 6 hours after 24 e-mails already sent.
Last notification is after one week.
Code:
define serviceescalation{
        hostgroup_name                remote-servers
        service_description           *
        first_notification            24
        last_notification             168
        notification_interval         360
        contact_groups                admins
        }
Send one e-mail every day after 48 notifications
Last notification is one year.
Code:
define serviceescalation{
        hostgroup_name                remote-servers
        service_description           *
        first_notification            48
        last_notification             525600
        notification_interval         1440
        contact_groups                admins
        }
Is that correct? Should I create first definition (first 24 hours - 24 e-mails) or it will be inherit from generral Nagios Definition?
Code:
define serviceescalation{
        hostgroup_name                remote-servers
        service_description           *
        first_notification            1
        last_notification             23
        notification_interval         60
        contact_groups                admins
        }

Last edited by matisq; 12-19-2008 at 01:55 AM.
 
Old 12-20-2008, 10:00 PM   #8
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
You're off in your numbers -

Quote:
Send one e-mail every 6 hours after 24 e-mails already sent.
Last notification is after one week.
Code:

define serviceescalation{
hostgroup_name remote-servers
service_description *
first_notification 24
last_notification 168
notification_interval 360
contact_groups admins
}
The hostgroup is fine, as long as the only hostgroup you want this done for is remote-servers. Service_description is also fine, but some people reported that they need .* instead of * to affect all hosts. You also have first_notification fine, but your last_notification is way off. You counted as if you were still getting 24 emails a day. Once this escalation kicks in, you only get 4 emails a day, one every six hours, which you setup correctly with a notification_interval of 360. With one email every 6 hours, you only get 4 emails a day. You want this to start at the beginning of the 2nd day, and go until the end of the 7th, that is 6 days of 4 emails a day. 6x4 is 24. The 24 in this escalation plus the 24 in the first day is 48 emails. So your last notification isn't 168, it is 48.

Interestingly, you start the final escalation correctly, which required the 48 you somehow changed to 168 above, but you're miles off the last_notification. At 1 email a day, the most you'll get in a year is 365. Since the first week of your year is 7 days less, your "year" of emails would be (365-7) = 358, and 358+48 (from the more active emails in the first week) = 406. If you sent 525,000 emails at 1 a day, you'd be sending a daily email for almost 1500 years! Your computer would be dust!

Peace,
JimBass
 
Old 12-29-2008, 02:00 AM   #9
matisq
LQ Newbie
 
Registered: Dec 2008
Posts: 6

Original Poster
Rep: Reputation: 0
THX for the response! I'm going to test it now.


Quote:
Originally Posted by JimBass View Post
Service_description is also fine, but some people reported that they need .* instead of * to affect all hosts.

"to affect all services" I think

Happy New Year!
 
Old 01-06-2009, 03:04 AM   #10
matisq
LQ Newbie
 
Registered: Dec 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Happy New Year!

I've been testing this approach durning Christmas but it fails. I receive messages every hour. Is this working even after Nagios restart?

I can use other solution. Now I have 70 hosts with 5 services on each host. I want to send report about each host everyday about midnight. I know how to send email every day but not every day at midnight.

Cheers!
 
  


Reply

Tags
nagios, notification


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios notifications for a host problem cmx08 Linux - Software 1 07-20-2011 07:35 AM
Nagios Email notifications jackie001 Linux - Newbie 3 11-14-2008 10:58 AM
Nagios e-Mail notifications netmaster3620 Linux - Newbie 1 07-01-2008 07:33 PM
Nagios notifications nuganen Linux - Newbie 1 06-20-2008 02:13 PM
E-mail notifications not working with nagios hondo Linux - Server 3 10-28-2007 12:42 PM


All times are GMT -5. The time now is 05:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration