start documenting switch replacement
[dell-switch] / sw-failed.sh
1 #!/bin/sh -xe
2
3 # Current status of the product.This is a rollup for the entire product.
4 # https://www.dell.com/community/Networking-General/SNMP-monitoring-on-PowerConnect-5448/td-p/3635681
5
6 # FIXME doesn't report failed fans correctly!
7
8 . ./snmp.conf
9 ./sw-names | xargs -i sh -c "echo -n '{} ' ; snmpget -v 2c -c $COMMUNITY -Cf -Ov -OQ {} 1.3.6.1.4.1.674.10895.3000.1.2.110.1.0 2>/dev/null" | sed --unbuffered -e 's/ 3$/ OK/' -e 's/ 4$/ Non-critical/' -e 's/ 5$/ Critical/' | tee /dev/shm/sw-failed