how to send alert sms from nagios.pdf

11
SEND SMS ALERT FROM YOUR SYSTEM: Twitter Joomla HP Openview WhatsUp Gold Sharepoint Notes Home Solutions Applications Industries Products About Us Download: OzekiNG-SMS-Gateway.zip (5 MB) for Windows XP,2000,2003,2008,Vista,Windows 7 free 20 day trial version Menu Welcome page Solutions SMS from CRM SMS from Communication Softwares System Monitoring SCOM 2007 MOM 2005 HP Openview WhatsUp Gold IBM Tivoli Big Brother BMC CA Unicenter HP Insight Manager Nagios SMS Zenoss Active Directory Integration Solarwinds Orion NPM E-mail-to-SMS gateway solution for GpsGate HP NNM SMS from CMS Helpdesk Softwares OTP Ozeki NG Interface Applications SMS Examples Products Contact Sitemap Contact Us! If you wish to get further information, do not hesitate to contact us! E-mail: [email protected] Useful information How to send SMS with a GSM modem attached to your PC? This solution is best if you are planning to send or receive up to 4000 SMS per day. Read more: Prerequisites Setup instructions Video tutorial How to send SMS through the Internet? Adopt SMS technology into your Nagios based system in order to send SMS notifications or alerts from PC to mobile devices. With SMS functionality the generated reports of Nagios can be sent directly to the technical staff to make immediate intervention possible. For this purpose, install Ozeki NG SMS Gateway and start to send text message from Nagios via SMS gateway. It is a software product that forwards messages to the mobile network either with GSM modem or IP SMS connection. Learn more about this SMS solution below this page. Download: sms_send.sh (259 bytes) Video: Send SMS from Nagios via SMS gateway (part 1/2, configure your modem) Video: Send SMS from Nagios (part 2/2, configure your system) Introduction to SMS messaging As IT infrastructures of companies are becoming more and more complex and complicated, monitoring applications, such as Nagios, are widely used. These monitoring systems help identify and resolve IT problems in a way that they generate reports about these system failures. These reports usually can be forwarded to multiple recipients as email messages. The disadvantage of this method is that it is not sure that the recipient is sitting in front of his computer in the critical moment. So if you wish to improve your monitoring system, first you need to ensure that alerts reach the attention of the technical staff. SMS technology can be a solution as it makes it possible to send SMS notifications from your IT environment to mobile phones. In this way, you can be sure that the intended person receives the message alert in real time and he can make the necessary steps to solve IT issues in time. It is also possible to send these SMS alerts to multiple recipients so the members of the IT staff and management can be informed about events occur in the IT system at the same time. You can receive a notification message even if you are on the move to be well-informed and up-to-date about the condition of your system. To achieve these excellent features you need to install a powerful SMS gateway such as Ozeki NG SMS Gateway on your computer. Ozeki NG SMS Gateway provides the SMS functionality for Nagios. It has a unique capacity on the market. The SMS messages can be sent with a GSM modem attached to the computer or the SMS gateway connects directly to the SMS center of the mobile service provider over the Internet. With this solution you can build a stable SMS system to improve your monitoring application while you save time and money. In this article a step by step configuration guide will be provided, as well. Preconditions To adopt this solution you will need a connection between the mobile network and your system. You can establish this connection in two ways: using an Internet connection or using a wireless connection by attaching a GSM phone or GSM modem to your PC. Please check this website if you need some help for your decision: Internet based SMS connections vs. GSM modem based (wireless) SMS connections. According to your decision, you will different preconditions. Preconditions for Internet based connection to the Mobile network How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1... 1 of 11 02/08/2012 11:01 a.m.

Upload: pirapp

Post on 14-Apr-2015

104 views

Category:

Documents


4 download

DESCRIPTION

Config Nagios to send SMS messages to a mobile device vía software

TRANSCRIPT

Page 1: How to send alert SMS from Nagios.pdf

SEND SMS ALERT FROM YOUR SYSTEM: Twitter JoomlaHP Openview WhatsUp GoldSharepoint Notes

Home Solutions Applications Industries Products About Us

Download:

OzekiNG-SMS-Gateway.zip (5 MB)for Windows XP,2000,2003,2008,Vista,Windows 7free 20 day trial version

Menu

Welcome page

Solutions SMS from CRM

SMS from CommunicationSoftwares

