shell - Testing multiple unix server Connectivity using ping command and send mail the hostname/ipaddress of the servers if any hosts are unreachable -
shell - Testing multiple unix server Connectivity using ping command and send mail the hostname/ipaddress of the servers if any hosts are unreachable -
testing multiple unix server connectivity using ping command , send mail service hostname/ip-address of servers if hosts unreachable
there file host.txt contain list of servers want ping e.g
www.abc.domain01.com www.abc.domain02.com www.abc.domain03.com www.abc.domain04.com in case i'm considering there total 4 servers ; can 100 servers know how check connectivity of multiple servers don't know how mail service if particular server(s) unreachable code
email=xxxxxxxxxxxxx@domain.com in $(cat host.txt) ping -c4 $i if [ $? -ne 0 ] echo "$i unreachable"|mail -s "ping alert" $email fi done suppose server www.abc.domain01.com unreachable want see output in mail service www.abc.domain01.com
shell unix
Comments
Post a Comment