I checked logs immediately after understood this config is not working.
when using two templates "notify-by-sms" just never appears in log.
several notification commands with different timeperiods
Re: several notification commands with different timeperiods
Attempt at a workaround: Try setting each template to a different hostgroup and then applying those hostgroups to the object in question.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: several notification commands with different timeperiods
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 :
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.
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....
}
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
Noted, glad you got it working. If you wish, open a feature request at tracker.nagios.org .
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.