<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This is one of my pet peeves of Nagios -- that notifications are not particularly flexible.  That is why we have two sets of contacts for everyone, one that notifies via pager and e-mail, and one that only notifies via. e-mail; as there isn't a way to have Nagios do that for us.<div><br></div><div>We do something very similar to what you are trying to do.  We have a contact "groupname-oncall" that gets assigned to hosts and services a particular group is responsible for.  That alias exists both in our mail system and our paging system, and is updated automatically by a script to point to the correct individual.  The hardest part of this is writing the script to do the updates, as it has to be able to parse a configuration file with the dates/times your individuals are on-call and update the mail and paging systems with the correct information.  In our case, the aliases are stored in LDAP, so it is trivial for us to make the updates.</div><div><br></div><div>For years I have wanted to find the time to write a back-end notification script for Nagios that would make notifications more flexible, I just haven't had the time.  I want to be able to do things like:</div><div>  o Notify via. e-mail on warnings but send a text message for critical or for some services/hosts send text-messages for everything</div><div>  o Only notify the on-call individuals after hours but notify everyone during business hours</div><div>  o Remove duplicate messages</div><div>  o Allow for two-way messages so an reply can be sent via. e-mail or SMS to ack an issue (I almost have this in place today)</div><div>  o Have a configuration file that drives all of the above</div><div> <br><div><div>On Apr 22, 2010, at 02:42, Deborah Martin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"></font> </div>
<div><span class="315064109-22042010"></span><font face="Arial"><font color="#0000ff"><font size="2">Is anybody able to help with this ? 
</font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font size="2"></font></font></font> </div>
<div><font face="Arial"><font color="#0000ff"><font size="2">T<span class="315064109-22042010">hanks,</span></font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span class="315064109-22042010">Deborah </span></font></font></font></div>
<div><br></div>
<div dir="ltr" lang="en-us" class="OutlookMessageHeader" align="left">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b> Deborah Martin 
[mailto:Deborah.Martin@Kognitio.com] <br><b>Sent:</b> 21 April 2010 
12:25<br><b>To:</b> <a href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a><br><b>Subject:</b> 
[Nagios-users] Timeperiods and oncall rotation with UK Public 
holidays<br><b>Importance:</b> High<br></font><br></div>
<div></div><p><font size="2">Folks, </font></p><p><font size="2">I'm using SLES 10 and Nagios 3.2.0. </font></p><p><font size="2">We have 4 oncall engineers which rotate over a 4 week period, 
each being oncall one week at a time. </font><br><font size="2">The oncall period 
is 17:30 - 08:00 each working day and then the whole period for any weekend or 
UK public holiday. </font></p><p><font size="2">My definitions are :- </font></p><p><font size="2">define timeperiod{</font> <br><font size="2">        timeperiod_name 24x7</font> 
<br><font size="2">        
alias           24 Hours A 
Day, 7 Days A Week</font> <br><font size="2">        
sunday          00:00-24:00</font> 
<br><font size="2">        
monday          00:00-24:00</font> 
<br><font size="2">        
tuesday         00:00-24:00</font> 
<br><font size="2">        
wednesday       00:00-24:00</font> <br><font size="2">        
thursday        00:00-24:00</font> <br><font size="2">        
friday          00:00-24:00</font> 
<br><font size="2">        
saturday        00:00-24:00</font> <br><font size="2">        }</font> </p><p><font size="2">This is for all normal monitoring of our systems. </font></p><p><font size="2">Each oncall engineer is defined :- </font></p><p><font size="2">define timeperiod{</font> <br><font size="2">        timeperiod_name 
person1-oncall</font> <br><font size="2">        
alias           
person1-oncall</font> <br><font size="2">        2010-03-29 / 28 
17:30-24:00             
; Monday</font> <br><font size="2">        
2010-03-30 / 28 00:00-08:00,17:30-24:00 ; Tuesday</font> <br><font size="2">        2010-03-31 / 28 
00:00-08:00,17:30-24:00 ; Wednesday</font> <br><font size="2">        2010-04-01 / 28 
00:00-08:00,17:30-24:00 ; Thursday</font> <br><font size="2">        2010-04-02 / 28 
00:00-08:00,17:30-24:00 ; Friday</font> <br><font size="2">        2010-04-03 / 28 
00:00-24:00             
; Saturday</font> <br><font size="2">        
2010-04-04 / 28 
00:00-24:00             
; Sunday</font> <br><font size="2">        
2010-04-05 / 28 
00:00-08:00             
; Monday</font> <br><font size="2">        
}</font> </p><p><font size="2">define timeperiod{</font> <br><font size="2">        timeperiod_name 
person2-oncall</font> <br><font size="2">        
alias          
person2-oncall</font> <br><font size="2">        2010-04-05 / 28 
17:30-24:00             
; Monday</font> <br><font size="2">        
2010-04-06 / 28 00:00-08:00,17:30-24:00 ; Tuesday</font> <br><font size="2">        2010-04-07 / 28 
00:00-08:00,17:30-24:00 ; Wednesday</font> <br><font size="2">        2010-04-08 / 28 
00:00-08:00,17:30-24:00 ; Thursday</font> <br><font size="2">        2010-04-09 / 28 
00:00-08:00,17:30-24:00 ; Friday</font> <br><font size="2">        2010-04-10 / 28 
00:00-24:00             
; Saturday</font> <br><font size="2">        
2010-04-11 / 28 
00:00-24:00             
; Sunday</font> <br><font size="2">        
2010-04-12 / 28 
00:00-08:00             
; Monday</font> <br><font size="2">        
}</font> </p><p><font size="2">define timeperiod{</font> <br><font size="2">        timeperiod_name 
person3-oncall</font> <br><font size="2">        
alias           
person3-oncall</font> <br><font size="2">        2010-04-12 / 28 
17:30-24:00             
; Monday</font> <br><font size="2">        
2010-04-13 / 28 00:00-08:00,17:30-24:00 ; Tuesday</font> <br><font size="2">        2010-04-14 / 28 
00:00-08:00,17:30-24:00 ; Wednesday</font> <br><font size="2">        2010-04-15 / 28 
00:00-08:00,17:30-24:00 ; Thursday</font> <br><font size="2">        2010-04-16 / 28 
00:00-08:00,17:30-24:00 ; Friday</font> <br><font size="2">        2010-04-17 / 28 
00:00-24:00             
; Saturday</font> <br><font size="2">        
2010-04-18 / 28 
00:00-24:00             
; Sunday</font> <br><font size="2">        
2010-04-19 / 28 
00:00-08:00             
; Monday</font> <br><font size="2">        
}</font> </p><p><font size="2">define timeperiod{</font> <br><font size="2">        timeperiod_name 
person4-oncall</font> <br><font size="2">        
alias           
person4-oncall</font> <br><font size="2">        2010-04-19 / 28 
17:30-24:00             
; Monday</font> <br><font size="2">        
2010-04-20 / 28 00:00-08:00,17:30-24:00 ; Tuesday</font> <br><font size="2">        2010-04-21 / 28 
00:00-08:00,17:30-24:00 ; Wednesday</font> <br><font size="2">        2010-04-22 / 28 
00:00-08:00,17:30-24:00 ; Thursday</font> <br><font size="2">        2010-04-23 / 28 
00:00-08:00,17:30-24:00 ; Friday</font> <br><font size="2">        2010-04-24 / 28 
00:00-24:00             
; Saturday</font> <br><font size="2">        
2010-04-25 / 28 
00:00-24:00             
; Sunday</font> <br><font size="2">        
2010-04-26 / 28 
00:00-08:00             
; Monday</font> <br><font size="2">        
}</font> </p><p><font size="2">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. </font></p><p><font size="2">## Escalation ONE:</font> <br><font size="2">define 
serviceescalation {</font> <br><font size="2">        
host_name               
dbhost1</font> <br><font size="2">        
service_description     DB Conn Check</font> <br><font size="2">        
first_notification      4</font> <br><font size="2">        
last_notification       6</font> <br><font size="2">        
notification_interval   15</font> <br><font size="2">        
escalation_options      
c       ; Only escalate for CRITICAL alerts</font> 
<br><font size="2">        
escalation_period       oncall</font> <br><font size="2">        
contact_groups          
wx2-sms-oncall-group</font> <br><font size="2">        }</font> </p><p><font size="2">define timeperiod{</font> <br><font size="2">        timeperiod_name oncall</font> 
<br><font size="2">        
alias           Oncall 
Hours</font> <br><font size="2">        
sunday          00:00-24:00</font> 
<br><font size="2">        
monday          
00:00-08:00,17:30-24:00</font> <br><font size="2">        
tuesday         
00:00-08:00,17:30-24:00</font> <br><font size="2">        
wednesday       00:00-08:00,17:30-24:00</font> 
<br><font size="2">        
thursday        
00:00-08:00,17:30-24:00</font> <br><font size="2">        
friday          
00:00-08:00,17:30-24:00</font> <br><font size="2">        
saturday        00:00-24:00</font> <br><font size="2">        }</font> </p><p><font size="2">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. </font></p><br><p><font size="2">define contactgroup{</font> <br><font size="2">      
contactgroup_name       
wx2-sms-oncall-group</font> <br><font size="2">      
alias                   
WX2 Oncall</font> <br><font size="2">      
members                 
person1-oncall, person2-oncall, person3-oncall, person4-oncall</font> <br><font size="2">      }</font> </p><p><font size="2">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 into each oncall engineers timeperiod so whoever is oncall 
on a particular UK public holiday will get the escalation alerts for the entire 
24 hour period rather than the usual defined oncall period of "00:00-08:00 and 
17:30-24:00"</font></p><p><font size="2">I'd rather not explicitly define a UK holiday date to an oncall 
engineer as this would need to be maintained. I'd rather just have to 
update</font></p><p><font size="2">the timeperiod if the person rota'ed cannot cover that 
particular timeperiod as this will be few and far between in comparison. 
</font></p><p><font size="2">If anymore info is required please let me know. I'm probably 
missing something obvious but I've read the docs over a few times and can't seem 
to see what I want to do in there. </font></p><p><font size="2">Any pointers, help would be really appreciated. </font></p><p><font size="2">Thanks,</font> <br><font size="2">Deborah 
</font></p><br><br><br><br><br>***************************************************************************<br>This 
email and any files transmitted with it are confidential and intended solely for 
the use of the individual or entity to whom they are addressed. <br><br>Any 
unauthorised distribution or copying is strictly prohibited. <br>Whilst Kognitio 
Limited takes steps to prevent the transmission of viruses via e-mail, we can 
not guarantee that any email or attachment is free from computer viruses and you 
are strongly advised to undertake your own anti-virus precautions. 
<br><br>Kognitio grants no warranties regarding performance, use or quality of 
any e-mail or attachment and undertakes no liability for loss or damage, 
howsoever caused. <br><br>Kognitio Limited, a company registered in England and 
Wales. Registered number 0212 7833. Registered Office: 3a Waterside Park, 
Cookham Road, Bracknell, Berks, RG12 1RB. VAT number 864 4378 
92.<br><br>Kognitio Inc, a company incorporated in Delaware, principal office 
180 North Stetson, Suite 3500, Chicago, IL 60601, 
USA<br>***************************************************************************<br><br>
***************************************************************************<br>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. <br>
<br>
Any unauthorised distribution or copying is strictly prohibited. <br>
Whilst Kognitio Limited takes steps to prevent the transmission of viruses via e-mail, we can not guarantee that any email or attachment is free from computer viruses and you are strongly advised to undertake your own anti-virus precautions. <br>
<br>
Kognitio grants no warranties regarding performance, use or quality of any e-mail or attachment and undertakes no liability for loss or damage, howsoever caused. <br>
<br>
Kognitio Limited, a company registered in England and Wales. Registered number 0212 7833. Registered Office:  3a Waterside Park, Cookham Road, Bracknell, Berks, RG12 1RB. VAT number 864 4378 92.<br>
<br>
Kognitio Inc, a company incorporated in Delaware, principal office 180 North Stetson, Suite 3500, Chicago, IL 60601, USA<br>
***************************************************************************<br>
</div>

------------------------------------------------------------------------------<br>_______________________________________________<br>Nagios-users mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>https://lists.sourceforge.net/lists/listinfo/nagios-users<br>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. <br>::: Messages without supporting info will risk being sent to /dev/null------------------------------------------------------------------------------<br>_______________________________________________<br>Nagios-devel mailing list<br>Nagios-devel@lists.sourceforge.net<br>https://lists.sourceforge.net/lists/listinfo/nagios-devel<br></blockquote></div><br></div><br><br><div>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Dan Rich <<a href="mailto:drich@employees.org">drich@employees.org</a>> | <span class="Apple-converted-space">  </span><a href="http://www.employees.org/~drich/">http://www.employees.org/~drich/</a></font></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><span class="Apple-converted-space">                               </span>|<span class="Apple-converted-space">  </span>"Step up to red alert!"<span class="Apple-converted-space">  </span>"Are you sure, sir?</font></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><span class="Apple-converted-space">                               </span>| <span class="Apple-converted-space">  </span>It means changing the bulb in the sign..."</font></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><span class="Apple-converted-space">                               </span>|<span class="Apple-converted-space">          </span>- Red Dwarf (BBC)</font></p>
<br class="Apple-interchange-newline">
</div>
<br></body></html>