Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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
done < <(snmpwalk -Os -c public -v 1 zeus system)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.