Super User is a question and answer site for computer enthusiasts and power users. 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'm running snmpwalk on Linux and saving the output to a file using

snmpwalk -v 2c -c  public >> SNMPWALK_SS

If the value of one parameter is saved to a file with

SNMPv2-SMI::enterprises. = Gauge32: 0

then the name of this value is 82=82,SNMP_PAL_ACTIVE_SESSION,0,1

I want to save the snmpwalk value for a service at each of a list of times that would be read from a file. My final outcome would be like this:

Mon Feb 25 11:35:02 IST 2013

Is there any tool to achieve this task?

share|improve this question

migrated from Feb 25 '13 at 10:24

This question came from our site for professional and enthusiast programmers.

I doubt there is a tool already which does this, but you could write it yourself in python or perl pretty easily. I didn't quite understand your question, did you want to count the number of occurances of SNMP_PAL_ACTIVE_SESSION? Or do you need to do something more complicated like add up the values? Expand your example and explain the logic in English.

This is some bash to get you started

snmpwalk -v 2c -c  public > /tmp/snmpwalk.out
COUNT=`grep -c SNMP_PAL_ACTIVE_SESSION /tmp/snmpwalk.out`
date >> ~/snmp.sessions.log
echo "SNMP_PAL_ACTIVE_SESSION : $COUNT" >> ~/snmp.sessions.log
share|improve this answer

Your Answer


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