Page 1 of 2

SMS alert

Posted: Wed Jul 29, 2015 6:53 am
by lafargeuser
just wanted to know that, how do I configure multiple mobile numbers in Nagios to receive alerts via SMS.
Do I have to add numbers separated by comma.

Re: SMS alert

Posted: Wed Jul 29, 2015 9:28 am
by tmcdonald
This would either need to be multiple contacts (one for each number) or a customized notification command (more work to set up).

Re: SMS alert

Posted: Wed Aug 05, 2015 12:31 pm
by gormank
I expect to have a similar need in the future to handle oncall rotations. If you have any, could you post details of what would be needed to define a customized notification command?

I imagine there's a php script that runs a nagios command, and I'd need to define a new command, or modify the (or create a new) .php script. I see various nagios commands defined for handling mail. In looking for a likely .php file I see utils-email.inc.php, and I see that uses PHPMailer, so I guess I may have answered myself...

Re: SMS alert

Posted: Wed Aug 05, 2015 3:35 pm
by lmiltchev
I expect to have a similar need in the future to handle oncall rotations. If you have any, could you post details of what would be needed to define a customized notification command?
I haven't tried this, but it *should* work. You could use the "$CONTACTADDRESSn$" standard nagios macro.

http://nagios.sourceforge.net/docs/nagi ... ml#contact
addressx: Address directives are used to define additional "addresses" for the contact. These addresses can be anything - cell phone numbers, instant messaging addresses, etc. Depending on how you configure your notification commands, they can be used to send out an alert to the contact. Up to six addresses can be defined using these directives (address1 through address6). The $CONTACTADDRESSx$ macro will contain this value.

Re: SMS alert

Posted: Fri Aug 07, 2015 4:31 am
by lafargeuser
how do i configure multiple numbers for shift rotation, what happened if shift changes support engg will also change & so the mobile no. How can I achieve this in Nagios.

I have gone through this Timeperiod Management under CCM. But didnt understand below term.

Template Name

Time Definition


Examples: "monday", "december 25", "use"

Time Range


Examples: "00:00-24:00", "09:00-17:00", "us-holidays"

Insert Definition


using above method can I achieve this ?

Re: SMS alert

Posted: Fri Aug 07, 2015 10:36 am
by jdalrymple
You are headed down the right path. You can set up a timeperiod for each engineer using the timeperiods dialogue. Unfortunately we don't have any documentation for the timeperiod dialogue, however it is self documented using the "Help & Documentation" within timeperiod. Shown is an example timeperiod indicating 2:00PM until 10:00PM Monday - Friday. Basically fill in Time Deifiniton and Time Range, to specify a period of time, then hit Insert Definition to add it to the timeperiod.

Re: SMS alert

Posted: Fri Aug 07, 2015 2:10 pm
by gormank
It may not help this thread, but my solution was to tell the users that as they go on/off on call, they need to log in and set their preferences to enable/disable SMS alerts. Now its their problem :)

Re: SMS alert

Posted: Sat Aug 08, 2015 5:30 pm
by jdalrymple
gormank wrote:It may not help this thread, but my solution was to tell the users that as they go on/off on call, they need to log in and set their preferences to enable/disable SMS alerts. Now its their problem :)
That certainly is a solution that should work, however setting up a few timeperiods and assigning them to a contact is pretty trival.

Re: SMS alert

Posted: Mon Aug 10, 2015 2:53 am
by lafargeuser
confgured the time period accordingly. But in one go how do I set this policy to all servers/number of servers which are being monitoring through XI

Re: SMS alert

Posted: Mon Aug 10, 2015 9:04 am
by jdalrymple
I think what you'd actually want is all servers/services to continue to use 24x7 but assign the rotating timeperiods to your contacts.

Read about filters: https://assets.nagios.com/downloads/nag ... tions.html