SMS Server

Taking care of your Linux box.
eternal peace
Posts: 86
Joined: Thu Apr 03, 2003 6:44 pm

Postby eternal peace » Wed Oct 22, 2008 5:23 pm

Nothing special in script i've used only wget to send message through http request, script takes two arguments the message to send and mobile number,

Code: Select all


mesg=$( echo $1 | sed -e 's/ /%20/g' )         //replacing white spaces with %20

wget --spider wget --spider$2\&login_name=xxxx\&password=xxxxx\&message="$mesg"

Save the script ( in your Nagios plugins directory, then in Nagios commands.cfg file add,

Code: Select all

# 'host-notify-by-sms' command definition
define command{
        command_name    host-notify-by-sms
        command_line    $USER1$/ "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$

and then in Nagios contacts.cfg use the above command with the "host_notification_commands" directive as,

Code: Select all

define contact{
        contact_name                    xxxx
        alias                           xxxx
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,r,w
        host_notification_options       d,r
        service_notification_commands   notify-by-email,notify-by-sms
        host_notification_commands      host-notify-by-email,host-notify-by-sms
        pager                           00923001234567

Note: I've used the pager number as mobile number.
hail to linux!!!

Return to “Administration”

Who is online

Users browsing this forum: No registered users and 1 guest