SNMP Installation und Konfiguration (Debian/Ubuntu)

Aus Wiki
Zur Navigation springen Zur Suche springen

Hier eine kleine Anleitung wie man SNMP unter Debian oder Ubuntu zum laufen bekommt.


aptitude update && aptitude install snmpd

Konfiguration Ubuntu / Debian Lenny

Die Standard Konfigurations Datei editieren:

#SNMP group
com2sec readonly  default          yourSNMPGroup

view all    included  .1     80
#view system included  .
#view system included

#where the Maschine is located
syslocation Machine Location (configure /etc/snmp/snmpd.local.conf)

#Your Mountpoints and the critical disk full percentage
disk / 10%
disk /srv 10%

Debians default Konfiguration editieren, wichtig hier ist, das man dem "" noch die Interface IP hinzufügt auf die man eine SNMP Abfrage von einem anderen System starten will.

# This file controls the activity of snmpd and snmptrapd

# MIB directories.  /usr/share/snmp/mibs is the default, but
# including it here avoids some strange problems.
export MIBDIRS=/usr/share/snmp/mibs

# snmpd control (yes means start daemon).

# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/'

# snmptrapd control (yes means start daemon).  As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run.  See snmpd.conf(5) for how to do this.

# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/'

# create symlink on Debian legacy location to official RFC path

Nun den Dienst neu starten:

/etc/init.d/snmpd restart

Konfiguration Debian Squeeze


#  Listen for connections from the local system only
#agentAddress  udp:
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161
#  Listen for connections on all interfaces (only IPv4)
agentAddress udp:161

                                                 #  Full access from an example network
                                                 #     Adjust this network address to match your local
                                                 #     settings, change the community string,
                                                 #     and check the 'agentAddress' setting above
#rocommunity secret
rocommunity community

sysLocation    Laub-Home

#  Disk Monitoring
                               # 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk       /     5%
disk       /srv  5%
includeAllDisks  10%

Test via snmpwalk


snmpwalk -v 2c -c COMMUNITY localhost .1