|
Prerequisites: |
FreeBSD (Base + Autoconf, Automake, Bash and GCC) |
|
Overview: |
|
Net-SNMP – SNMP tool collection (traplogd, snmpget, snmpwalk)
Home:
# Download (Notes:
Users behind a Proxy
Server should read this and
users without Internet but have a CDRom read this.)
cd /usr/src
fetch
http://easynews.dl.sourceforge.net/sourceforge/net-snmp/net-snmp-5.4.2.tar.gz
# Ungzip and Untar
tar xvf
net-snmp-?.?.?.tar.gz
# Configure
cd net-snmp-?.?.?
# New way:
./configure --prefix=/usr/local --build=i386-src-freebsd7.0
--disable-debugging --with-mib-modules="if-mib"
--with-python-modules --with-perl-modules --enable-embedded-perl
--enable-shared --with-default-snmp-version=2 --with-sys-contact="YourEmail@gmail.com"
--with-sys-location="Earth" --with-zlib=/usr/local/lib
--with-bzip2=/usr/local/lib --with-openssl=/usr/local/ssl/lib
--with-logfile=/var/log/snmpd.log
--with-persistent-directory=/var/net-snmp --enable-as-needed
--enable-internal-md5 --enable-mfd-rewrites --enable-reentrant
# Compile & Install
make
make install
make clean
|
Create a very basic "snmptrapd.conf" |
|
# Create
some directories and edit the snmptrapd.conf: |
|
Create an “rc” script to start traplogd at boot time |
|
# Create an “rc” script to start at boot time:
vi /usr/local/etc/rc.d/snmpd
vi /usr/local/etc/rc.d/snmptrapd
#
Make the startup script executable: # Edit rc.conf to allow remote syslog
messages since you now allow remote traps! # Edit syslog.conf and add "local7.*" to
the "/var/log/messages" line:
# Restart Syslog
# Notes |
|
Configure the agent portion of snmp on the server "snmpd" |
|
# Edit snmpd.conf to
suit your needs (Remember to fix /etc/rc.conf - snmpd_enable="YES"
if you want the agent turned on - security risky!)
# The agent section is not complete yet - use at
your own risk
# Note: This section about the "agent"
(snmpd) is not complete - My intention was to get the "server"
(traplogd) running quickly. |