Difference between revisions of "Host SNMP Configuration"

From Technologia Incognita
Jump to: navigation, search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
 +
<p>
 
First install Net-SNMP :
 
First install Net-SNMP :
 +
</p>
  
root@ubuntu:~# apt-get install snmpd  
+
<p>
 +
<i> root@ubuntu:~# apt-get install snmpd </i> <br>
 +
<b>Ubuntu: make sure the SNMPDOPTS line in /etc/default/snmpd looks like this</b>
 +
</p>
  
 +
<p>
 +
<i>SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -p /var/run/snmpd.pid'</i>
 +
</p>
  
 +
<p>
 +
<b>This also disables logging and as such gets rid of annoying "features" like</b><br>
 +
snmpd[4990]: Connection from UDP: 1.2.3.4
 +
</p>
  
'''Ubuntu: make sure the SNMPDOPTS line in /etc/default/snmpd looks like this'''
+
<p>
 +
<b>Replace the default /etc/snmp/snmpd.conf file with something like this, changing the community, location and contact fields</b>
 +
</p>
  
''"SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -p /var/run/snmpd.pid'"''
+
<p>
 +
<i>com2sec readonly  default        techinc</i><br>
 +
<i>group MyROGroup v1        readonly</i><br>
 +
<i>group MyROGroup v2c        readonly</i><br>
 +
<i>group MyROGroup usm        readonly</i><br>
 +
<i>view all    included  .1                              80</i><br>
 +
<i>access MyROGroup ""      any      noauth    exact  all    none  none</i><br>
 +
<i>syslocation Louwesweg 1 </i><br>
 +
<i>syscontact Network Team</i><br>
 +
<i>#This line allows Observium to detect the host OS if the distro script is installed</i><br>
 +
<i>extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro</i>
 +
</p>
  
 +
<p>
 +
<b>Get the observium 'distro' script to identify your distribution via SNMP</b>
 +
</p>
  
 +
<p>
 +
<i>wget http://www.observium.org/svn/observer/trunk/scripts/distro/<br></i>
 +
<i>mv distro /usr/bin/distro</i><br>
 +
<i>chmod 755 /usr/bin/distro</i>
 +
</p>
  
'''This also disables logging and as such gets rid of annoying "features" like'''
+
<p>
 +
<b>You should then be able to restart snmpd</b>
 +
</p>
  
''snmpd[4990]: Connection from UDP: 1.2.3.4''
+
<p>
 +
root@server:~# /etc/init.d/snmpd restart
 +
</p>
  
 +
<p>
 +
<b>And then add the device to your Observium installation!</b>
 +
</p>
  
'''
+
<p>
Replace the default /etc/snmp/snmpd.conf file with something like this, changing the community, location and contact fields'''
 
 
 
com2sec readonly  default        <COMMUNITY>
 
group MyROGroup v1        readonly
 
group MyROGroup v2c        readonly
 
group MyROGroup usm        readonly
 
view all    included  .1                              80
 
access MyROGroup ""      any      noauth    exact  all    none  none
 
syslocation <LOCATION>
 
syscontact <CONTACT>
 
#This line allows Observium to detect the host OS if the distro script is installed
 
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
 
 
 
Get the observium 'distro' script to identify your distribution via SNMP
 
 
 
wget http://www.observium.org/svn/observer/trunk/scripts/distro
 
mv distro /usr/bin/distro
 
chmod 755 /usr/bin/distro
 
 
 
You should then be able to restart snmpd
 
 
 
root@server:~# /etc/init.d/snmpd restart
 
 
 
And then add the device to your Observium installation!
 
 
On devices with a large routing table
 
On devices with a large routing table
 +
</p>
  
 +
<p>
 
You may encounter sloppy SNMP responsiveness and high host load with too many routes installed in combination with netsnmp. Also see this Debian bugreport of a few years back. The last post seems to fix this issue, so if you are running full table, add these lines to snmpd.conf as well:
 
You may encounter sloppy SNMP responsiveness and high host load with too many routes installed in combination with netsnmp. Also see this Debian bugreport of a few years back. The last post seems to fix this issue, so if you are running full table, add these lines to snmpd.conf as well:
 +
</p>
  
view all    included  .1                              80
+
<p>
view all    excluded  .1.3.6.1.2.1.4.21
+
view all    included  .1                              80<br>
view all    excluded  .1.3.6.1.2.1.4.24
+
view all    excluded  .1.3.6.1.2.1.4.21<br>
 +
view all    excluded  .1.3.6.1.2.1.4.24<br>
 
view system included  .iso.org.dod.internet.mgmt.mib-2.system
 
view system included  .iso.org.dod.internet.mgmt.mib-2.system
 +
</p>

Latest revision as of 21:14, 3 December 2014

First install Net-SNMP :

root@ubuntu:~# apt-get install snmpd
Ubuntu: make sure the SNMPDOPTS line in /etc/default/snmpd looks like this

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -p /var/run/snmpd.pid'

This also disables logging and as such gets rid of annoying "features" like
snmpd[4990]: Connection from UDP: 1.2.3.4

Replace the default /etc/snmp/snmpd.conf file with something like this, changing the community, location and contact fields

com2sec readonly default techinc
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
view all included .1 80
access MyROGroup "" any noauth exact all none none
syslocation Louwesweg 1
syscontact Network Team
#This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

Get the observium 'distro' script to identify your distribution via SNMP

wget http://www.observium.org/svn/observer/trunk/scripts/distro/
mv distro /usr/bin/distro
chmod 755 /usr/bin/distro

You should then be able to restart snmpd

root@server:~# /etc/init.d/snmpd restart

And then add the device to your Observium installation!

On devices with a large routing table

You may encounter sloppy SNMP responsiveness and high host load with too many routes installed in combination with netsnmp. Also see this Debian bugreport of a few years back. The last post seems to fix this issue, so if you are running full table, add these lines to snmpd.conf as well:

view all included .1 80
view all excluded .1.3.6.1.2.1.4.21
view all excluded .1.3.6.1.2.1.4.24
view system included .iso.org.dod.internet.mgmt.mib-2.system