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! |
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 |
Welcome to LQ, by the way.
|
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? |
Or maybe a little example?
|
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 |
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{ Last notification is one year. Code:
define serviceescalation{ Code:
define serviceescalation{ |
You're off in your numbers -
Quote:
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 |
THX for the response! I'm going to test it now.
Quote:
"to affect all services" I think :) Happy New Year! |
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! |
All times are GMT -5. The time now is 06:08 PM. |