Recent Changes - Search:

Softwares

.

Server-monitoring-using-ping-and-bash

Main.Server-monitoring-using-ping-and-bash History

Hide minor edits - Show changes to output

Added lines 1-11:
%blue%This script monitors that server host names or IP address in hostlist and send messages to the server admins.

#!/bin/bash
cat hostlist |\
while read line
do
pingcount=$(ping -c 1 $line |grep received|awk -F',' '{print $2}'|awk '{print $1}')
if [ $pingcount -eq 0 ]; then
/usr/bin/wall "$line is unreachable, please check and reboot"
fi
done
Edit - History - Print - Recent Changes - Search
Page last modified on September 19, 2007, at 12:31 AM