![HW Group HWg-SMS-GW2 Manual Download Page 15](http://html1.mh-extra.com/html/hw-group/hwg-sms-gw2/hwg-sms-gw2_manual_2190405015.webp)
HWg-SMS-GW2 manual
HW group
www.HW-group.com
15
2.2)
Send a test SMS to verify correct operation of the plugin and the HWg-SMS-GW unit. The -H flag
specifies the IP address of the gateway to use for sending the SMS. Use the -D flag to specify the
test message recipient's phone number.
If the plugin fails to start with
the “Can't locate LWP.pm” message, you need to install the Perl LWP
module for HTTP support. In Ubuntu or Debian distributions, this is done with this command:
Configuring Nagios
For basic Nagios configuration, we recommend this document:
http://www.hw-group.com/support/an38/index_en.html
3.1)
To add text message (SMS) support via the notify-poseidon-sms.pl plugin, create a
/etc/nagios3/notify-poseidon-sms.cfg
file with the following contents:
Note: Do not wrap the command_line definition over multiple lines. For the plugin to work correctly,
the entire command_line statement must be on a single line.
Remember to change the -H parameter to the actual IP address (or DNS name) of your HWg-
SMS-GW unit.
The SMS text is composed using the -M parameter. For a list of available variables (macros), see:
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$"
}