32

What's an easy to use SNMP client library for c++?

Brian R. Bondy
  • 314,085
  • 114
  • 576
  • 619

4 Answers4

21

SNMP++ is also a nice and open source library for C++ developers.

http://www.agentpp.com/api/cpp/snmp_pp.html

sg7
  • 5,365
  • 1
  • 30
  • 39
Lex Li
  • 52,595
  • 8
  • 102
  • 129
  • Easier to use than net-snmp in my opinion... – Chris M. Mar 29 '10 at 09:46
  • looks nice and simple. Is it really? is it robust and reliable? – f4. Apr 06 '10 at 14:45
  • 1
    Why not evaluate it? It's open source so you can feel free to try it out. – Lex Li Apr 07 '10 at 00:56
  • I will. But I'm on a tight schedule and I'd better not lose time with a poor library :) anyway it looks ok for now – f4. Apr 07 '10 at 09:59
  • AES 192 encryption failed for me using this library – Antarus Jun 23 '14 at 09:10
  • 1
    There exists at least two different AES192 implementations: 1. That one that was defined in a IETF draft. That has been originally implemented by SNMP++ (https://agentpp.com) and SNMP4J. 2. An implementation that was part of many Cisco devices which used a different algorithm than in the IETF draft. Most likely Antarus tested with a Cisco device. The second AES192 implementation is now also available in SNMP++ and SNMP4J. – ooSNMP Oct 05 '15 at 20:12
12

Probably the best choice is net-snmp. Note that the library has "C" linkage but will work just fine with C++.

Jon Trauntvein
  • 4,131
  • 6
  • 37
  • 65
5

I have found that Net-SNMP does not support multi-threading with v3 type queries. So if you are writing an SNMP monitoring tool that will be polling multiple hosts then you will need to take this into consideration.

initzero
  • 782
  • 9
  • 12
1

OpenSNMP contains a complete multi-threaded implementation of SNMPv3 that is done in C++ (complete with classes, etc). It's not heavily used and maintained though.

Net-SNMP with v3 over TLS/DTLS is likely to be threadsafe as it's really SNMPv3/USM that contains threading issues. I think.

KayEss
  • 2,210
  • 14
  • 31
Wes Hardaker
  • 19,386
  • 1
  • 35
  • 63