prometheus / snmp_exporter

SNMP Exporter for Prometheus
Apache License 2.0
1.65k stars 614 forks source link

Doesn't work with SNMPv1 devices #8

Closed rrcollier closed 8 years ago

rrcollier commented 8 years ago

The exporter is great with my devices that support snmp 2c, but just times out contacting devices that only have v1 support.

pysnmp seems to support 1, 2c & 3, could you add a way of specifying the snmp version to use?

turnrye commented 8 years ago

Same request here -- trying to use this with Mikrotik RouterBoard devices and requests just hang.

brian-brazil commented 8 years ago

I'd be happy to take a pull request to add this.

turnrye commented 8 years ago

Cool, I'll look into it tonight/tomorrow. Still getting up to speed on how prometheus works and building it into our existing automation.

brian-brazil commented 8 years ago

I expect the man challenge here will be working with the snmp library we use, it should be relatively easy plumbing.

turnrye commented 8 years ago

Great!

jcollie commented 8 years ago

I too would like to see this, I have a Ubiquity UniFi AP-Pro and it doesn't respond to v2c SNMP queries, only v1.

turnrye commented 8 years ago

@jcollie I originally thought this was a code/lib problem but as it turned out it was my configuration. The improvement to be made IMO is in the exporter's error handling. I can send you an example of what my config looks like for Mikrotik devices -- it took a good bit of effort to get it setup but it works quite well now.

jcollie commented 8 years ago

@ryanturner I'd certainly like to see your config, but I'm pretty sure that In my case it's a v1 vs v2c issue:

[jeff@home01 ~]$ snmpget -v1 -c xxxxxxxx 192.168.4.51 SNMPv2-MIB::sysName.0
SNMPv2-MIB::sysName.0 = STRING: LivingRoom
[jeff@home01 ~]$ snmpget -v2c -c xxxxxxxx 192.168.4.51 SNMPv2-MIB::sysName.0 
Timeout: No Response from 192.168.4.51.
rrcollier commented 8 years ago

In my case (with a unifi uap lite) it's definetly a v1 vs v2c issue.

SuperQ commented 8 years ago

I've got a patch in progress for v1 and v3 support: https://github.com/SuperQ/snmp_exporter.

jcollie commented 8 years ago

This should probably be closed as the latest version works just fine with both SNMP v1 and v2c (probably SNMP v3 as well but I haven't tested).