Professional Documents
Culture Documents
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
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
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: Video: Send SMS from Nagios via SMS gateway (part 1/2, configure your modem) Send SMS from Nagios (part 2/2, configure your system)
Contact Us!
If you wish to get further information, do not hesitate to contact us! E-mail: info@sms-integration.com
Useful information
How to send SMS with a GSM modem attached to your PC?
Preconditions
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
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
1 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
To establish the connection between your system and an SMS service provider via the Internet, you will need these devices:
If you wish to send more then 4000 SMS per day, it is a good idea to use an Internet SMS service provider. Read more: Prerequisites Setup instructions
With this type of connection you will need an SMS service provider who provides access to its services and ensures Internet based SMS services. On our webpage we have collected some providers to help you in your decision: SMPP SMS Service providers. After you have decided which provider and which service is the most appropriate for you, you need to sign a contract and you will receive connection parameters from your provider. Once you got the necessary parameters 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 join it easily to your PC with a data cable. The GSM device will be operated by your Ozeki NG SMS Gateway software and it will be able to handle SMS messaging wirelessly. You will need 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 about this malfunction. This generated report will be forwarded to Ozeki NG SMS Gateway with a HTTP request through a shell file. The SMS gateway processes the message and sends out as an SMS text message to a predefined cellphone.
As it was mentioned above Ozeki NG SMS Gateway forwards messages to the mobile network over GSM modem or IP SMS connection. Please note that GSM modem connection is highly recommended to be start with as it can be safer than IP SMS connectivity. Later if you need to increase capacity you can attach more than one GSM modem to your computer or you can still switch to IP SMS connection if it is required.
2 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
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. SMS alerts can be forwarded even in cases when the recipient is on the move. In this way, you do not need to check your emails all the time as you will be alerted on your mobile phone. This solution does not require internet connectivity to forward SMS notifications and can be implemented for other SMS solutions beside Nagios. With SMS solution all the problems can be solved in the right time before they affect your customers and business partners.
I have also installed Nagios on Fedora Linux, and the IP address of this computer is "192.168.91.124" (Figure 4).
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
3 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
Find the following row: # Definitions for monitoring Windows machine Press "i" to enter Insert mode and in the row below it, delete the comment mark. The final row will 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
Now open "windows.cfg" file with "vi" editor. You can do this if you type in the following command (Figure 7): vi /usr/local/nagios/etc/objects/windows.cfg
4 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
Press "i" to enter Insert mode, then find the row beginning with "address". Now type the IP address of the computer you wish to monitor. In our example the row will look like as follows (Figure 8): address 192.168.91.144
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/
5 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
Please note that "ozekisms" username is only for test purposes, so provide your username instead of it.
You can customize the "send_sms.sh" if you change "url1". In our example it is customized in the following way: #!/bin/bash url1="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+$url2 wget -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 installed username=admin is the username you use to log into Ozeki NG SMS Gateway password=abc123 is the password of the user recipient=06203105366 recipient's phone number Now open "commands.cfg" file with "vi" editor (Figure 10): vi /usr/local/nagios/etc/objects/commands.cfg
6 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
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 definition define command{ command_name notify-service-by-sms command_line /usr/local/nagios/libexec/sms_send.sh "--Nagios Service Notification-- Host: $HOSTNAME$, State: $HOSTSTATE$ Service $SERVICEDESC$ Description: $SERVICESTATE$ Time: $LONGDATETIME$" } # 'notify-host-by-sms' command definition define command{ command_name notify-host-by-sms command_line /usr/local/nagios/libexec/sms_send.sh "--Nagios Host Notification-- Host: $HOSTNAME$, State: $HOSTSTATE$, Time: $LONGDATETIME$" } Then press "Escape" and type the follows to exit and save the file: :wq
7 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
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-sms host_notification_commands notify-host-by-sms
8 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
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 following command (Figure 14): service nagios restart
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 the monitored computer. The Explorer service reports this error. You can see at "Last Notification" row that Nagios has already sent the notification (Figure 15).
9 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
If you take a look at Ozeki NG SMS Gateway you can see that the message has been sent out (Figure 16).
10 of 11
http://www.sms-integration.com/how-to-send-alert-sms-from-nagios-1...
If you are interested in this solution, let us know, so we can send you more relevant information and quotation with prices. Please fill in the following form:
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.com Copyright 2000 - 2012 Ozeki Informatics Ltd. - All rights reserved.
11 of 11