0

I am using snmpget in order to get the description of a specific switch port. How could I read each not null value? I.E. do a "for-each" sort of operation on the set of IF-MIB::ifDescr values?

MattUebel
  • 927
  • 4
  • 13
  • 32

1 Answers1

1

You want to use the snmpwalk command for this, this goes over all items below the one you specify in the MIB tree.

I don't have anything to query, but you could read each line and filter on the text with something sort of like the following in the shell:

while read line; do
   if $(echo $line | grep NULL); then
      echo $line
   fi
done < <(snmpwalk -Os -c public -v 1 zeus system)
Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448