TrueNAS 13 and SNMP not listening on port 161?

MisterBaz

Dabbler
Joined
Nov 28, 2022
Messages
14
Running the latest stable version of TrueNAS Core (TrueNAS-13.0-U3.1).

I'm attempting to use SNMP for monitoring TrueNAS with Zabbix (they have an SNMP template).

In the TrueNAS GUI, I fill out the correct info for location, contact, and community. I save and then start the service. It won't respond to any SNMP queries. Running a netstat, I can see it isn't listening on port 161. I can confirm with a port scan that shows port 161 is no open.

I've tried stopping and starting the service. I've also tried a full reboot of the appliance (R730xd) to no avail. Any tips?
 

MisterBaz

Dabbler
Joined
Nov 28, 2022
Messages
14
UPDATE: It appears that the service keeps restarting? I was able to pull part of a walk before it errored out on me.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I've tried stopping and starting the service. I've also tried a full reboot of the appliance (R730xd) to no avail. Any tips?

Check the system log files to see if anything interesting is being reported from the SNMP daemon.
 

MisterBaz

Dabbler
Joined
Nov 28, 2022
Messages
14
OK, so it looks like snmp messages are in /var/log/middlewared.log.
SNMP is running and on port 161 now. I think the issue is now my Zabbix SNMP template refuses to connect for some reason.
 

MisterBaz

Dabbler
Joined
Nov 28, 2022
Messages
14
We have the same issue here. Cacti or observium after update to TrueNAS-13.0-U3.1
I was eventually able to get mine working, and I can't find the details listed anywhere (or from TrueNAS documents), so here we go:
  1. Looking through my settings in Zabbix, make sure your SNMPv3 settings for SHA and AES are SHA1 and AES128. I thought they would have been SHA256 (or 512) and AES256, but no. These really should be more up-to-date with modern standards, but whatever - it's SNMP so who cares, right?
  2. For TrueNAS itself, I had to manually edit the /etc/local/snmpd.conf file.
    1. On the "agentAddress" line, there will be many entries for udp:161, unix sockets, localhost, etc. Delete all of that and put the single IP address of the interface IP you want SNMP listening on. No need for the port, as it will default to udp port 161.
    2. Restart the SNMP service.
After that, I was off to the races. You could run a netstat and see it listening for udp port 161 on the IP address I put in the snmpd.conf file.
 

mrstevemosher

Dabbler
Joined
Dec 21, 2020
Messages
49
I was eventually able to get mine working, and I can't find the details listed anywhere (or from TrueNAS documents), so here we go:
  1. Looking through my settings in Zabbix, make sure your SNMPv3 settings for SHA and AES are SHA1 and AES128. I thought they would have been SHA256 (or 512) and AES256, but no. These really should be more up-to-date with modern standards, but whatever - it's SNMP so who cares, right?
  2. For TrueNAS itself, I had to manually edit the /etc/local/snmpd.conf file.
    1. On the "agentAddress" line, there will be many entries for udp:161, unix sockets, localhost, etc. Delete all of that and put the single IP address of the interface IP you want SNMP listening on. No need for the port, as it will default to udp port 161.
    2. Restart the SNMP service.
After that, I was off to the races. You could run a netstat and see it listening for udp port 161 on the IP address I put in the snmpd.conf file.


We tried the above and gave up. Obsubvium does not support sha1 nor aes128. We'll wait for a fix.

We saw that every time we made the edits to agentAddress entries upon start it removed our settings and put its own info back in.

IE "agentAddress udp:161,udp6:161,unix:/var/run/snmpd.sock"


I appreciate you providing the above information.
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You can check on Jira (see "Report a Bug"), but not everything there is visible to outsiders. You are free to report it as a fresh bug.
 

MisterBaz

Dabbler
Joined
Nov 28, 2022
Messages
14
We tried the above and gave up. Obsubvium does not support sha1 nor aes128. We'll wait for a fix.

We saw that every time we made the edits to agentAddress entries upon start it removed our settings and put its own info back in.

IE "agentAddress udp:161,udp6:161,unix:/var/run/snmpd.sock"


I appreciate you providing the above information.
Coming back to this late:

You can't restart the service using the TrueNAS GUI. You must use the command service snmpd onerestart and it will save your edits. You'll have to do this each time you reboot your TrueNAS system. I say setup an automation (I prefer Ansible) to take care of this for you.
 
Top