Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to get SNMP V1 or V2c? #916

Open
mattlward opened this issue Feb 21, 2018 · 20 comments
Open

Is it possible to get SNMP V1 or V2c? #916

mattlward opened this issue Feb 21, 2018 · 20 comments
Labels
Type: Feature Request Add a completely new feature (e.g. controller/plugin)
Milestone

Comments

@mattlward
Copy link

NOTE: This is not a support forum! For questions and support go here: https://www.letscontrolit.com/forum/viewforum.php?f=1

Steps to reproduce

How can we trigger this problem?
Not installed...
Does the problem presist after powering off and on? (just resetting isnt enough sometimes)

Expected behavior

Tell us what should happen?
Unit should answer SNMP queries

Actual behavior

Tell us what happens instead?
nothing

System configuration

Hardware:
Wemos D1
Software or git version:

@TD-er
Copy link
Member

TD-er commented Feb 21, 2018

Hmmm the ESP should be powerfull enough, but I am not such a masochist to implement it. ;)
If there is someone who will write a very simple implementation for it, be my guest. A good example can be Agentuino.

I'm afraid implementing it would be only a fraction of the time needed to make it work like everyone would want it to work.
Apart from that, allowing to set settings via SNMP would be a big security issue, so preferably only reading.

@TD-er TD-er added the Type: Enhancement Improve something already present label Feb 21, 2018
@TD-er TD-er added this to the future milestone Feb 21, 2018
@mattlward
Copy link
Author

I would love to be able to ask for sensor data... I use intermapper to montor about 2500 devices and there is no good way to get mqtt data into it.

@TD-er
Copy link
Member

TD-er commented Feb 21, 2018 via email

@mattlward
Copy link
Author

I would want to read sensor data... I would expect a tree under the private mib structure with a branch for each sensor type.

private ------>
sys-------->
sht30--->
dht22--->
so on--->

all would be read only...

I have had no luck finding an MQTT to SNMP gateway, this is the problem with IOT devices, they are just not designed to talk with the professional world.

@TD-er
Copy link
Member

TD-er commented Feb 21, 2018 via email

@mattlward
Copy link
Author

I would forsee using get and get bulk, get bulk is cpu intensive. I come from the world of a very large network... we have 2500+ very modern switches, routers, air handlers and ups units that all use SNMP. We use V2c when possible since it supports all forms of request and transmission. Would never suggest using sets in this environment.

Traditional is all the modbus and RS485 running around in modern building system controls!

A rest API might work, but would require more complex processes when a call is made to the device?

The ideal thing would be a Pi running as an MQTT client with an SNMP frontend that had a definable MIB that could be tied to the MQTT topics. Can't find one!

@mattlward
Copy link
Author

BTW, misspoke... should not be in the private mib structure but rather the experimental mib structure.

@TD-er TD-er added Type: Feature Request Add a completely new feature (e.g. controller/plugin) and removed Type: Enhancement Improve something already present labels Mar 2, 2018
@clumsy-stefan
Copy link
Contributor

clumsy-stefan commented Aug 31, 2021

Just came across this while setting up a new NMS... Are there any thoughts on pursuing this any further? There is an updated SNMP library at https://github.com/rexpark/Arduino-SNMP not sure though how complex this would be to integrate...

EDIT: I think it would be nice to just receive basic OID's like sysLocation, sysContact, Load, ifStatus/IP, etc. not necessarily sensor data...

@TD-er
Copy link
Member

TD-er commented Aug 31, 2021

I do use LibreNMS for myself and to monitor a larger network of a client of mine.
So now that I have seen the practical usage of SNMP, I do plan on adding it.

N.B. LibreNMS is a truly marvel and has given me a lot of insights and saved me a lot of research to see what may be causing an issue.

@clumsy-stefan
Copy link
Contributor

Same here... LibreNMS is watching my network... which gives me a good overview of some 100 IoT and other IP Systems... so it would be kind of cool to have more information on ESPEasy nodes than jsut an ICMP reply...

@clumsy-stefan
Copy link
Contributor

PS: I'm happy to help with this, but the basic work needs to be done by someone else, as I still do not fully understand on how to implement a completely new plugin/controller.

I assume this would be another (selectable) controller that can be added if needed?

@TD-er
Copy link
Member

TD-er commented Sep 1, 2021

Not 100% sure if it should be a controller.
Typically a controller does send data and SNMP is polling.
Unless we also implement the trapping functionality of course.

So maybe a controller is the best approach, but I'm not yet entirely sure.

The reason is that a controller is usually not aware of what it is sending, but for SNMP you need to know what you try to poll.
Also we need to add an MIB describing the paths to data.
But since we don't know now what we will support in the future, this may be a lot of work to keep it up to date when we now make the wrong design choice.
So maybe such a controller should have a number of predefined "paths" which a user can select using an IDX value.

I don't know if SNMP also supports to automatically fetch an MIB file, or something similar. But if it does, we may also need to implement a hook to supply a dynamically generated one.

Just to begin, we can of course support the basic system parameters, like uptime, load, memory, WiFi signal strength, etc.
But those are system functions and thus do not really need a controller. As soon as you want to report more, it makes sense to make it a controller.

@clumsy-stefan
Copy link
Contributor

Sounds like a reasonable approach to me...

I would not implement traps at this time, just responses to queries (which also a controller does?) and as you said, just basic standard MIB information like the ones you mentioned. As it's normally UDP, the controller doesn't really need to know if it's been received, etc....

I'm not completely sure, but I think you don't need the MIB file but just send the correct OID's in the response.

@TD-er
Copy link
Member

TD-er commented Sep 1, 2021

Well being polled instead of sending means that the controller must keep all values, just like a retain flag with MQTT.
Also it must support the "SNMP walk" and I am not sure what is needed to support that.
Have to dive into the SNMP specification a bit more.

I think we should only support SNMP v2.x as v1 is too basic and v3 does require authentication.

@clumsy-stefan
Copy link
Contributor

Well being polled instead of sending means that the controller must keep all values, just like a retain flag with MQTT.

Hmm.. can't it just reply with actual values when queried?

Other possibility would be to have something like the /json page. Just sending actual basic values in a well predefined format, without any/much config possibilities. But I'm also not an SNMP specialist..

I think we should only support SNMP v2.x as v1 is too basic and v3 does require authentication.

Agree on that, just reply to v2c read communities (probably with a configurable community string as basic security)

@clumsy-stefan
Copy link
Contributor

A quick update on this. I am currently switching to zabbix as new NMS. As zabbix can easily integrate JSON information I developed a zabbix template to monitor my ESPEasy's. Currently only on a system level, i.e. without sensor data, which I use and monitor in FHEM.

So if anyone is interested, I'm happy to share my (work in progress) template!

@TD-er
Copy link
Member

TD-er commented Jan 29, 2023

OK, while you're using Zabbix, can you perhaps also have a look at this forum topic?

@clumsy-stefan
Copy link
Contributor

@TD-er
Copy link
Member

TD-er commented Jan 29, 2023

I meant there is some user claiming to not being able to use the Zabbix controller at all on ESP32, so maybe you can see where the issue he's having may be coming from?

@clumsy-stefan
Copy link
Contributor

I don't use the Zabbix controller at all! I use active polling from zabbix, not the other way round, my ESPEasy's dont have the zabbix controller compiled in, as I keep it as small as possible and don't use zabbix for the sensor values...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request Add a completely new feature (e.g. controller/plugin)
Projects
None yet
Development

No branches or pull requests

3 participants