timeperiod not behaving as expected
Carl Karsten
carl at personnelware.com
Tue Jul 27 20:26:57 CEST 2010
So I took over someone's nagios setup - it works fine except it checks
that a box is up 24x7 but the box has a cronjob that does 0600 ifup,
2000 ifdown; so I get a wad of email every night telling me the box
is down, and then the resolved when it comes back up. So I tried to
fix it, and now I get more email.
Here is a diff of what I changed, my credit_card_hours, and the part
of server.cfg that I think is relevant.
juser at four:~/temp$ diff nag0.txt nag1.txt
1d0
<
6c5
< check_period 24x7 ; By
default, Linux hosts are checked round the clock
---
> check_period credit_card_hours
12,14c11,12
< ; Note that
the notification_period variable is being overridden from
< ; the value
that is inherited from the generic-host template!
< notification_interval 60 ; Resend
notifications every 2 hours
---
>
> notification_interval 60
define timeperiod{
timeperiod_name credit_card_hours
alias when credit cards can be processed
sunday 06:00-20:00
monday 06:00-20:00
tuesday 06:00-20:00
wednesday 06:00-20:00
thursday 06:00-20:00
friday 06:00-20:00
saturday 06:00-20:00
define host{
use linux-server ; This
template inherits other values from the generic-host template
host_name mcve.cteusa.com ; The
name of this host
hostgroups linux-servers
check_period credit_card_hours
check_interval 5 ; Actively
check the host every 5 minutes
retry_interval 1 ; Schedule
host check retries at 1 minute intervals
max_check_attempts 10 ; Check each
Linux host 10 times (max)
check_command check-host-alive ; Default
command to check Linux hosts
notification_period 24x7 ; Linux admins hate to
be woken up, so we only notify during the day
notification_interval 60
notification_options d,u,r ; Only send
notifications for specific host states
contact_groups admins ;
Notifications get sent to the admins by default
register 1
}
define service{
use generic-service ; Inherit default
values from a template
host_name mcve.cteusa.com
service_description SMTP
check_command check_smtp!-t 5
}
define service{
use generic-service ; Inherit default
values from a template
host_name mcve.cteusa.com
service_description SSH
check_command check_ssh
}
define service{
use generic-service ; Name
of service template to use
host_name mcve.cteusa.com
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
--
Carl K
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at 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
More information about the Users
mailing list