Send Alerts through SMS

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.
Locked
acvillaester
Posts: 21
Joined: Fri Nov 17, 2017 11:06 am

Send Alerts through SMS

Post by acvillaester »

Hi,

Please help me configure sending alerts through SMS.
I've googled but most of them need third party(sms provider) that we need to pay.

Thanks and Godbless!!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Send Alerts through SMS

Post by tmcdonald »

Most of them will. Nagios does not have a built-in SMS module, but depending on your SMS provider you might be able to send an email to a special address which will forward to SMS:

https://www.digitaltrends.com/mobile/ho ... l-account/
Former Nagios employee
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Send Alerts through SMS

Post by mcapra »

Twilio has a free-tier that I've successfully integrated into Nagios Core without too much trouble.

Here's what I'm using as my notification handlers (sanitized of my credentials of course):

Code: Select all

define command {
        command_name    notify-service-by-twilio
        command_line    curl 'https://api.twilio.com/2010-04-01/Accounts/<account>/Messages.json' -X POST --data-urlencode 'To=$CONTACTPAGER$' --data-urlencode 'From=<twilio_number>' --data-urlencode 'Body=NAGIOS: $HOSTNAME$--$SERVICEDESC$--$SERVICESTATE$' -u <credentials>
}

define command {
        command_name    notify-host-by-twilio
        command_line    curl 'https://api.twilio.com/2010-04-01/Accounts/<account>/Messages.json' -X POST --data-urlencode 'To=$CONTACTPAGER$' --data-urlencode 'From=<twilio_number>' --data-urlencode 'Body=NAGIOS: $HOSTNAME$--$HOSTSTATE$' -u <credentials>
}
And my corresponding contact definition:

Code: Select all

define contact {
        contact_name                    matt.capra
        use                             generic-contact
        email                           <my_email>
        pager                           <my_cell_number>
}
Former Nagios employee
https://www.mcapra.com/
kyang

Re: Send Alerts through SMS

Post by kyang »

Thanks for the help @mcapra!
Locked