SNMP Installation Guide – FreeBSD

Install net-snmp from ports

$cd /usr/ports/net-mgmt/net-snmp $make all install clean

Add the following line into /etc/rc.conf


Add snmpd.conf

$vi /usr/local/share/snmp/snmpd.conf

System Location

syslocation SLTiDC

System Contact


Read Community String accepted only from Nagios NMS

rocommunity Ma91cFLuT3
  1. Start SNMP Daemon
$ /usr/local/etc/rc.d/snmpd start Starting snmpd. $
  1. Opening UDP 161 from BSD ipfirewall (ipfw) Note: First check whether ipfw is enabled in the server.
Edit /etc/firewall.conf as follows $vi /etc/firewall.conf — Check the interface and relavant ports cp /etc/firewall.conf /etc/ '+%Y-%m-%d-%H%M%S' add 00001 check-state add 00010 deny log ip from me to me in recv bge0 add 00020 allow ip from any to any via lo0 add 00030 allow icmp from any to me icmptypes 0,3,11 in keep-state add 00040 allow tcp from any to me dst-port 80,2002,10000,443,110,995,25,465,5666 in setup keep-state add 00050 allow udp from any to me dst-port 161 in keep-state add 00060 allow ip from me to any out keep-state add 00070 deny log ip from any to me in add 00080 deny ip from any to any 6 Restart IP Firewall $/etc/rc.d/ipfw restart 7 Install nrpe cd /usr/ports make search name=nrpe cd /usr/ports/net-mgmt/nrpe2 make install clean Enable SSL Add below string –> /etc/rc.conf nrpe2_enable=”YES” 8 cd /usr/local/etc/ –> ftp —> nrpe.cfg.freebsd mget nrpe.cfg.freebsd mv nrpe.cfg.freebsd nrpe.cfg vi nrpe.cfg —> clamd.sock replace in right path rehash /usr/local/etc/rc.d/nrpe2 start 9 rm /usr/bin/mailq ln -s /usr/local/bin/mailq /usr/bin/ mailq