jacobalberty / unifi-docker

Unifi Docker files
MIT License
2.16k stars 458 forks source link

SNMP not working - No response #472

Closed michmoor0725 closed 2 years ago

michmoor0725 commented 3 years ago

Host operating system

Ubuntu 20.04.3 LTS

What tag are you using

latest

What complete docker command or docker-compose.yml do you use to launch the container (omitting sensitive values)?

Using GUI - Portainer

Note: A screenshot of your configuration page if using a gui is acceptable image

What do you expect to happen?

Exposing UDP port 1161 on the host and map that to port 161 in the container. The expectation is that SNMP would work.

What actually happens?

Nothing. SNMPWalk indicates no response.

From Management station: sudo snmpwalk -v2c -c #### 192.168.15.2:1161 Timeout: No Response from 192.168.15.2:1161

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

shk3bq4d commented 2 years ago

Hello @michmoor0725 ,

I'm not an unifi controller expert.

I have/had the same interest than you have, but I don't think the controller supports being reached by SNMP and can only find references to the contrary.

(one example: https://community.ui.com/questions/Monitoring-with-SNMP/1eabb0e5-793e-4891-9a45-2e7ade737ca1)

Do you have any evidence that it is possible?

michmoor0725 commented 2 years ago

I’ve sinced move from having it on a container to now in a VM and snmp is fully operational. I would recommend not using the container if snmp is needed

Get Outlook for iOShttps://aka.ms/o0ukef


From: shk3bq4d @.> Sent: Tuesday, April 5, 2022 11:30:33 AM To: jacobalberty/unifi-docker @.> Cc: michmoor0725 @.>; Mention @.> Subject: Re: [jacobalberty/unifi-docker] SNMP not working - No response (#472)

Hello @michmoor0725https://github.com/michmoor0725 ,

I'm not an unifi controller expert.

I have/had the same interest than you have, but I don't think the controller supports being reached by SNMP and can only find references to the contrary.

(one example: https://community.ui.com/questions/Monitoring-with-SNMP/1eabb0e5-793e-4891-9a45-2e7ade737ca1)

Do you have any evidence that it is possible?

— Reply to this email directly, view it on GitHubhttps://github.com/jacobalberty/unifi-docker/issues/472#issuecomment-1088872056, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALK4SMH6UK2EWDXUTVRQPPTVDRMBTANCNFSM5FSTB54Q. You are receiving this because you were mentioned.Message ID: @.***>

jacobalberty commented 2 years ago

@shk3bq4d snmp does work, you either have to map the ports 1:1 no remapping, or just expose the container directly to the network. I use macvlan and have been running mrtg for years.

shk3bq4d commented 2 years ago

Thanks a lot for the feedback.

Maybe I didn't find it in the image myself because I'm still on 6.5.x?

I'll check 7.0 whenever I have a chance!

shk3bq4d commented 2 years ago

still no luck on 7.0.25, but I see that latest is now tracking 7.1.61, so I'll schedule another upgrade: I tried direct mapping and host network. I also guess there's a setting I have missed somewhere in the GUI

$ netstat -lnp | grep -E 'java|mongo'
tcp        0      0 0.0.0.0:8843            0.0.0.0:*               LISTEN      168085/java
tcp        0      0 0.0.0.0:8880            0.0.0.0:*               LISTEN      168085/java
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      168085/java
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN      168085/java
tcp        0      0 0.0.0.0:6789            0.0.0.0:*               LISTEN      168085/java
tcp        0      0 0.0.0.0:27017           0.0.0.0:*               LISTEN      161640/mongod
udp        0      0 0.0.0.0:5514            0.0.0.0:*                           168085/java
udp        0      0 0.0.0.0:3478            0.0.0.0:*                           168085/java
udp        0      0 0.0.0.0:10001           0.0.0.0:*                           168085/java
udp        0      0 172.17.0.1:58218        0.0.0.0:*                           168085/java
udp        0      0 10.101.6.80:50252       0.0.0.0:*                           168085/java
unix  2      [ ACC ]     STREAM     LISTENING     50774521 161640/mongod        /tmp/mongodb-27017.sock
shk3bq4d commented 2 years ago

I now have upgraded to 7.1.61 and still can not figure how to have SNMP working on the controller.

I tried my luck setting:

JVM_EXTRA_OPTS: -Dcom.sun.management.snmp.port=161

but that must not be it as I think openjdk does not implement the needed classes as it resulted in

 java.lang.UnsupportedOperationException: Unsupported management property: com.sun.management.snmp.port
     Caused by: java.lang.ClassNotFoundException: sun/management/snmp/AdaptorBootstrap

@jacobalberty : enabling SNMP on the controller seems to be non-obvious, while you may consider this out of the scope of your project, is there any chance you recall how it is to be configured?

OliHall commented 1 year ago

@shk3bq4d Did you ever find a way to get SNMP working in the jacobalberty/unifi image?

shk3bq4d commented 1 year ago

@OliHall : no, I haven't managed to get it working.

OliHall commented 1 year ago

@shk3bq4d Thanks, that's interesting. I can monitor all my APs with SNMPv3, but I cannot get SNMP monitoring of the controller working.

After reading the comment from @michmoor0725 above, I created a dedicated ubuntu VM and installed 7.4.162 directly on ubuntu 22.04 and this didn't work either.

@jacobalberty please can you clarify your comment above?

snmp does work, you either have to map the ports 1:1 no remapping, or just expose the container directly to the network. I use macvlan and have been running mrtg for years.

Are you monitoring the controller with SNMP? or only monitoring the APs?

Did you have to separately install SNMPD in the container (or on the VM)? or should it be included in the unifi java app?

Many thanks, Oli.