System Monitoring

SCOM 2007

MOM 2005

HP Openview

WhatsUp Gold

IBM Tivoli

Big Brother

BMC

CA Unicenter

HP Insight Manager

Nagios SMS

Zenoss

Active Directory Integration

Solarwinds Orion NPM

E-mail-to-SMS gateway solutionfor GpsGate

HP NNM

SMS from CMS

Helpdesk Softwares

OTP

Ozeki NG Interface

Applications

SMS Examples

Products

Contact

Sitemap

Contact Us!

If you wish to get further information, do nothesitate to contact us!

E-mail: [email protected]

Useful information

How to send SMS with a GSM modemattached to your PC?

This solution is best if you are planning to sendor receive up to 4000 SMS per day. Read more:

PrerequisitesSetup instructionsVideo tutorial

How to send SMS through the Internet?

Adopt SMS technology into your Nagios based system in order to send SMS notificationsor alerts from PC to mobile devices. With SMS functionality the generated reports ofNagios can be sent directly to the technical staff to make immediate interventionpossible. For this purpose, install Ozeki NG SMS Gateway and start to send textmessage from Nagios via SMS gateway. It is a software product that forwards messagesto the mobile network either with GSM modem or IP SMS connection. Learn moreabout this SMS solution below this page.

Download: sms_send.sh (259 bytes)

Video: Send SMS from Nagios via SMS gateway (part 1/2, configure your modem)

Video: Send SMS from Nagios (part 2/2, configure your system)

Introduction to SMS messaging

As IT infrastructures of companies are becoming more and more complex and complicated,monitoring applications, such as Nagios, are widely used. These monitoring systems helpidentify and resolve IT problems in a way that they generate reports about these systemfailures. These reports usually can be forwarded to multiple recipients as email messages. Thedisadvantage of this method is that it is not sure that the recipient is sitting in front of hiscomputer in the critical moment. So if you wish to improve your monitoring system, first youneed to ensure that alerts reach the attention of the technical staff.

SMS technology can be a solution as it makes it possible to send SMS notifications fromyour IT environment to mobile phones. In this way, you can be sure that the intendedperson receives the message alert in real time and he can make the necessary steps to solve ITissues in time. It is also possible to send these SMS alerts to multiple recipients so themembers of the IT staff and management can be informed about events occur in the IT systemat the same time. You can receive a notification message even if you are on the move to bewell-informed and up-to-date about the condition of your system.

To achieve these excellent features you need to install a powerful SMS gateway such as OzekiNG SMS Gateway on your computer. Ozeki NG SMS Gateway provides the SMSfunctionality for Nagios. It has a unique capacity on the market. The SMS messages can besent with a GSM modem attached to the computer or the SMS gateway connects directly tothe SMS center of the mobile service provider over the Internet. With this solution you canbuild a stable SMS system to improve your monitoring application while you save timeand money. In this article a step by step configuration guide will be provided, as well.

Preconditions

To adopt this solution you will need a connection between the mobile network and yoursystem. You can establish this connection in two ways: using an Internet connection or using awireless connection by attaching a GSM phone or GSM modem to your PC. Please check thiswebsite if you need some help for your decision: Internet based SMS connections vs. GSMmodem based (wireless) SMS connections. According to your decision, you will differentpreconditions.

Preconditions for Internet based connection to the Mobile network

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

1 of 11 02/08/2012 11:01 a.m.

Page 2: How to send alert SMS from Nagios.pdf

If you wish to send more then 4000 SMS perday, it is a good idea to use an Internet SMSservice provider. Read more:

PrerequisitesSetup instructions

To establish the connection between your system and an SMS service provider via theInternet, you will need these devices:

Figure 1/a - Prerequisites for Ozeki NG SMS Gateway IP SMS connection

With this type of connection you will need an SMS service provider who provides access toits services and ensures Internet based SMS services. On our webpage we have collected someproviders to help you in your decision: SMPP SMS Service providers. After you have decidedwhich provider and which service is the most appropriate for you, you need to sign a contractand you will receive connection parameters from your provider. Once you got the necessaryparameters you can setup your Ozeki NG SMS Gateway software.

Preconditions for wireless (GSM modem) connection to the Mobile network

