Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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

Your Answer

 
discard

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.