etingof / snmpfwd

SNMP Proxy Forwarder
http://snmplabs.com/snmpfwd/
BSD 2-Clause "Simplified" License
67 stars 18 forks source link

Use snmpfwd as a push/pull system #21

Open jcampbell05 opened 6 years ago

jcampbell05 commented 6 years ago

SNMP is proving unreliable as we have systems on the cloud wanting to know information from an IOT device.

We would love for our IOT devices to push their latest stats to snmfwd and for servers to be able to pull it from snmpfwd when possible.

I was wondering if its possible to implement a caching system for this.

etingof commented 6 years ago

Can you please elaborate a bit on the desired design of the system?

Is it that the IoT send SNMP TRAPs to some intermediate storage, then the could pulls the data from that storage over SNMP GET?

Or is it SNMP GET all the way from the cloud down to IoT?

jcampbell05 commented 6 years ago

So the IoT sends the TRAP or even just the latest reading of a SNMP value to a server. That server can then forward that on to other servers whenever anyone does a GET request.

Right now we do a GET all the way from the cloud down to the IoT but right now it can be unreliable or slow. If we could invert this so its faster then that would be awesome :)

etingof commented 6 years ago

Still not quite clear to me... I imagine three approaches here:

  1. You keep your SNMP GET based design where you SNMP GET all the way from the cloud down to IoT. But there would be a cache built into snmpfwd-server perhaps to cache SNMP command responses coming from IoT through snmpfwd-client.
  2. Similar to (1) but for SNMP TRAPs rather than SNMP commands. And there would probably be some periodic job to replay cached TRAPs towards the cloud
  3. Either parts (e.g. snmpfwd-server or snmpfwd-client) becomes a "hub" to cache incoming TRAPs and respond to SNMP commands using that cache.

I think all three designs are technically feasible, though the third is probably the heaviest implementation-wise.

So what's your need/attitude? ;-)

jcampbell05 commented 6 years ago

:) Looks like 2 or 3 for us. I'm not so familiar with TRAPs. Can they be used to push any information to the server? (i.e the latest ink level for example) or can it only tell the server the level has change and the server will need to use a GET.

etingof commented 6 years ago

Can they be used to push any information to the server? (i.e the latest ink level for example)

Yes, SNMP agent can report whatever it wants to SNMP manager via TRAP message. SNMP manager can follow up and read something in addition to that from SNMP agent via SNMP GET command, but that is not necessary. Depends on the design of the system.

etingof commented 6 years ago

Either way, I'd be happy to implement either of these options whenever I get some time to work on that. Let me know if you (as a business, I presume) would be willing to sponsor this effort. ;)

jcampbell05 commented 6 years ago

:) yeah we would be willing, just currently getting to grips what is possible :)