I'm working on a c++ code project that should be able to discover all the snmp devices on the network and then if the device name matches with one of the sensor names I'm looking for (I've got 2 different temperature sensors over Ethernet), then I want to send a snmpGet request which returns me the value(temperature).
I have no problem with the snmpGet part, but I'm having trouble figuring out a proper snmp discovery code. I'm using currently snmp++ library which I preferred over net-snmp because of its ease of use and support for C++. But I'm open to any recommendations to make this work.
Using snmpDiscovery code in snmp++ does not return any info for me. So I used snmpGet with broadcast address which seldomly returns one of the snmp device's info for each snmpGet call but not all snmp devices' info at once. So its unpredictable because even if one of my temperature sensors was available in the network, I would not know if my snmp-enabled-printer pings back instead. Anyway around this? Also I'm not using snmp version 3. Would it help if I do?
Thanks for the support!