several notification commands with different timeperiods
several notification commands with different timeperiods
Hello,
Idea seems simple, but didn't find how to acomplish that.
I want to send sms alerts only in non-working hours.
Tried to define two contact templates (generit, sms-conctat) with different commands (email-notify, sms-notify)
and added to contact : use generic-contact,sms-contact
but that do not work.
Does anyone have an idea how to execute ceration notification commands only for specific timeperiod ?
thanks in advance.
Idea seems simple, but didn't find how to acomplish that.
I want to send sms alerts only in non-working hours.
Tried to define two contact templates (generit, sms-conctat) with different commands (email-notify, sms-notify)
and added to contact : use generic-contact,sms-contact
but that do not work.
Does anyone have an idea how to execute ceration notification commands only for specific timeperiod ?
thanks in advance.
Re: several notification commands with different timeperiods
Did you set the desired respective timeperiods on the templates?
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
sure I do
then I do:
I can set any timeperiod in sms-contact template, it just never works
Code: Select all
define contact{
name generic-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
register 0
}
define contact{
name sms-contact
service_notification_period nonworkhours
host_notification_period nonworkhours
service_notification_commands notify-by-sms
host_notification_commands host-notify-by-sms
register 0
}Code: Select all
define contact{
contact_name nagiosadmin
use generic-contact,sms-contact
alias Nagios Admin
email [email protected]
pager xxxxxxxxxxxxxxx
}Re: several notification commands with different timeperiods
So what is the exact issue? Are you receiving any sms texts and emails? If so, when?
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
with config I posted I never receive sms, only mails.
if I do in one template:
then I get mail and sms, but 24x7 for sure.
if I do in one template:
Code: Select all
service_notification_commands notify-service-by-email,notify-by-sms-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: several notification commands with different timeperiods
Those are the command handlers for your notifications, that is expected behavior.
Quoting Andy:
Quoting Andy:
So what is the exact issue?
Re: several notification commands with different timeperiods
with config I posted I suggest that I will receive mails + sms in non-working hours.
And issue is that I receive only mails and never sms.
Just for test I've changed 'nonworkhours' to '24x7' in sms-contact tempate, and anyway I never received any sms.
Checked nagios.log as well - it never calls notufy-by-sms in such configuration.
And issue is that I receive only mails and never sms.
Just for test I've changed 'nonworkhours' to '24x7' in sms-contact tempate, and anyway I never received any sms.
Checked nagios.log as well - it never calls notufy-by-sms in such configuration.
Re: several notification commands with different timeperiods
This may be due to the missing notification options. It looks as if you have not declared any host/service states to be notified about. You may want to add:
To your sms contact definition.
Code: Select all
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s 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
nope, I tried that before and now checked again.
It doen't metter if *notification_options are presend or not.
nagios just executes notify-service-by-email and never by-sms
It doen't metter if *notification_options are presend or not.
nagios just executes notify-service-by-email and never by-sms
Re: several notification commands with different timeperiods
Lets check the logs:
Code: Select all
grep notify-by-sms /usr/local/nagios/var/nagios.logFormer 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.