Learning Academy

The Cure of Ignorance is to Question. MUHAMMAD (PBUH)

FreeBSD

How to install, configure, and test SNMP in FreeBSD?

How to install, configure, and test SNMP in FreeBSD?

Installation:

Install net-snmp using this commands:

# cd /usr/ports/net-mgmt/net-snmp
# make install clean

Configuration File:

Copy the default configuration file to the right location.

# cp /usr/local/share/snmp/snmpd.conf.example /usr/local/etc/snmpd.conf

Basic Configuration:

Open /usr/local/etc/snmpd.conf and set up the community and network access.

# ee /usr/local/etc/snmpd.conf
..............
#  AGENT BEHAVIOUR
#  Listen for connections from the local system only
agentAddress  udp:161
#  ACCESS CONTROL
rocommunity public 192.168.1.1/32    # Community string, and IP address of monitoring server
............

Firewall Configuration:

Open /etc/rc.conf in your favorite editor and make sure snmpd is enabled:

# ee /etc/rc.conf
snmpd_enable="YES"
snmpd_conffile="/usr/local/etc/snmpd.conf"

Starting SNMP:

Type the following command to start snmpd:

# /usr/local/etc/rc.d/snmpd start

Testing via snmpwalk:

# snmpwalk -v1 -c public 

Checking if SNMP is listening on port 161/UDP

# sockstat -4 -l | grep snmp
root     snmpd      87074 11 udp4   *:161                 *:*
root     snmpd      87074 12 udp4   *:33698               *:*
root     snmpd      87074 14 tcp4   *:199                 *:*

 

Enjoy and don’t forget to comment.

Muhammad Shaukat

Content Developer at LearnAcad.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest