Forum Discussion
Ofir_73471
Nimbostratus
Jun 06, 2009Assistance with writing an External Monitor
Hi,
I need to sample my servers by sending a UDP packet and if i am getting an answer meaning the server is up .
i have used netcat and it works but i dnot know how to write the script and use the External monitor , i appriciate of anyone can help
the command which i used :
nc -w -u -w 3 -o /root/x-reply.hex 1.1.1.1 29000 < /root/x.hex
now 1.1.1.1 is just one ip from 10 serevrs
Thanks
- hwidjaja_37598
Altostratus
Try this:!/bin/sh Adopted from /usr/bin/monitors/sample_monitor pidfile="/var/run/pinger.$1..$2.pid" if [ -f $pidfile ] then kill -9 `cat $pidfile` > /dev/null 2>&1 fi echo "$$" > $pidfile node_ip=`echo $1 | sed 's/::ffff://'` nc -w -u -w 3 -o /root/x-reply.hex $node_ip $2 < /root/x.hex > /dev/null status=$? if [ $status -eq 0 ] then echo "up" fi rm -f $pidfile
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects