several notification commands with different timeperiods

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
link
Posts: 7
Joined: Mon Jun 10, 2013 4:37 am

Re: several notification commands with different timeperiods

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: several notification commands with different timeperiods

Post by abrist »

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.
link
Posts: 7
Joined: Mon Jun 10, 2013 4:37 am

Re: several notification commands with different timeperiods

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: several notification commands with different timeperiods

Post by abrist »

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.
Locked