I haven't tried this myself, but you could try having a notification
command that checks for a custom object variable ($_HOSTALTNOTIFY$) and
does an if/else on the state of that variable? I'm not sure how Nagios
behaves when a $BLAH$ doesn't exist, so you may need to define it
globally as "no" or something and then override to "yes" but it could work.
-Gius
Mathew Walker wrote:
Just thinking about something here and didn't make sense. Wanted to
make sure I was not missing something...
I define a contact like in the documentation...
define contact{
contact_name jdoe
alias John Doe
host_notifications_enabled 1
service_notifications_enabled 1
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email [email protected]
<mailto:[email protected]>
pager
[email protected]
<mailto:[email protected]>
address1 [email protected]
<mailto:[email protected]>
address2 555-555-5555
can_submit_commands 1
}
Sure he gets email alerts just fine, but what if I wanted to make sure
the contacts got emails to his default email as well as ADDRESS1 or
PAGER for a particular service? I create a
"service_notification_command" called "notify-by-address1" which would
work, but I can only seem to specify this on the contact level so he
would get alerts to both addresses for every service he's a contact for.
I know I could alternatively create a 2nd contact and add that 2nd
contact to the particular service, I just didn't know if I'm missing
some other way to configure a contact 'method' for a given contact at
a service/host level.
Also I'm assuming I can modify this line...
service_notification_commands notify-by-email,notify-by-address1
For a given service so they get alerts to both locations for all alerts.
If not... perhaps be able to add something like this at the individual
service/host level...
contact jdoe:notify-by-email,jdoe:notify-by-pager
defaulting to email if no method is defined...
--
Mat W. - http://www.techadre.com
------------------------------------------------------------------------
Windows Live™ SkyDrive™: Store, access, and share your photos. See
how.
<http://windowslive.com/Online/SkyDrive?ocid=TXT_TAGLM_WL_CS_SD_photos_072009>
------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------
_______________________________________________
Nagios-users mailing list
[email protected]
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
------------------------------------------------------------------------------
_______________________________________________
Nagios-users mailing list
[email protected]
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