$ sudo apt-get update
$ sudo apt-get install snmpd
Edit the file: /etc/snmp/snmpd.conf with a text editor of your choice.
Add the following line:
rocommunity public
Note: The default Ubuntu “snmpd” configuration specifically denies almost everything useful with this configuration (limiting access to just enough information to tell that the machine is a Linux one):view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity public default -V systemonly
This configuration locks the machine down, which may be “safe” if it will be on an insecure network with little SNMP administration knowledge available. However, if you are willing to monitor the performance of your machine with an external systems, comment them and replace the access with a secure mechanism (either with SNMP v3 or different community string).
Comment the line:
#agentAddress udp:127.0.0.1:161
Uncomment the line:
agentAddress udp:161,udp6:[::1]:161
Restart the snmpd service:
$ /etc/init.d/snmpd restart
$ sudo apt-get update
$ sudo apt-get install snmpd
Edit the file: /etc/snmp/snmpd.conf with a text editor of your choice.
Add the following line:rocommunity public
Note: The default Ubuntu “snmpd” configuration specifically denies almost everything useful with this configuration (limiting access to just enough information to tell that the machine is a Linux one):view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity public default -V systemonly
This configuration locks the machine down, which may be “safe” if it is on an insecure network with little SNMP administration knowledge available. However, if you are willing to monitor the performance of your machine with external systems, comment on them and replace the access with a secure mechanism (either with SNMP v3 or a different community string).
Comment the line:#agentAddress udp:127.0.0.1:161
Uncomment the line: agentAddress udp:161,udp6:[::1]:161
Restart the snmpd service:
/etc/init.d/snmpd restart
3. Allow SNMP ports in the Firewall
Execute the following commands to allow necessary ports:
$ ufw allow 161/udp
$ ufw allow 162/udp
$ yum update
$ yum install net-snmp
$ /etc/init.d/snmpd restart
Execute the following commands to allow necessary ports:
$ firewall-cmd --zone=public --add-port=161/udp --permanent
$ firewall-cmd --zone=public --add-port=162/udp --permanent
$ firewall-cmd --reload
$ portsnap fetch
$ portsnap extract
$ cd /usr/ports/net-mgmt/net-snmp
$ make install clean
cp /usr/local/share/snmp/snmpd.conf.example /usr/local/etc/snmpd.conf
rocommunity public
#agentAddress udp:127.0.0.1:161
agentAddress udp:161,udp6:[::1]:161
snmpd_enable=”YES”
snmpd_conffile=”/usr/local/etc/snmpd.conf”
agentAddress udp:161,udp6:[::1]:161
1 $ service snmpd start
Edit the /etc/rc.conf file and add the following lines:
1
yum install net-snmp
Edit the file: /etc/snmp/snmpd.conf
Add the following lines:rocommunity public
agentAddress udp:161,udp6:[::1]:161
Start the snmpd service:systemctl enable snmpd && systemctl start snmpd
Execute the following commands to allow necessary ports:
firewall-cmd --zone=public --add-port=161/udp --permanent
firewall-cmd --zone=public --add-port=162/udp --permanent
firewall-cmd --reload
Edit the /etc/rc.conf file and add the following lines:
Edit the file: /etc/snmp/snmpd.conf
Add the following line:rocommunity public
Execute the following commands to allow necessary ports:
1 sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist