<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-NZ" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal">I'm trying to set up two types of notifications, namely emails and sms messages using gnokii.<br>
<br>
I want the emails to go 24x7, but the sms only to go out of work hours.<br>
<br>
The problem is, no matter what I try nagios sends out sms messages 24x7.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have tried commenting out the notification_period in the hosts.cfg and services.cfg file.<br>
<br>
A subset of my config files is below (addresses and names changed). Can anyone see what I've missed?<br>
<br>
<br>
------------------------------------------------------------------<br>
hosts.cfg<br>
<br>
# 'host1' host definition<br>
define host{<br>
use generic-host ; Name of host template to use<br>
<br>
host_name host1<br>
parents main_switch<br>
alias host1 definition<br>
address aaa.bbb.ccc.ddd<br>
check_command check-host-alive<br>
max_check_attempts 10<br>
notification_interval 0<br>
notification_period 24x7<br>
notification_options d,u,r<br>
}<br>
-------------------------------------------------------------------<br>
services.cfg<br>
<br>
define service{<br>
use generic-service ; Name of service template to use<br>
<br>
host_name host1<br>
service_description PING<br>
is_volatile 0<br>
check_period 24x7<br>
max_check_attempts 3<br>
normal_check_interval 5<br>
retry_check_interval 1<br>
contact_groups server-admins<br>
notification_interval 120<br>
notification_period 24x7<br>
notification_options c,r<br>
check_command check_ping!250.0,33%!2000.0,80%<br>
}<br>
--------------------------------------------------------------------------<br>
hostgroups.cfg<br>
<br>
# 'server-admins group definition<br>
define hostgroup{<br>
hostgroup_name server-admins<br>
alias Servers<br>
members host1,host2<br>
}<br>
-----------------------------------------------------------------------------<br>
contactgroups.cfg<br>
<br>
# 'server-admins' contact group definition<br>
define contactgroup{<br>
contactgroup_name server-admins<br>
alias Server Administrators<br>
members bob,bobbysms<br>
}<br>
--------------------------------------------------------------------------------<br>
contacts.cfg<br>
<br>
# 'bob'' contact definition<br>
define contact{<br>
contact_name bob<br>
alias bob<br>
service_notification_period 24x7<br>
host_notification_period 24x7<br>
service_notification_options c,r<br>
host_notification_options d,r<br>
service_notification_commands notify-by-email<br>
host_notification_commands host-notify-by-email<br>
email <a href="javascript:window.location=%22mai%22+%22lto:%22+%22bob%22+%22@%22+%22nowhere.com%22;self.close();" target="_blank">
-email-</a><br>
}<br>
<br>
# 'bobbysms' contact definition<br>
define contact{<br>
contact_name bobbysms<br>
alias bob<br>
service_notification_period ournonworkhours<br>
host_notification_period ournonworkhours<br>
service_notification_options c,r<br>
host_notification_options d,r<br>
service_notification_commands notify-by-gnokii-queue<br>
host_notification_commands host-notify-by-gnokii-queue<br>
pager 123456789<br>
}<br>
<br>
--------------------------------------------------------------------------------------<br>
timeperiods.cfg<br>
<br>
# '24x7' timeperiod definition<br>
define timeperiod{<br>
timeperiod_name 24x7<br>
alias 24 Hours A Day, 7 Days A Week<br>
sunday 00:00-24:00<br>
monday 00:00-24:00<br>
tuesday 00:00-24:00<br>
wednesday 00:00-24:00<br>
thursday 00:00-24:00<br>
friday 00:00-24:00<br>
saturday 00:00-24:00<br>
}<br>
<br>
# 'ournonworkhours' timeperiod definition<br>
define timeperiod{<br>
timeperiod_name ournonworkhours<br>
alias Our Non-Work Hours inc. NZ holidays<br>
december 25 - january 5 00:00-24:00 ; Christmas<br>
february 6 00:00-24:00 ; Waitangi day 2009<br>
april 10 00:00-24:00 ; Good Friday 2009<br>
april 13 00:00-24:00 ; Easter Monday 2009<br>
april 25 00:00-24:00 ; ANZAC day 2009<br>
june 1 00:00-24:00 ; Queens Birthday 2009<br>
october 26 00:00-24:00 ; Labour Day 2009<br>
january 26 00:00-24:00 ; Auckland Ann. 2009<br>
january 19 00:00-24:00 ; Wellington Ann. 2009<br>
november 14 00:00-24:00 ; Canterbury Ann. 2008<br>
sunday 00:00-24:00<br>
monday 00:00-08:00,17:00-24:00<br>
tuesday 00:00-08:00,17:00-24:00<br>
wednesday 00:00-08:00,17:00-24:00<br>
thursday 00:00-08:00,17:00-24:00<br>
friday 00:00-08:00,17:00-24:00<br>
saturday 00:00-24:00<br>
}<br>
----------------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I posted a help request at <a href="http://www.meulie.net/portal_plugins/forum/forum_viewtopic.php?13710.0">
http://www.meulie.net/portal_plugins/forum/forum_viewtopic.php?13710.0</a> and people there think I may have found a bug in the timeperiod parsing routine.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can this be looked at?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kim<o:p></o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Green" size="1">Please consider the environment before printing this email<br>
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.<br>
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz<br>
</font>
</body>
</html>