With this type of connection all you need is a GSM modem or a GSM phone and you can joinit easily to your PC with a data cable. The GSM device will be operated by your Ozeki NGSMS Gateway software and it will be able to handle SMS messaging wirelessly. You willneed the following components to use this type of connection:

Figure 1/b - Prerequisites for Ozeki NG SMS Gateway GSM modem connection

System overview

After you checked the system requirements you can take a look at the system overview(Figure 2). The SMS system will work in the following way:Once an error occurs in your IT environment Nagios detects it and generates a report aboutthis malfunction. This generated report will be forwarded to Ozeki NG SMS Gateway with aHTTP request through a shell file. The SMS gateway processes the message and sends out asan SMS text message to a predefined cellphone.

Figure 2 - Sending SMS in Nagios with Ozeki NG SMS Gateway

As it was mentioned above Ozeki NG SMS Gateway forwards messages to the mobilenetwork over GSM modem or IP SMS connection. Please note that GSM modem connectionis highly recommended to be start with as it can be safer than IP SMS connectivity. Later ifyou need to increase capacity you can attach more than one GSM modem to your computer oryou can still switch to IP SMS connection if it is required.

Advantages of sending SMS from Nagios

If you decide to implement this solution you will gain a stable and effective SMS system with

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

2 of 11 02/08/2012 11:01 a.m.

Page 3: How to send alert SMS from Nagios.pdf

several advantages. The most important one is that you can ensure continuous availability.Therefore, the intended person will always be notified if an error occurs in the system. SMSalerts can be forwarded even in cases when the recipient is on the move. In this way, you donot need to check your emails all the time as you will be alerted on your mobile phone. Thissolution does not require internet connectivity to forward SMS notifications and can beimplemented for other SMS solutions beside Nagios. With SMS solution all the problems canbe solved in the right time before they affect your customers and business partners.

How to configure Nagios SMS solution

First I have installed NSClient++ program on the computer to be monitored. The IP address ofthis computer is "192.168.91.144" (Figure 3).

Figure 3 - Monitored computer's IP address

I have also installed Nagios on Fedora Linux, and the IP address of this computer is"192.168.91.124" (Figure 4).

Figure 4 - Nagios computer's IP address

First open "nagios.cfg" file to edit. Start "Terminal" and login as administrator then open"nagios.cfg" file with "vi" editor. To do so type in the follows (Figure 5):

vi /usr/local/nagios/etc/nagios.cfg

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

3 of 11 02/08/2012 11:01 a.m.

Page 4: How to send alert SMS from Nagios.pdf

Figure 5 - Edit Nagios' configuration file

Find the following row:# Definitions for monitoring Windows machinePress "i" to enter Insert mode and in the row below it, delete the comment mark. The final rowwill look like as follows (Figure 6):

cfg_file=/usr/local/nagios/etc/objects/windows.cfg

Then press "Escape" and type the follows to exit and save the file:

:wq

Figure 6 - Remove comment from configuration file

Now open "windows.cfg" file with "vi" editor. You can do this if you type in the followingcommand (Figure 7):

vi /usr/local/nagios/etc/objects/windows.cfg

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

4 of 11 02/08/2012 11:01 a.m.

Page 5: How to send alert SMS from Nagios.pdf

Figure 7 - Edit windows configuration file

Press "i" to enter Insert mode, then find the row beginning with "address". Now type the IPaddress of the computer you wish to monitor. In our example the row will look like as follows(Figure 8):

address 192.168.91.144

Figure 8 - Insert monitored computer's IP address

Then press "Escape" and type the follows to exit and save the file:

:wq

I have already downloaded "sms_send.sh" shell script to the desktop. Now I copy it to"libexec" directory of Nagios (Figure 9):

cp /home/ozekisms/Desktop/sms_send.sh /usr/local/nagios/libexec/

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

5 of 11 02/08/2012 11:01 a.m.

Page 6: How to send alert SMS from Nagios.pdf

Please note that "ozekisms" username is only for test purposes, so provide your usernameinstead of it.

Figure 9 - Copy the shell script

You can customize the "send_sms.sh" if you change "url1". In our example it is customized inthe following way:

#!/bin/bashurl1="http://127.0.0.1:9501/api?action=sendmessage&username=admin&password= abc123&recipient=06203105366&messagetype=SMS:TEXT&messagedata="url2="$@"url2+=$(php -r "echo rawurlencode('$(sed "s/'/\\\\'/g" <<< )');")url=$url1+$url2wget -O- "$url"

