Page 2 of 2

Re: several notification commands with different timeperiods

Posted: Sat Jun 15, 2013 1:50 pm
by link
I checked logs immediately after understood this config is not working.
when using two templates "notify-by-sms" just never appears in log.

Re: several notification commands with different timeperiods

Posted: Mon Jun 17, 2013 4:52 pm
by abrist
Attempt at a workaround: Try setting each template to a different hostgroup and then applying those hostgroups to the object in question.

Re: several notification commands with different timeperiods

Posted: Wed Jun 19, 2013 3:59 am
by link
abrist, thanks for suggeston, but I don't like idea using one more hostgroup just for sms notifications...
nave 2 news:
1. I understood that config I posted should not work at all. This is correctly described here:
http://nagios.sourceforge.net/docs/3_0/ ... tance.html
2. I found way to get what I need
I need to use macro - "$ISVALIDTIME:non-workhours$"
pass it to command that sends sms :

Code: Select all

define command{
        command_name host-notify-by-sms
        command_line $USER1$/notify_sms.pl $ISVALIDTIME:non-workhours$ $other_OPTION....
}
and then check this 0/1 value in script.

Not sure, but I think it should not be such rear case when someone wants to have different notifications in different timeperiods, so may be this can be suggested as feature request for future versions.

Re: several notification commands with different timeperiods

Posted: Wed Jun 19, 2013 11:58 am
by abrist
Noted, glad you got it working. If you wish, open a feature request at tracker.nagios.org .