Free SMS Alerts from Nagios

I have implemented the SMS alerts in nagios with the help of API's of different providers.

Sign up to the and it will create an API key on the sign up. After the sign up add some free credits for receiving the sms on your number.

Nagios Server Configuration

For the API to work with nagios, we will download the plugin of clockworksms.

Download the plugin from the above link and paste it on your nagios server plugin directory.

# cp ~/Downloads/ /usr/local/nagios/libexec/

After copied the script, make it executable

# chmod +x

Then go to your commands file and paste these lines:

# vi /usr/local/nagios/etc/objects/commands.cfg

define command{
command_name notify-by-sms 
command_line $USER1$/ -k API_KEY -t $CONTACTPAGER$ -f Nagios -m "Service: $SERVICEDESC$nHost: $HOSTNAME$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nInfo: $SERVICEOUTPUT$nDate: $LONGDATETIME$" 

define command{ 
command_name host-notify-by-sms 
command_line $USER1$/ -k API_KEY -t $CONTACTPAGER$ -f Nagios -m "Host $HOSTNAME$ is $HOSTSTATE$nInfo: $HOSTOUTPUT$nTime: $LONGDATETIME$" 

API_KEY = Your API key which is generated on sign up

After this add your number on which you want to receive your alerts in contacts file.

# vi  /usr/local/nagios/etc/objects/contacts.cfg

define contact{

service_notification_commands      notify-by-sms
host_notification_commands         host-notify-by-sms

service_notification_commands     notify-service-by-email
host_notification_commands         notify-host-by-email

        contact_name              administrator ;
        use                             generic-contact ;
        alias                            Nagios Admin  ; 
        email                  ; 
        pager                          00923421111111 ;


Test your SMS alert functionality by taking down Host/Service.

Other few provider are listed below:


Post a comment

Please give your review or ask question ?