IT Knowledge Base

Technical Repository

HowTo: Configure SNMP on Linux

Just copy and paste the following commands in the terminal. They will update the configuration file and restart the service.
Enable SNMP to listen on all interfaces

sed -i 's/agentAddress  udp:  udp:' /etc/snmp/snmpd.conf

Change SNMP Community String

sed -i 's/ rocommunity public  default    -V systemonly/rocommunity MYSECURESNMPSTRING default    -V systemonly/g' /etc/snmp/snmpd.conf

Allow SNMP connectinos from this network

sed -i 's/#rocommunity secret\/16/rocommunity secret\/24/g' /etc/snmp/snmpd.conf

Updated Location and contact settings

sed -i 's/sysLocation    Sitting on the Dock of the Bay/sysLocation    Boston, MA/g' /etc/snmp/snmpd.conf
sed -i 's/sysContact     Me /sysContact     [email protected]/g' /etc/snmp/snmpd.conf

Restart SNMP for changes to take affect

service snmpd restart

Leave a Reply