Search code examples
c++linuxsnmp

SNMP support on Linux


I'm looking for a way in C/C++ code in Linux to make my device capable of being an SNMP manager as well as an agent. I can implement the manager/agent logic my self in code. But I guess that's reinvention of the wheel?

Is there any intrinsic support of SNMP(manager and agent) implementation in the TCP/IP stack of Linux? Do I need install any packet first? And is it different among Linux distributions?


Solution

  • Yes, it would indeed be reinventing the wheel.

    There are numerous different SNMP manager applications available, both freeware and commercial. A web search should reveal some options. I don't want to recommend one over the other, since your requirements are very non-specific. (And "recommend me a..." questions are discouraged on StackOverflow anyway.)

    If you want to implement an SNMP agent on a Linux host, your simplest options is probably to install the net-snmp package. It contains a complete SNMP agent, as well as libraries and headers for building your own manager in C, if you should so desire. It's available for all major Linux distributions, and has pretty good documentation.