![](https://seccdn.libravatar.org/avatar/4d8530562813a13b5f5de8c9bcbbaea8.jpg?s=120&d=mm&r=g)
Hey Linux Gurus! I´m kinda new in this, but i am trying my best and i think i am making good improvements. I wrote that "PingPong" script and i thought that i might be a nice tool. It calls you when one of your servers/hosts are down. I can even ping 10 different host with it, and i will alway get the message to my mobile phone. All u need is a ISDN Card ;) What do you think? It might be a poor coding style, but HEY, it works ;) Regards Spiekey ============================================================================== #!/bin/sh egal=1 #internal/test #Tel_nr="53" Tel_nr="xxx1xx9x3xxx6xx7" var_xxserver=-4 # well, i needed a loop so i made one up which will never come ;P until [ $egal = 2 ]; do ############## 192.168.10.1 ################## if ping -c 3 -w 10 -s 1 -i 30 192.168.x.x 1> /dev/null 2> /dev/null ; then echo "`date` it's ping 192.168.x.x (xxserver)" # don´t flood my logs sleep 60 else var_xxserver=$[var_xxserver+4] var_timer_xxserver=$[var_xxserver * 60] sleep $var_timer_xxserver if ping -c 3 -w 10 -s 1 -i 30 192.168.x.xx 1> /dev/null 2> /dev/null ; then echo "`date` it's ping 192.168.xx.x (xxserver)" else echo "`date` =====> Server is down, lets call the admin, hehe. I was sleeping for $var_timer_xxserver" # try to call my mobile until u get thought ot the device is free i=1; until [ $i = 2 ]; do if /usr/local/tools/ivcall/ivcall 98 $Tel_nr < /usr/local/tools/ivcall/xxserver.wav > /dev/null then i=$[$i+1] fi done sleep 10 fi fi done exit ==============================================================================
![](https://seccdn.libravatar.org/avatar/ab080368269831f32fa9ba117003dad7.jpg?s=120&d=mm&r=g)
Very *nice* Do you think you could modify it so that it will ring you and tell you when you've been hacked? Or how about an X.509 authentication module so that you can securely tell the script to bring the server up/down? An SMS interface would be really cool... no need for an ISDN card, work through a free SMS provider on the net........ via SSL of course (this is a security list) ;-) p.s. I'm sorry for the OT response, its friday afternoon and I've nothing better to do (except a kernel upgrade, thanks Roman & all at SUSE Sec.) On Friday 26 October 2001 16:21, spiekey wrote:
Hey Linux Gurus! I´m kinda new in this, but i am trying my best and i think i am making good improvements. I wrote that "PingPong" script and i thought that i might be a nice tool. It calls you when one of your servers/hosts are down. I can even ping 10 different host with it, and i will alway get the message to my mobile phone. All u need is a ISDN Card ;) What do you think? It might be a poor coding style, but HEY, it works ;)
Regards Spiekey
=========================================================================== === #!/bin/sh egal=1
#internal/test #Tel_nr="53" Tel_nr="xxx1xx9x3xxx6xx7"
var_xxserver=-4
# well, i needed a loop so i made one up which will never come ;P until [ $egal = 2 ]; do
############## 192.168.10.1 ################## if ping -c 3 -w 10 -s 1 -i 30 192.168.x.x 1> /dev/null 2> /dev/null ; then echo "`date` it's ping 192.168.x.x (xxserver)" # don´t flood my logs sleep 60 else
var_xxserver=$[var_xxserver+4] var_timer_xxserver=$[var_xxserver * 60] sleep $var_timer_xxserver
if ping -c 3 -w 10 -s 1 -i 30 192.168.x.xx 1> /dev/null 2> /dev/null ; then echo "`date` it's ping 192.168.xx.x (xxserver)" else
echo "`date` =====> Server is down, lets call the admin, hehe. I was sleeping for $var_timer_xxserver"
# try to call my mobile until u get thought ot the device is free i=1; until [ $i = 2 ]; do if /usr/local/tools/ivcall/ivcall 98 $Tel_nr < /usr/local/tools/ivcall/xxserver.wav > /dev/null then i=$[$i+1] fi done sleep 10
fi fi done
exit
=========================================================================== ===
---------------------------------------- Content-Type: text/html; charset="iso-8859-1"; name="Attachment: 1" Content-Transfer-Encoding: quoted-printable Content-Description: ----------------------------------------
![](https://seccdn.libravatar.org/avatar/360c89473e19c7f8c9fe5ca60e12f8ce.jpg?s=120&d=mm&r=g)
* spiekey wrote on Fri, Oct 26, 2001 at 17:21 +0200:
Hey Linux Gurus! I wrote that "PingPong" script and i thought that i might be a nice tool. It calls you when one of your servers/hosts are down.
You may wish to check out netsaint - the network monitor. It can do ping tests among of a lot of others. It sends mail (or executes any other command) in case of errors. Highly configurable. For some servers, I set up SNMP and can monitor disk space and so on and get notifications on high load. Netsaint has a really nice Web frontend. Give it a try. The url may be http://netsaint.sourceforge.net/. If not, search on sf.net :) oki, Steffen -- Dieses Schreiben wurde maschinell erstellt, es trägt daher weder Unterschrift noch Siegel.
participants (3)
-
spiekey
-
Steffen Dettmer
-
tech@codefoundry.com