projects
/
dell-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a97e47
)
generate files in /dev/shm/port-status/
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 11 Apr 2018 14:28:55 +0000
(16:28 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 11 Apr 2018 14:28:55 +0000
(16:28 +0200)
snmp-port-status.sh
patch
|
blob
|
history
diff --git
a/snmp-port-status.sh
b/snmp-port-status.sh
index
04c0b56
..
158917b
100755
(executable)
--- a/
snmp-port-status.sh
+++ b/
snmp-port-status.sh
@@
-8,11
+8,15
@@
if [ -z "$1" ]; then
exit 4
fi
+log=/dev/shm/port-status/
+test -d $log || mkdir $log
+
sw="$1"
. ./snmp.conf
snmp="snmpget -v 2c -c $COMMUNITY -Cf -Ov -OQ $sw"
numports=`$snmp IF-MIB::ifNumber.0`
+:> $log/$sw
for i in `seq 1 $numports`; do
name=`$snmp IF-MIB::ifAlias.$i`
@@
-35,6
+39,6
@@
for i in `seq 1 $numports`; do
speed=`$snmp IF-MIB::ifSpeed.$i | sed 's/000000//'`
# echo "## $sw [$name] $iftype $status $descr $speed"
- echo "$sw $i $speed $status [$name]"
+ echo "$sw $i $speed $status [$name]"
| tee -a $log/$sw
done