projects
/
dell-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c212655
)
display switch name for port
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 11 Apr 2018 17:00:17 +0000
(19:00 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 11 Apr 2018 17:00:17 +0000
(19:00 +0200)
snmp-port-status.sh
patch
|
blob
|
history
diff --git
a/snmp-port-status.sh
b/snmp-port-status.sh
index
158917b
..
022bd8b
100755
(executable)
--- a/
snmp-port-status.sh
+++ b/
snmp-port-status.sh
@@
-19,7
+19,8
@@
numports=`$snmp IF-MIB::ifNumber.0`
:> $log/$sw
for i in `seq 1 $numports`; do
- name=`$snmp IF-MIB::ifAlias.$i`
+ name=`$snmp IF-MIB::ifName.$i`
+ alias=`$snmp IF-MIB::ifAlias.$i`
if [ "$name" = "No Such Instance currently exists at this OID" ]; then
continue
fi
@@
-39,6
+40,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
]" | tee -a $log/$sw
+ echo "$sw $i $
name $speed $status [$alias
]" | tee -a $log/$sw
done