5 replies
by mtuppen
I don't know why you want the script exactly, but if you are wanting to keep a track of multiple hosts (ping, services etc) try using a program called big brother. We use it, and it is quite effective. You can get it from bb4.com.
Regards,
Mike
by ocroberts
by mtuppen
If you are after a script, I do have a little script that replies "yes" if the host is pingable, and "no" if it isn't. Of course, you can change the outcomes. I didn't use sed, but I used grep. It expects the host to be the first argument on the command line.
#!/bin/bash
PHST=$1
PVAR=`ping $PHST -c1 -w3 2>/dev/null`
PVAR=`echo $PVAR |grep "from $PHST"`
if [ "$PVAR" ]; then
echo "Yeah"
else
echo "No"
fi
Regards,
Mike
by ocroberts
by ocroberts
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending