OK nice, but still can we generate a daily, weekly, monthly report aswell,
so I can see the results on a webpage or something nd also so I can printout
the results easy.
Another idea, how about it adds and updates it on a webpage which I set to
display the results from the server. Would it be very easy to include a text message
to your mobile phone when your site goes down, once your site goes down you
set the amount of time before you would get sent the message for example 5mins
and then it sends out a text .. aslong as your PC's is on. Then if it comes back on you
after you get sent another text message
I found this
Code:
#!/bin/sh
#
# Sample script to send an SMS email notifcation to SMS2Email's HTTP gateways
# Username and password associated with SMS2Email account
# Modify these values to match your account credentials if you don't want to
# specify them as command line arguments.
username=
password=
number=
message="Test message"
# Show usage if necessary
if [ $# -eq 0 ]; then
echo "Usage: $0 -n [number] -m [message] -u [username] -p [password]";
echo "";
echo "[number] = SMS number to send message to";
echo "[message] = Text of message you want to send";
echo "[username] = Username assocated with SMS2Email account";
echo "[password] = Password assocated with SMS2Email account";
echo " Both the username and password options are optional and";
echo " override the account credentials defined in this script.";
echo "";
exit 1;
fi
# Get command line arguments
while [ "$1" != "" ] ; do
case $1
in
-n)
# Get the SMS number that we should send message to
number=$2;
shift 2;
;;
-m)
# Get the message we should send
message=$2;
shift 2;
;;
-u)
# Get the username
username=$2;
shift 2;
;;
-p)
# Get the password
password=$2;
shift 2;
;;
*)
echo "Unknown option: $1"
exit 1;
;;
esac
done
# We haven't sent the message yet
message_sent_ok=0;
# Try to send an HTTP POST message (try all servers until successful)
for server in gw1 gw11 gw2 gw22; do
RESPONSE=`curl -s -d username=$username -d password=$password -d to_num=$number -d message="$message" http://$server.sms2email.com/sms/postmsg.php`
# Curl was able to post okay...
if [ "$?" -eq "0" ]; then
# Test the response from the SMS2Email server
case $RESPONSE
in
AQSMS-OK)
# Message was queued ok
mesage_sent_ok=1;
echo "Message posted OK to HTTP gateway $server"
exit 0;
;;
AQSMS*)
# Some kind of fatal error occurred
echo "Fatal error received from HTTP gateway $server: $RESPONSE"
exit 1;
;;
*)
# No response or invalid response
;;
esac
fi
done
http://$server.sms2email.com/
It is better now though 
__________________
█ Please login or register to view this content. Registration is FREE - Shared / Reseller / Cloud / VPS / Dedicated
█ Multiple Domain Hosting .... 24/7 Technical Support - Please login or register to view this content. Registration is FREE
Last edited by Duport; 11-04-2004 at 09:45 PM..
|