bash script – 透過SNMP檢查VMWare Host NTP同步狀態

#!/bin/bash

for i in 18 19 21 22 23 24 25 26 27 28 29 30 31 32
do
  echo -n "  UCS:`printf %03d $i` "
  snmpwalk -c public -v 2c -Ov 172.24.2.$i hrSystemDate.0
done

for j in 2 3 4 5 6 7 8 18 19 20 21 22 23 24 34 35 36 37 38 39 40 50 51 52 53
do
  echo -n "Blade:`printf %03d $j` "
  snmpwalk -c public -v 2c -Ov 172.24.18.$j hrSystemDate.0
done

for k in {9..15} {25..31} {41..48} 54 {55..56}
do
  echo -n "Blade:`printf %03d $k` "
  snmpwalk -c public -v 2c -Ov 172.24.18.$k hrSystemDate.0
done

 

Facebook Comments Box

Leave a Reply