HWg-SMS-GW3 manual
HW group
www.HW-group.com
17
2.2)
Send a test SMS to verify the functions of the plug-in and HWg-SMS-GW. Parametr -H specifies
an IP addresuś of the HWg-SMS-GW device designated for sending the SMS messages. Enter the
recipients phone number for receiving the message using the -D parameter.
In case the plug-in start fails and an error message shows Can't locate LWP.pm, it is necessary to
install a Perl module LWP for HTTP protocol support. This can be done on Ubuntu or Debian by a
command:
Nagios settings
Document recommended for basic Nagios setup:
http://www.hw-group.com/support/an38/index_cz.html
3.1)
A support for sending SMS messages with the notify-poseidon-sms.pl plug-in can be added by
creating a file
/etc/nagios3/notify-poseidon-sms.cfg
:
Note: The whole command_line definition text has to be in one line in order to work correctly.
Note, do not forget to change the -H parameter to an actual IP address (eventually to a DNS
name) of your HWg-SMS-GW device.
SMS text is assembled by the -M parameter. A list of supported variables (macros) can be found on
http://nagios.sourceforge.net/docs/3_0/macrolist.html
nagios-server:~#
cd /usr/lib/nagios
nagios-server:~#
./notify-poseidon-sms.pl -M "Test message" -H 192.168.1.1 -D +420777888999
nagios-server:~#
apt-get install libio-all-lwp-perl
define command {
command_name notify-host-by-sms
command_line /usr/bin/perl /usr/lib/nagios/notify-poseidon-sms.pl
-H 192.168.1.1
-D
$CONTACTPAGER$ -M
"
$HOSTALIAS$ $HOSTOUTPUT$
"
}
define command {
command_name notify-service-by-sms
command_line /usr/bin/perl /usr/lib/nagios/notify-poseidon-sms.pl
-H 192.168.1.1
-D
$CONTACTPAGER$ -M "$HOSTALIAS$ $SERVICEOUTPUT$"
}