Net-SNMP example subagent
How to write an AgentX based extension to Net-SNMP in C with CMake as build system.
It was hard to find any working examples which do not make extensive use of magic code generators, outdated wiki pages, complicated code not needed for a simple example, …
There's no install. You have to compile the source by yourself. This mini project uses CMake for build. You can use all kinds of CMake GUIs, do what your preferred style is. A simple way to build on command line, starting in the source directory, would be:
mkdir -p build cd build cmake .. make
Note: You can change the AgentX master socket to be connected to by
changing the CMake variable
VE_AGENTX_MASTER_SOCKET, there's no config
file or command line argument for that. (Remember: this is just a simple
example, that would not be focus of this project.)
You need Net-SNMP library headers. On Debian based systems you get those
There's nothing special about using this. Start the binary from your CMake build folder.