#!/bin/ksh
#This script will check status of load balancer in AIX servers from hopbox
#Steps to do as folows :
#Login to server
#netstat -ani | grep <IP>
#check if the output contains either lo0 OR en0
#if the above condition matches, validation looks good
#else, send an email with impacted server names
file="/export/home/vinil/scripts/LB_check/server.txt"
while read line
do
ssh -t -t <IP_address_of_server>|v1=`netstat -ani|grep $IP|awk '{print $1}`;
if [ v1 -eq lo0 -o v1 -eq en0 ]; then
echo $v1
echo LB is running on host $host>>log.txt;
else
echo "LB is not working ">>log.txt ;
fi
done <$file
The highlighted line is not working as expected. Please correct and let me know any modifications needed.
Thanks
I will try this for you and post the update. Meanwhile, please note that the variable mentioned ($IP and $IP_2)are different server names used in production for client.I have already defined their values in script.
Failed again. Can some one correct me or provide me better code that can check particular on specific server and print if the IP is associated with lo0 or en0 (these are LB components )
Thanks
---------- Post updated 04-21-14 at 10:46 AM ---------- Previous update was 04-20-14 at 04:31 PM ----------