[Nagios-users] FW: Timeperiods and oncall rotation with UK Public holidays
I've been wanting to chime in on this topic for some time now, but I've done so much customization in my Nagios environment that it would be really hard to post the code. For example, my notify.pl script checks out user preferences that are stored in a database, which requires the CGI that allows users to change that info, which requires Active Directory (so they can only see/modify their own stuff). I also run a private instant message server (OpenFire) so alerts can pop up as instant messages if users prefer that. Although I'm certain there are much better ways to do this out there, here is what works for me in a nutshell: * use NDOutils to store Nagios configuration and alerts * store user contact preferences in a MySQL database * create a CGI and link into the left hand nav panel to allow users to change contact preferences * create a new notify.pl from scratch - Check if it is business hours or non biz hours (to do: use Nagios time config files) - Do a select on the database to see who is responsible for this alert, given time, day, host, service, level, etc. - Optionally: send alert to generic group/email if no one is specifically defined - Read in user preferences from DB, given host, time of day, etc. - Send alert according to preference (email address, instant message, voice, etc) * Define the contacts' email addresses (inside contacts.cfg) to be the username (CN) in Active Directory * Define all users to get alerts all the time, let the database do the work of sorting out details If ever get the time to clean up the code, document it better and explain the dependencies, I'll be happy to post the code somewhere as an example of one way to do it. Hope it helps, - Brent -Original Message- Sent: Thursday, April 22, 2010 2:08 PM To: nagios-users@lists.sourceforge.net Subject: Re: [Nagios-users] [Nagios-devel] FW: Timeperiods and oncall rotation with UK Public holidays If you can find a way to do this, please let me know! My boss is wanting our Nagios installation to do this very thing, but I have yet to find a way to make this happen. -- ___ Nagios-users mailing list Nagios-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
[Nagios-users] FW: Timeperiods and oncall rotation with UK Public holidays
Is anybody able to help with this ? Thanks, Deborah _ From: Deborah Martin [mailto:deborah.mar...@kognitio.com] Sent: 21 April 2010 12:25 To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Timeperiods and oncall rotation with UK Public holidays Importance: High Folks, I'm using SLES 10 and Nagios 3.2.0. We have 4 oncall engineers which rotate over a 4 week period, each being oncall one week at a time. The oncall period is 17:30 - 08:00 each working day and then the whole period for any weekend or UK public holiday. My definitions are :- define timeperiod{ timeperiod_name 24x7 alias 24 Hours A Day, 7 Days A Week sunday 00:00-24:00 monday 00:00-24:00 tuesday 00:00-24:00 wednesday 00:00-24:00 thursday00:00-24:00 friday 00:00-24:00 saturday00:00-24:00 } This is for all normal monitoring of our systems. Each oncall engineer is defined :- define timeperiod{ timeperiod_name person1-oncall alias person1-oncall 2010-03-29 / 28 17:30-24:00 ; Monday 2010-03-30 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-03-31 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-01 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-02 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-03 / 28 00:00-24:00 ; Saturday 2010-04-04 / 28 00:00-24:00 ; Sunday 2010-04-05 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person2-oncall alias person2-oncall 2010-04-05 / 28 17:30-24:00 ; Monday 2010-04-06 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-07 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-08 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-09 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-10 / 28 00:00-24:00 ; Saturday 2010-04-11 / 28 00:00-24:00 ; Sunday 2010-04-12 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person3-oncall alias person3-oncall 2010-04-12 / 28 17:30-24:00 ; Monday 2010-04-13 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-14 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-15 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-16 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-17 / 28 00:00-24:00 ; Saturday 2010-04-18 / 28 00:00-24:00 ; Sunday 2010-04-19 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person4-oncall alias person4-oncall 2010-04-19 / 28 17:30-24:00 ; Monday 2010-04-20 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-21 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-22 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-23 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-24 / 28 00:00-24:00 ; Saturday 2010-04-25 / 28 00:00-24:00 ; Sunday 2010-04-26 / 28 00:00-08:00 ; Monday } I have escalations set for one particular client which will happen during oncall hours only and depending on the notification number, (4,5,6) will send an SMS alert to the relevant person oncall. ## Escalation ONE: define serviceescalation { host_name dbhost1 service_description DB Conn Check first_notification 4 last_notification 6 notification_interval 15 escalation_options c ; Only escalate for CRITICAL alerts escalation_period oncall contact_groups wx2-sms-oncall-group } define timeperiod{ timeperiod_name oncall alias Oncall Hours sunday 00:00-24:00 monday 00:00-08:00,17:30-24:00 tuesday 00:00-08:00,17:30-24:00 wednesday 00:00-08:00,17:30-24:00 thursday00:00-08:00,17:30-24:00 friday 00:00-08:00,17:30-24:00 saturday00:00-24:00 } And the sms-oncall-group defined for the service escalation includes all 4 oncall engineers but only the person actually oncall should get the sms alert based on their oncall timeperiods. define contactgroup{ contactgroup_name wx2-sms-oncall-group alias WX2 Oncall members person1-oncall, person2-oncall, person3-oncall, person4-oncall } However, I've now hit a snag - how do I define UK public holidays periods as being 24 hours (particularly if they fall on a weekday) and put that timeperiod
Re: [Nagios-users] FW: Timeperiods and oncall rotation with UK Public holidays
Hi Deborah I wonder if you could create a new timeperiod with the holidays defined, and then have a separate contact group (eg. Vacation_oncall) that would receive alerts 0-24 on those days only and set these up in a similar way to your existing escalation objects? Then you could also 'exclude' the vacation period from the normal oncall rota so duty personnel only get 'vacation' period alerts. Not sure if its a workable solution, but its an interesting problem. J Cheers Kristian From: Deborah Martin [mailto:deborah.mar...@kognitio.com] Sent: 22 April 2010 10:43 AM To: nagios-users@lists.sourceforge.net; 'nagios-de...@lists.sourceforge.net' Subject: [Nagios-users] FW: Timeperiods and oncall rotation with UK Public holidays Importance: High Is anybody able to help with this ? Thanks, Deborah _ From: Deborah Martin [mailto:deborah.mar...@kognitio.com] Sent: 21 April 2010 12:25 To: nagios-users@lists.sourceforge.net Subject: [Nagios-users] Timeperiods and oncall rotation with UK Public holidays Importance: High Folks, I'm using SLES 10 and Nagios 3.2.0. We have 4 oncall engineers which rotate over a 4 week period, each being oncall one week at a time. The oncall period is 17:30 - 08:00 each working day and then the whole period for any weekend or UK public holiday. My definitions are :- define timeperiod{ timeperiod_name 24x7 alias 24 Hours A Day, 7 Days A Week sunday 00:00-24:00 monday 00:00-24:00 tuesday 00:00-24:00 wednesday 00:00-24:00 thursday00:00-24:00 friday 00:00-24:00 saturday00:00-24:00 } This is for all normal monitoring of our systems. Each oncall engineer is defined :- define timeperiod{ timeperiod_name person1-oncall alias person1-oncall 2010-03-29 / 28 17:30-24:00 ; Monday 2010-03-30 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-03-31 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-01 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-02 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-03 / 28 00:00-24:00 ; Saturday 2010-04-04 / 28 00:00-24:00 ; Sunday 2010-04-05 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person2-oncall alias person2-oncall 2010-04-05 / 28 17:30-24:00 ; Monday 2010-04-06 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-07 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-08 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-09 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-10 / 28 00:00-24:00 ; Saturday 2010-04-11 / 28 00:00-24:00 ; Sunday 2010-04-12 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person3-oncall alias person3-oncall 2010-04-12 / 28 17:30-24:00 ; Monday 2010-04-13 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-14 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-15 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-16 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-17 / 28 00:00-24:00 ; Saturday 2010-04-18 / 28 00:00-24:00 ; Sunday 2010-04-19 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person4-oncall alias person4-oncall 2010-04-19 / 28 17:30-24:00 ; Monday 2010-04-20 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-21 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-22 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-23 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-24 / 28 00:00-24:00 ; Saturday 2010-04-25 / 28 00:00-24:00 ; Sunday 2010-04-26 / 28 00:00-08:00 ; Monday } I have escalations set for one particular client which will happen during oncall hours only and depending on the notification number, (4,5,6) will send an SMS alert to the relevant person oncall. ## Escalation ONE: define serviceescalation { host_name dbhost1 service_description DB Conn Check first_notification 4 last_notification 6 notification_interval 15 escalation_options c ; Only escalate for CRITICAL alerts escalation_period oncall contact_groups wx2-sms-oncall-group } define timeperiod{ timeperiod_name oncall alias Oncall Hours sunday 00:00-24:00 monday 00:00-08:00,17:30-24:00 tuesday