2017-01-25 22:30:16 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source scan-netdev
|
|
|
|
|
2017-02-08 21:15:43 -06:00
|
|
|
MY_DATE=`date +%Y-%m-%d_%H-%M-%S`
|
|
|
|
stat-bonding out > $OUTPUT_DIR/bonding.out
|
|
|
|
echo -n "START: " > $OUTPUT_DIR/ping.out
|
|
|
|
date >> $OUTPUT_DIR/ping.out
|
2017-01-25 22:30:16 -06:00
|
|
|
for VLAN in {401..408} ; do
|
|
|
|
if [[ -f /etc/netdev/vlan.$VLAN.csv ]] ; then
|
2017-02-08 21:15:43 -06:00
|
|
|
VLAN_CONF=`cat /etc/netdev/vlan.$VLAN.csv \
|
|
|
|
| sed 's/#.*$//' \
|
|
|
|
| grep $SERVER_SERIAL `
|
2017-01-25 22:30:16 -06:00
|
|
|
fi
|
|
|
|
if [[ -z $VLAN_CONF ]] ; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
IP_LIST=`cat /etc/netdev/vlan.$VLAN.csv \
|
2017-02-02 17:41:36 -06:00
|
|
|
| sed 's/#.*$//' \
|
2017-01-25 22:30:16 -06:00
|
|
|
| cut -d ',' -f 3 \
|
|
|
|
| grep '^[0-9]' | sort`
|
|
|
|
for IP in $IP_LIST; do
|
2017-02-08 21:15:43 -06:00
|
|
|
echo -n "$IP - " \
|
|
|
|
| tee -a $OUTPUT_DIR/ping.out
|
|
|
|
ping -c100 -W1 -f $IP \
|
|
|
|
| grep 'received' \
|
|
|
|
| tee -a $OUTPUT_DIR/ping.out
|
2017-01-25 22:30:16 -06:00
|
|
|
done
|
|
|
|
done
|
2017-02-08 21:15:43 -06:00
|
|
|
echo -n "END: " >> $OUTPUT_DIR/ping.out
|
|
|
|
date >> $OUTPUT_DIR/ping.out
|
|
|
|
cp -vf $OUTPUT_DIR/ping.out $OUTPUT_DIR/ping-$MY_DATE.out
|
|
|
|
cp -vf $OUTPUT_DIR/bonding.out $OUTPUT_DIR/bonding-$MY_DATE.out
|
2017-01-25 22:30:16 -06:00
|
|
|
|