You can customize url1 variable in the following way:http://127.0.0.1:9501 is the computer on which Ozeki NG SMS Gateway has been installedusername=admin is the username you use to log into Ozeki NG SMS Gatewaypassword=abc123 is the password of the userrecipient=06203105366 recipient's phone number

Now open "commands.cfg" file with "vi" editor (Figure 10):

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

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

6 of 11 02/08/2012 11:01 a.m.

Page 7: How to send alert SMS from Nagios.pdf

Figure 10 - Edit commands configuration file

Press "i" to enter Insert mode and insert a new row after "notify-service-by-email" and"notify-host-by-email" and provide the following commands (Figure 11):

# 'notify-service-by-sms' command definitiondefine command{command_name notify-service-by-smscommand_line /usr/local/nagios/libexec/sms_send.sh "--NagiosService Notification-- Host: $HOSTNAME$, State: $HOSTSTATE$Service $SERVICEDESC$ Description: $SERVICESTATE$ Time:$LONGDATETIME$"

} # 'notify-host-by-sms' command definitiondefine command{command_name notify-host-by-smscommand_line /usr/local/nagios/libexec/sms_send.sh "--Nagios HostNotification-- Host: $HOSTNAME$, State: $HOSTSTATE$, Time:$LONGDATETIME$"}

Then press "Escape" and type the follows to exit and save the file:

:wq

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

7 of 11 02/08/2012 11:01 a.m.

Page 8: How to send alert SMS from Nagios.pdf

Figure 11 - Notification commands

Open "contacts.cfg" file with "vi" editor (Figure 12):

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

Figure 12 - Edit contacts file

Press "i" to enter Insert mode and insert a new row before the one beginning with "e-mail".Type the follows (Figure 13):

service_notification_commands notify-service-by-smshost_notification_commands notify-host-by-sms

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

8 of 11 02/08/2012 11:01 a.m.

Page 9: How to send alert SMS from Nagios.pdf

Figure 13 - Notification commands for admin

Then press "Escape" and type the follows to exit and save the file:

:wq

Then restart Nagios service to have changes come into operation. Type in the followingcommand (Figure 14):

service nagios restart

Figure 14 - Restart Nagios service

After Nagios has been restarted, start your web browser and type in the follows:

http://localhost/nagios

Login with the default username which has been created during the installation (nagiosadmin),and with your provided password. Now you can see that there is a critical error on themonitored computer. The Explorer service reports this error. You can see at "LastNotification" row that Nagios has already sent the notification (Figure 15).

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

9 of 11 02/08/2012 11:01 a.m.

Page 10: How to send alert SMS from Nagios.pdf

Figure 15 - Critical error in Nagios

If you take a look at Ozeki NG SMS Gateway you can see that the message has been sent out(Figure 16).

Figure 16 - Sent message

Conclusion for Nagios SMS solution

To summarize the above mentioned Nagios with Ozeki NG SMS Gateway is the best solutionif you want to ensure continuous availability. With this solution you will gain a reliable, stableand very effective monitoring system as SMS alerts will be forwarded to the recipient even ifhe is on the move. In this way further problems and harms can be foregone and criticalproblems can be solved before they affect your business processes. It will result inconsiderable time and money savings and you can satisfy your customers and businesspartners in an efficient way furthermore you can attract new ones.

If you have not downloaded Ozeki NG SMS Gateway yet, you can do it right now onthe product page >>>To learn more about the possible network connections, read GSM modem vs IP SMSconnection page >>>Please find how to benefit from implementing SMS solutions in your business on SMSsolutions for businesses page >>>

Request more information

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

10 of 11 02/08/2012 11:01 a.m.

Page 11: How to send alert SMS from Nagios.pdf

If you are interested in this solution, let us know, so we can send you more relevantinformation and quotation with prices. Please fill in the following form:

Your name:

Company:

E-mail:

Tel:

Country:

Message:

Home > Solutions > System Monitoring > Nagios SMS

Feel free to contact us for additional information. Tel: (36) 52 532 731, Fax: (36) 52 532 732, E-mail: info @ ozekisms.comCopyright © 2000 - 2012 Ozeki Informatics Ltd. - All rights reserved.

How to send alert SMS from Nagios http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...

11 of 11 02/08/2012 11:01 a.m.