|
Softwares ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Main /
Ping-alert-bash-script-for-server-monitoringMain.Ping-alert-bash-script-for-server-monitoring HistoryHide 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 |