Possible bug in time period parsing
Kim Klinkhamer
KlinkhamerK at landcareresearch.co.nz
Tue Nov 25 22:54:38 CET 2008
I'm trying to set up two types of notifications, namely emails and sms messages using gnokii.
I want the emails to go 24x7, but the sms only to go out of work hours.
The problem is, no matter what I try Nagios sends out sms messages 24x7.
I have tried commenting out the notification_period in the hosts.cfg and services.cfg file.
A subset of my config files is below (addresses and names changed). Can anyone see what I've missed?
------------------------------------------------------------------
hosts.cfg
# 'host1' host definition
define host{
use generic-host ; Name of host template to use
host_name host1
parents main_switch
alias host1 definition
address aaa.bbb.ccc.ddd
check_command check-host-alive
max_check_attempts 10
notification_interval 0
notification_period 24x7
notification_options d,u,r
}
-------------------------------------------------------------------
services.cfg
define service{
use generic-service ; Name of service template to use
host_name host1
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups server-admins
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_ping!250.0,33%!2000.0,80%
}
--------------------------------------------------------------------------
hostgroups.cfg
# 'server-admins group definition
define hostgroup{
hostgroup_name server-admins
alias Servers
members host1,host2
}
-----------------------------------------------------------------------------
contactgroups.cfg
# 'server-admins' contact group definition
define contactgroup{
contactgroup_name server-admins
alias Server Administrators
members bob,bobbysms
}
--------------------------------------------------------------------------------
contacts.cfg
# 'bob'' contact definition
define contact{
contact_name bob
alias bob
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email -email-
}
# 'bobbysms' contact definition
define contact{
contact_name bobbysms
alias bob
service_notification_period ournonworkhours
host_notification_period ournonworkhours
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-by-gnokii-queue
host_notification_commands host-notify-by-gnokii-queue
pager 123456789
}
--------------------------------------------------------------------------------------
timeperiods.cfg
# '24x7' timeperiod definition
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
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
# 'ournonworkhours' timeperiod definition
define timeperiod{
timeperiod_name ournonworkhours
alias Our Non-Work Hours inc. NZ holidays
december 25 - january 5 00:00-24:00 ; Christmas
february 6 00:00-24:00 ; Waitangi day 2009
april 10 00:00-24:00 ; Good Friday 2009
april 13 00:00-24:00 ; Easter Monday 2009
april 25 00:00-24:00 ; ANZAC day 2009
june 1 00:00-24:00 ; Queens Birthday 2009
october 26 00:00-24:00 ; Labour Day 2009
january 26 00:00-24:00 ; Auckland Ann. 2009
january 19 00:00-24:00 ; Wellington Ann. 2009
november 14 00:00-24:00 ; Canterbury Ann. 2008
sunday 00:00-24:00
monday 00:00-08:00,17:00-24:00
tuesday 00:00-08:00,17:00-24:00
wednesday 00:00-08:00,17:00-24:00
thursday 00:00-08:00,17:00-24:00
friday 00:00-08:00,17:00-24:00
saturday 00:00-24:00
}
----------------------------------------------------------------------------------
I posted a help request at http://www.meulie.net/portal_plugins/forum/forum_viewtopic.php?13710.0 and people there think I may have found a bug in the timeperiod parsing routine.
Can this be looked at?
Thanks,
Kim
Please consider the environment before printing this email
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.
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
More information about the Developers
mailing list