Hi,

  It appears that "pass_persist" support for integer64 and counter64 is
  broken in: net-snmp-5.5 and net-snmp-5.6.1 even though there is code
  to support 64 bit values in pass_persist.c

  Here is my test case:

    Add the following line to: /usr/local/share/snmp/snmpd.conf

       pass_persist .1.3.6.1.4.1.22222.42 /tmp/pptest.sh

    Create/copy the following file to /tmp/pptest.sh
    chmod a+x /tmp/pptest.sh

#!/bin/bash
# pass_persist handler

while true; do
  read command
  if [ "$command" == "PING" ]; then
    echo "PONG"
    continue
  fi
  read oid
  if [ "$oid" == ".1.3.6.1.4.1.22222.42.1.0" ]; then
    echo $oid
    echo integer
    echo 123456
  elif [ "$oid" == ".1.3.6.1.4.1.22222.42.2.0" ]; then
    echo $oid
    echo integer64
    echo 123456
  elif [ "$oid" == ".1.3.6.1.4.1.22222.42.3.0" ]; then
    echo $oid
    echo counter
    echo 123456
  elif [ "$oid" == ".1.3.6.1.4.1.22222.42.4.0" ]; then
    echo $oid
    echo counter64
    echo 123456
  else
    echo "NONE"
  fi
done

  Restart snmpd

  Test with:

     snmpget -v1 -cpublic localhost .1.3.6.1.4.1.22222.42.1.0
     snmpget -v1 -cpublic localhost .1.3.6.1.4.1.22222.42.2.0
     snmpget -v1 -cpublic localhost .1.3.6.1.4.1.22222.42.3.0
     snmpget -v1 -cpublic localhost .1.3.6.1.4.1.22222.42.4.0

  Works for:
     .1.3.6.1.4.1.22222.42.1.0
     .1.3.6.1.4.1.22222.42.3.0
  Fails for:
     .1.3.6.1.4.1.22222.42.2.0
     .1.3.6.1.4.1.22222.42.4.0

  I have traced the code to these sections in pass_persist.c:

                else if (!strncasecmp(buf, "integer64", 9)) {

                else if (!strncasecmp(buf, "counter64", 9)) {

  and it appears to be getting there and doing the correct thing...

  I have looked in the archives and not found anything...
  Thought I would ask if this is a known problem before looking further...

Thanks,
Kert



------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to