I am trying to avoid that because it seems like it would get fairly
difficult to manage and makes
the config alot more difficult to read, especially if you happen to
have a whole bunch of
people who need to receive alerts.
But from what I can tell, this looks like the only possible solution
On Dec 2, 2008, at 2:41 PM, Seth Simmons wrote:
You want to configure Nagios to send alerts by email during the day by
sms the rest of the time?
Why don't you just create 2 separate contact definitions, one for
email
and one for sms with different time definitions?
Would look something like this:
define contact{
contact_namesysadmin-1
use generic-contact
alias sysadmin workhours
host_notification_periodworkhours
service_notification_period workhours
host_notification_options d,r
service_notification_optionsw,c,r
email [EMAIL PROTECTED]
}
define contact{
contact_namesysadmin-2
use generic-contact
alias sysadmin after work
host_notification_periodafterwork
service_notification_period afterwork
host_notification_options d,r
service_notification_optionsw,c,r
email [EMAIL PROTECTED]
}
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 08:00-16:59
tuesday 08:00-16:59
wednesday 08:00-16:59
thursday08:00-16:59
friday 08:00-16:59
}
define timeperiod{
timeperiod_name afterwork
alias Normal Work Hours
monday 17:00-24:00
tuesday 17:00-24:00
wednesday 17:00-24:00
thursday17:00-24:00
friday 17:00-24:00
saturday00:00-24:00
sunday 00:00-24:00
}
define service{
use local-service
hostgroup_name Linux
service_description Load Average
check_command check_nrpe!check_load
max_check_attempts 2
check_interval 10
retry_interval 5
check_period24x7
notification_interval 60
first_notification_delay0
notification_period 24x7
contacts
sysadmin-1,sysadmin-2
notification_optionsc,w,r
}
As far as certain services sms only, use the 24x7 time period, create
contact for the 24x7 time period and configure the service
accordingly.
define contact{
contact_namesysadmin-3
use generic-contact
alias sysadmin sms
host_notification_period24x7
service_notification_period 24x7
host_notification_options d,r
service_notification_optionsw,c,r
email [EMAIL PROTECTED]
}
define service{
use local-service
hostgroup_name linux
service_description Free Space on /
check_command check_nrpe!check_root
max_check_attempts 2
check_interval 15
retry_interval 5
check_period24x7
notification_interval 60
first_notification_delay0
notification_period 24x7
contactssysadmin-3
notification_optionsc,w,r
}
The way that is configured, any problems with load in your linux
hostgroup will send notification by email during the day and by sms
after hours/weekends. The second example will send by sms at any time
for any alerts with free space.
-Original Message-
From: Steven Kreuzer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 2, 2008 2:08 PM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] Alternating Notification Commands
Greetings-
In addition to the two included commands for sending notifications, I
defined two new ones called notify-host-by-sms and notify-service-by-
sms.
What I would like to do is configure nagios to have it send alerts by
email during normal business hours and send alerts by sms the rest
of the time. I would also like to configure certain critical services
to only alert