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
Unable to add pfsense as monitored snmp device #1734
Comments
Hi, what ntopng version are you using (ntopng --version)? |
Hello, Latest dev on Ubuntu. |
3.3.180405 |
Can you please post a screenshot of the page with the options you use to add your SNMP device? |
What's the output of |
root@nuc:~# snmpwalk -v1 -c s3cr3t 192.168.1.1 1.3.6.1.2.1.1.5.0 |
What about this query? Edit: sorry, port 161: |
The query doesn't return anything. Tcpdump output below (asuming you wanted to intercept snmp traffic on port 161): 23:05:29.659509 94:c6:91:17:20:d0 > 00:0e:c4:d1:d2:4a, ethertype IPv4 (0x0800), length 94: 192.168.1.7.43372 > 192.168.1.1.161: C="s3cr3t" GetRequest(34) .1.3.6.1.2.1.1.5.0 On the same host i have a cacti instance monitoring pfsense just fine. |
Hello, Here's both a snmpwalk and a request through GUI: root@nuc:~# tcpdump -i eno1 -ne udp port 161 and host 192.168.1.1 --Here i did a snmpwalk 09:31:35.192913 94:c6:91:17:20:d0 > 00:0e:c4:d1:d2:4a, ethertype IPv4 (0x0800), length 85: 192.168.1.7.48740 > 192.168.1.1.161: C="s3cr3t" GetNextRequest(28) .1.3.6.1.2.1.1.5.0 --Now from GUI 09:31:52.631137 94:c6:91:17:20:d0 > 00:0e:c4:d1:d2:4a, ethertype IPv4 (0x0800), length 94: 192.168.1.7.36671 > 192.168.1.1.161: C="s3cr3t" GetRequest(34) .1.3.6.1.2.1.1.5.0 I can also provide a pcap capture if required. |
Ok so i decided to call it quits and replaced the ancient standard snmp daemon running on pfsense with net-snmp package and this one works. Do you want to continue troubleshooting this (I have no issues doing tests if required)? |
It would be great if you could test it on the old deamon. So you don't get a "GetResponse" to the "GetRequest" on |
That seems to be the case, yes. If required I can provide remote access to the environment. |
Thank you. Can you produce two pcap files, one with the SNMP traffic generated by manual snmp walk and another with traffic while adding the device from the ntopng gui and send me at faranda@ntop.org ? |
Done. |
Thank you. I've analyzed the SNMP get-request packets and the only difference between them is the size of some fields, which are 1 byte size in snmpwalk requests while 4 bytes size in ntopng requests. As SNMP fields are correcly encoded in type,length,value by ntopng, I think there is probably a limitation on the ancient SNMP daemon you were using. |
I'll raise this with the pfsense folks. Although I have a workaround maybe it's a trivial fix. |
@emanuele-f I raised this under https://redmine.pfsense.org/issues/8460. Would you mind giving me your analysis so I can pass the message to pfsense developers? |
@fsamareanu sure. In SNMP some fields are encoded with TLV (Type Length Value), where the length specifies how many bytes to read on the next field. The daemon you are using seems to ignore the "Length" value from some SNMP fields (at least in version, error-status, error-index fields) and assume length 1. This works well with snmpwalk which uses a 1 byte values but it does not with ntopng which uses 4 bytes values. |
Hello, This ended up being reported upstream to FreeBSD team at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227502 . The comment I got there was this:
|
--- Comment #3 from Eugene Grosbein eugen@freebsd.org --- The problem is more complex. Indeed, "In SNMP some fields are encoded with TLV snmpwalk can send small or large integers and it encodes them just right using On the other hand, ejrh/snmp library used by ntopng ALWAYS encodes integers |
@fsamareanu thank you for your feedback, we are reviewing the issue |
thanks for pointing this issue out. I was able to reproduce using FreeBSD 11.
The snmp library was poorly encoding all the integers using 4-bytes. I've fixed the issue accordingly. |
Hello,
I'm trying to add pfsense as snmp device but I get this:
No answer from host 192.168.1.1: please check that SNMP is up and the community is set to the correct value.
Parameters used: community, v1
snmpwalk works when ran from the same host:
root@nuc:~# snmpwalk -c s3cr3t 192.168.1.1 -v1|head -1
iso.3.6.1.2.1.1.1.0 = STRING: "pfSense oinky-pfsense.local.lan 2.4.3-RELEASE pfSense FreeBSD 11.1-RELEASE-p7 amd64"
Any guidelines? Is probing a freebsd host even supported?
The text was updated successfully, but these errors were encountered: