Workhours & off_workhours notifications
Posted: Fri Aug 12, 2011 12:58 pm
I am having a problem with this hope someone can either send me a link to some kind of documentation or tell me how I can do what I need to do?
Ok I am fine with being notified during work hours every hour or so, but off work hours I only need to be notified every 6 hours after already had received the first notification. I have tried several things and can't get it to work write either keeps notifying me every hour or get a config error on restarting nagios.
Heres a couple of things I have tried:
First I had tried creating to notification periods:
# 'workhours' timeperiod definition
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 08:00-18:00
tuesday 08:00-18:00
wednesday 08:00-18:00
thursday 08:00-18:00
friday 08:00-18:00
}
# 'off workhours' timeperiod definition
define timeperiod{
timeperiod_name off_workhours
alias Off Work Hours
monday 18:01-07:59
tuesday 18:01-07:59
wednesday 18:01-07:59
thursday 18:01-07:59
friday 18:01-07:59
friday 00:00-24:00
saturday 00:00-24:00
}
and have made 2 templates:
define host{
name linux-server ; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
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 workhours ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
define host{
name linux-server_off; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
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 off_workhours ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
have created 2 different service and host checks:
define host{
use linux-server ; Name of host template to use
host_name localhost
alias fan
address 127.0.0.1
}
define service{
use l_server-service ; Name of service template to use
host_name localhost
service_description Root Partition
servicegroups check_drive-space
check_command check_local_disk!20%!10%!/
}
define host{
use linux-server_off ; Name of host template to use
host_name localhost
alias fan
address 127.0.0.1
}
define service{
use l_server-service_off ; Name of service template to use
host_name localhost
service_description Root Partition
servicegroups check_drive-space
check_command check_local_disk!20%!10%!/
}
this has resulted in a config error, guessing because they have the same ip address.
Then I found this in Nagios 3 Enterprise Network Monitoring book I had purchased as well as on the net:
define serviceescalation{
hostgroup_name linux-servers
service_description *
first_notification 1
last_notification 2
notification_interval 360
contact_groups admins
}
this didn't change anything still notified about the same problem every hour.
How can I accomplish being notified 1 time then again every 6 hours during off work hours?
been trying numerous things all week and am at a loss...
Please help...
Thanks in advance,
Joe
Ok I am fine with being notified during work hours every hour or so, but off work hours I only need to be notified every 6 hours after already had received the first notification. I have tried several things and can't get it to work write either keeps notifying me every hour or get a config error on restarting nagios.
Heres a couple of things I have tried:
First I had tried creating to notification periods:
# 'workhours' timeperiod definition
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 08:00-18:00
tuesday 08:00-18:00
wednesday 08:00-18:00
thursday 08:00-18:00
friday 08:00-18:00
}
# 'off workhours' timeperiod definition
define timeperiod{
timeperiod_name off_workhours
alias Off Work Hours
monday 18:01-07:59
tuesday 18:01-07:59
wednesday 18:01-07:59
thursday 18:01-07:59
friday 18:01-07:59
friday 00:00-24:00
saturday 00:00-24:00
}
and have made 2 templates:
define host{
name linux-server ; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
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 workhours ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
define host{
name linux-server_off; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
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 off_workhours ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
have created 2 different service and host checks:
define host{
use linux-server ; Name of host template to use
host_name localhost
alias fan
address 127.0.0.1
}
define service{
use l_server-service ; Name of service template to use
host_name localhost
service_description Root Partition
servicegroups check_drive-space
check_command check_local_disk!20%!10%!/
}
define host{
use linux-server_off ; Name of host template to use
host_name localhost
alias fan
address 127.0.0.1
}
define service{
use l_server-service_off ; Name of service template to use
host_name localhost
service_description Root Partition
servicegroups check_drive-space
check_command check_local_disk!20%!10%!/
}
this has resulted in a config error, guessing because they have the same ip address.
Then I found this in Nagios 3 Enterprise Network Monitoring book I had purchased as well as on the net:
define serviceescalation{
hostgroup_name linux-servers
service_description *
first_notification 1
last_notification 2
notification_interval 360
contact_groups admins
}
this didn't change anything still notified about the same problem every hour.
How can I accomplish being notified 1 time then again every 6 hours during off work hours?
been trying numerous things all week and am at a loss...
Please help...
Thanks in advance,
Joe