I am running an Ubuntu 12.04 as working environment on my local machine. Ubuntu 12.04 is latest LTS (Long Term Support) version so that it's a good choice for a server. I need to install SNMP on my machine recently and I install it by following command
sudo apt-get install snmpd snmp
However it seems doesn't work. After checking the system log, I found the following errors in /var/log/syslog
snmpd[8461]: /etc/snmp/snmpd.conf: line 90: Error: Already have an entry for this process.snmpd[8461]: /etc/snmp/snmpd.conf: line 92: Error: Already have an entry for this process.snmpd[8461]: /etc/snmp/snmpd.conf: line 94: Error: Already have an entry for this process.snmpd[8461]: /etc/snmp/snmpd.conf: line 106: Error: includeAllDisks already specified.snmpd[8461]: /etc/snmp/snmpd.conf: line 106: Error: #011ignoring: includeAllDisks 10%snmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger namesnmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger namesnmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger namesnmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger namesnmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger namesnmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger namesnmpd[8461]: error on subcontainer '' insert (-1)snmpd[8461]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger namesnmpd[8461]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger namesnmpd[8461]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger namesnmpd[8461]: duplicate table data attempted to be entered. row existssnmpd[8461]: Failed to register extend entry 'test1' - possibly duplicate name.snmpd[8461]: duplicate table data attempted to be entered. row existssnmpd[8461]: Failed to register extend entry 'test2' - possibly duplicate name.snmpd[8461]: Turning on AgentX master support.snmpd[8461]: Error opening specified endpoint "udp:127.0.0.1:161"snmpd[8461]: Server Exiting with code 1
The content of /etc/snmp/snmpd.conf
is like
89 # At least one 'mountd' process90 proc mountd91 # No more than 4 'ntalkd' processes - 0 is OK92 proc ntalkd 493 # At least one 'sendmail' process, but no more than 1094 proc sendmail 10 19596 # Walk the UCD-SNMP-MIB::prTable to see the resulting output97 # Note that this table will be empty if there are no "proc" entries in the snmpd.conf file9899100 #101 # Disk Monitoring102 #103 # 10MBs required on root disk, 5% free on /var, 10% free on all other disks104 disk / 10000105 disk /var 5%106 includeAllDisks 10%145 # generate traps on UCD error conditions146 defaultMonitors yes147 # generate traps on linkUp/Down148 linkUpDownNotifications yes149150
So let's fix the problem. I comment the snmpd.conf configurations appeared in syslog, then use command cat /etc/snmp/snmpd.conf | grep -v '#' | grep -v '^\s*$'
to get a clean version.
view systemonly included .1.3.6.1.2.1.1view systemonly included .1.3.6.1.2.1.25.1rocommunity public default -V systemonlyrouser authOnlyUsersysLocation Sitting on the Dock of the BaysysContact Me <[email protected]>sysServices 72disk / 10000disk /var 5%load 12 10 5trapsink localhost publiciquerySecName internalUserrouser internalUsermaster agentxcreateUser testuser MD5 "testpasswd"rouser testuser auth
After updated /etc/snmpd/snmpd.conf
and /etc/init.d/snmpd restart
, now it's working.
$ snmpwalk -v 3 -l authNoPriv -a MD5 -u testuser -A testpasswd 127.0.0.1:161 sysDescrSNMPv2-MIB::sysDescr.0 = STRING: Linux simon-desktop 3.9.3-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64
BTW, The i3 is the best tiling window manager I have ever used.