0

If I want to find out network traffic on my Linux Servers using SNMP. I use the ifOutOctets. and ifInOctets. OIDs in an snmpget request. Where do these OIDs get the data from?

I tried looking at the rfc for these OIDs but I'm still none the wiser. https://tools.ietf.org/html/rfc3635#section-3.2.5

1

It depends. For ifOutOctets and ifInOctets, snmpd probably gets them by querying the kernel (either directly via a syscall or perhaps by examining /proc/net/dev).

For other OIDs, it may get them by running an external command to extract and process the data before returning it. e.g. see Extending snmpd using shell scripts for examples.

| improve this answer | |
  • On Ubuntu at least, ifOutOctets and ifInOctets references the data from /proc/net/dev file. This can be verified using strace -p <pid Of SNMP> -e trace=open – lloowen Jul 28 '17 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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