Multitech MultiModem iSMS SF100-G Manual de usuario Pagina 3

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 5
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 2
Physical Location of iSMS
I wanted the iSMS and the Nagios server to be able to send
messages for as long as possible if there were a problem with
network connectivity or power. In my situation, this meant
locating the iSMS, the Nagios server and their shared Ethernet
switch all in the same computer room and plugged in to the
same redundant UPS. Of course, I could eliminate the switch
from this configuration by using an Ethernet crossover cable
to link the iSMS and the Nagios server directly, but that
would limit communication to the one server. It also would
eliminate most of the advantages over the hard-wired
GSM modems that I was trying to improve upon.
The smsfinder Perl Script
The Perl script can be found on the MonitoringExchange site
(www.monitoringexchange.org) or the Nagios Wiki
(www.nagioswiki.org). Searching for “smsfinder” should get
you to the correct place. The documentation for the script
includes installation instructions, example Nagios configuration
files and screenshots of the iSMS Web user interface. The
author used an interesting approach to create a single script
that serves three different purposes. The script checks to see
which filename was used to call the script and then performs
a completely different function depending on which name was
used. The script has three names:
I smssend.pl: a Nagios “command” used to send messages
about hosts and services via SMS.
I smsack.cgi: a CGI script used by the iSMS to acknowledge
alerts it has received via an SMS message sent by a
mobile phone.
I check_smsfinder.pl: a typical Nagios “plugin” or “check”
script invoked by Nagios on a scheduled basis to monitor
the health of the iSMS device itself.
Script Installation
I stored the actual script as /usr/local/nagios/smsack/smsack.cgi and
made two symbolic links to it with the following names/paths:
I /usr/local/nagios/smsack/sendsms.pl
I /usr/local/nagios/libexec/check_smsfinder.pl
Apache will want to execute an actual file as a CGI, while
Nagios will not care about the symbolic links. Figure 2 provides
an overview of how the script interacts with the other compo-
nents of the system.
The least complex use of the script is when it is called
check_smsfinder.pl. Nagios runs this check script at scheduled
intervals, and the script queries a status page on the iSMS via
HTTP to make sure it is running okay. The script returns the
exit status back to Nagios. The performance data includes
the signal level for the GSM modem, the model number
and the firmware version.
The next use of the script is when it is called as sendsms.pl
by Nagios. In this form, it is used to send host and service
alerts and acknowledgements to the iSMS for delivery to
mobile users. The script uses the “HTTP Send API” to request
that it transmit the SMS message. The iSMS queues the
request and returns a message ID. The end user can query the
iSMS with the message ID to find out if the SMS message was
sent successfully or failed for some reason. When invoked as
sendsms.pl, the script has a --noma option, which will query
the iSMS after queuing the message to get its status. This
takes slightly longer to execute, as the script has to wait for
confirmation that the message actually was sent (or failed).
The documentation refers to “NoMa” but does not explain
why the option was named that way.
The most complicated use of the script is when it runs as the
smsack.cgi CGI script under Apache. The recipient of an SMS
alert can send the entire message back to the iSMS with the
string “ACK” or “OK” prepended to the message text. When
this SMS message is received by the iSMS, it uses the “HTTP
Receive API” to call the smsack.cgi CGI script with the ACK
message. The smsack.cgi CGI script parses the message text,
determines whether it is a host or service being acknowledged,
verifies that the sender’s phone number is in the Nagios object
cache and then uses
the Nagios “external
command” interface to
signal Nagios. Nagios
then tries to match the
host or service name
with one it knows
about, and if this
match is successful,
it acknowledges the
problem. The script also
creates a note on the
host or service page
indicating that the
problem was acknowl-
edged by the sender’s
mobile number.
The acknowledge
feature expects the
entire SMS alert mes-
sage to be sent back
to the iSMS with the
4 | march 2010 www.linuxjournal.com
FEATURE Using an SMS Server to Provide a Robust Alerting Service for Nagios
To read more Linux Journal or start your subscription, please visit http://www.linuxjournal.com.
smsnder.log
check_smsnder.pl
sendsms.pl
smsack.cgi
Nagios
Nagios.log
Logging activity
MultiModem
iSMS
Logging activity
Internal or syslog
Mobile Phone
Apache
access_log
error_log
Logging activity
Logging activity
Figure 2. SMSFinder Method of Operation
Figure 3. Apple iPhone Screenshot
Vista de pagina 2
1 2 3 4 5

Comentarios a estos manuales

Sin comentarios