Tuesday, May 21, 2019

14.04 - Why is SNMP broken?

Ubuntu Version: Ubuntu 14.04.1 LTS



SNMP Version: 5.7.2



Short Issue: A lot of the entries in the "default" configuration file are broken. Which doesn't really matter because I can't even get SNMP started.



Desired Outcome: I want a working SNMP instance, one with as many of the defaults functional in it as possible.



NOTE: From a great many sources, including Canonical owned Ubuntu websites, it is said that I have to modify export and SNMPDOPTS, in order to have basic functionality.




/etc/default/snmpd



export MIBS=UCD-SNMP-MIB
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
TRAPDRUN=no
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
SNMPDCOMPAT=yes



/etc/snmp/snmpd.conf



view   systemonly  included   .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity public
rwcommunity nanana
sysLocation vm1-ryd-wlo
sysContact Paul Adams
sysServices 72
disk / 10000

disk /var 5%
load 12 10 5
trapsink localhost public
iquerySecName internalUser
rouser internalUser
master agentx


/var/log/syslog




Oct  3 13:59:51 mdnsreflector-ryd-wlo snmpd[9120]: Server Exiting with code 1
Oct 3 14:00:09 mdnsreflector-ryd-wlo snmpd[9143]: Turning on AgentX master support.
Oct 3 14:00:09 mdnsreflector-ryd-wlo snmpd[9145]: NET-SNMP version 5.7.2


sudo service --status-all



[ + ]  snmpd



sudo service ufw status



Status: inactive



  1. Even though this configuration loads and is apparently running. You can't actually query anything from this SNMP instance from a remote device. The connection ultimately times out.


  2. Querying it from the server itself yields nothing.





snmpwalk -Os -c public -v 1 localhost system



system: Unknown Object Identifier (Sub-id not found: (top) -> system)



  1. I had to remove the "agentAddress" entries because the software kept panicking every time it attempted to process that command. (Even though that is the default and the way it supposed to be listed in the configuration.)



/etc/var/syslog




Oct  3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Turning on AgentX master support.
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Turning on AgentX master support.
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Error opening specified endpoint "udp:161"
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Server Exiting with code 1


sudo service --status-all



[ - ]  snmpd




  1. I had to remove several of the default entries in the config because they also caused errors upon running them.



/etc/snmp/snmpd.conf



proc mount
proc ntalkd 4

proc sendmail 10 1
includeAllDisks 10%
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35


/var/log/syslog



Oct  3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 90: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 92: Error: Already have an entry for this process.

Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 94: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 106: Error: includeAllDisks already specified.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 106: Error: #011ignoring: includeAllDisks 10%
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: message repeated 6 times: [ /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger name]
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: duplicate table data attempted to be entered. row exists
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: Failed to register extend entry 'test1' - possibly duplicate name.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: duplicate table data attempted to be entered. row exists

Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: Failed to register extend entry 'test2' - possibly duplicate name.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...