Salam,
This is a script I made just to check if remote PC is ON or OFF, then it can take specific action according to your requirement.
Either Alert you using Echo, EMAIL or SMS. You can modify it according to your need, Below script will send sms
A=`nmap -sP $1 |grep "Nmap done" | awk '{print $6}' | sed "s/(//" | sed "s/1/5/" | sed "s/0/1/"` B=`echo $A` if [ "$B" == "5" ]; then echo "PC is working fine. no need to send SMS" else # echo "DOWN" echo "POTUS ALERT: PC Down. Please check SERVER Room / zaib " | gnokii --sendsms 03002357367 echo "POTUS ALERT: PC Down. Please check SERVER Room / zaib " | gnokii --sendsms 03333021909 #echo $B #echo PC Down. fi
==================================================
This is a gnooki config file I modified according to my setup.
I used NOKIA 9300i Communicator mobile.
[global] port = /dev/ttyACM0 model = 6230 initlength = default connection = dku2libusb use_locking = no serial_baudrate = 19200 smsc_timeout = 10 [xgnokii] allow_breakage = 0 TELEPHONE = 03333021909 debug = on rlpdebug = off xdebug = off [phone_fake] port = foobar model = fake connection = serial
SCRIPT TO CHECK SQUID STATUS AND START IT IF REQUIRED.
Following script will check SQUID service status , and if it found squid stop, it will start it auto, if the squid is already running , it will do nothing 🙂
"s/1/5/" | sed "s/0/1/"` A=`service squid status | awk '{print $3}' | sed "s/process/5/"` B=`echo $A` if [ "$B" == "5" ]; then echo "SQUID is working fine. Zaib" else # echo "DOWN" echo "SQUID Down, starting SQUID" service squid start fi
You can create its cron entry to run it after every 5 minutes.
For example, add it using CRON by following
crontab -e
and add following line
*/5 * * * * /etc/checksquid.sh
Now save and exit.
do u have any script to use with any api like clickatell and takes the expired dates of the radius database and sents the users a sms 5 days before their account has expired .
will u do it in the far future if not …
Wish u all the best
LikeLike
Comment by Nori — January 1, 2012 @ 11:21 PM
Hmm I guess you are using Mikrotik’s base User Manager , If YES, there are limited chances that it will work.
I will test it and let you know when I will get time, currently busy in few projects.
3rd party RADIUS supports this function that they send Alert for accounts whose expiry is near. For example DMASOFTLAB RM. I am using the same.
LikeLike
Comment by Syed Jahanzaib / Pinochio~:) — January 2, 2012 @ 10:02 AM