From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ag. System Administrator" Subject: Re: SMS as server infos Date: Tue, 27 Jul 2004 11:24:19 +0300 Sender: linux-admin-owner@vger.kernel.org Message-ID: <41061133.90304@gambling.org> References: <200406231841.05090.fluca1978@virgilio.it> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200406231841.05090.fluca1978@virgilio.it> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: linux-admin@vger.kernel.org Luca Ferrari wrote: > Hi, > did anybody configured a kind of software for getting information about the > server status (raid, disk space, etc.) thru SMS on a mobile phone? If so, > could you tell me which software have you used and how you configured it (or > where I can find some information)? > > Thanks, > Luca > Hi, I hope this reply is not too late... But anyway, here is the solution. (all this is short description, but anyway you have to use /dev/brain ;) Components: 1 Nokia's DLR-3P Cable 1 Nokia 6110i Cell Phone 1 PC with serial port + Linux Instructions: Connect everything as needed, and go to: www.mwiacek.com Download latest gammu from there, compile and install. Read gammu's docs on how to setup it with --smsd option Install Nagios (if you want) or make any other simple monitoring script. Create cgi like this (it's simple and possible buggy - but does his work): ---------------------------- #!/usr/local/bin/perl -w use CGI; sub clear_it($) { my $var = shift; if ($var =~ /[^0-9\+]/g) { print ""; } else { return $var; } } $q = new CGI; my $to = $q->param('to'); my $msg = $q->param('msg'); my $val = $q->param('validity'); print $q->header(-type => 'text/html', -cost => 'Three smackers', -annoyance_level => 'high', -complaints_to => 'some@email.domain.com', -destination => "$to"); $to = &clear_it($to); # SET THESE TO REFLECT YOUR PATHS $inbox = "/var/spool/sms/inbox"; $outbox = "/var/spool/sms/outbox"; $sent = "/var/spool/sms/sent"; $error = "/var/spool/sms/error"; $tmp = "/tmp/OUTA_\+".$to."_$$.txt"; print $q->start_html('Simple Script'); print $q->hr; print "Got: $to $msg $val -> $tmp"; print $q->br; print $q->hr; print $q->end_html; if (! -z $msg) { open (MESS, ">$tmp") || die("Can\'t open $tmp: $?"); print MESS "$msg"; close MESS; `mv $tmp $outbox`; } -------------------- put it in cgi-bin dir on SAME PC where gammu installed and running. then... try this from linux cmd line: /usr/bin/curl -s -S SMS_SCRIPT_URL -d "to=&msg=message_you_want_to_send&validity=max" or just create file with content you want to send in /var/spool/sms/outbox in form of: OUTA_+COUNTRYCELLPHONENUMBER_PRIORITY.txt ( Example: echo "Hehe, it worked" > /var/spool/sms/outbox/OUTA_+97254xxxxxx_01.txt ) and it will be sent asap. Wait for your sms to arrive ;) Hope that helps. Best Regards, ASA