tags:

views:

226

answers:

1

I am having trouble with a few of the variables that the Net-SNMP library provides, specifically the ability to capture in/out Octets.

In/OutOctets Issue: I have another check for ASN_INTEGER and I am catching this oid put the output does not seem to be correct. I am using *vars->val.integer and pushing this into a long but I am currently getting negative numbers so I have tried to push this into a double but the output is a completely different value from that of the actual value attached to that oid.

Has anyone else had this issues and if so can you provide some insight please?

Thanks in advance.

A: 

I have partially resolved this issue by using ASN_COUNTER instead of ASN_INTEGER. Although a counter32 is in fact an integer it is a type of ASN_COUNTER. So using a check of ASN_COUNTER with *vars->val.integer is in fact the correct method to catch a counter32.

aHunter