CentOS
Turn off SNMP service.
sudo service snmpd stop
Copy this configuration into /etc/snmp/snmpd.conf
rwuser public
createUser public SHA "CHANGETHIS" AES "CHANGETHIS"
agentAddress udp:161,udp6:[::1]:161
syslocation XYZ room, Gedung Lab Lt. 14, Bandung [-1.8732591,10.586894]
syscontact admin [email protected]
#Distro Detection
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
If iptables
active, allow SNMP.
sudo iptables -I INPUT 1 -m state --state NEW -p tcp --dport 161 -j ACCEPT
sudo iptables -t filter -L INPUT --line-numbers -n
Install snmpwalk
on CentOS.
sudo yum install net-snmp-utils
Test new configuration.
snmpwalk -v3 -u public -l authPriv -a SHA -A CHANGETHIS -x AES -X CHANGETHIS 10.0.0.170
Then turn on SNMP.
sudo service snmpd start
Add new devices using this command.
cd /opt/librenms
./addhost.php 10.0.0.170 ap v3 public CHANGETHIS CHANGETHIS sha aes 161 udp
Debian
Installing package.
sudo apt-get update --fix-missing
sudo apt-get -y install snmp snmpd libsnmp-dev
Turn off SNMP service.
sudo service snmpd stop
Copy this configuration into /etc/snmp/snmpd.conf
createUser privUser SHA CHANGETHIS AES CHANGETHIS
agentAddress udp:161,udp6:[::1]:161
syslocation XYZ room, Gedung Lab Lt. 14, Bandung [-1.8732591,10.586894]
syscontact admin [email protected]
#Distro Detection
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
Test new configuration.
snmpwalk -v3 -u privUser -l authPriv -a SHA -A CHANGETHIS-x AES -X CHANGETHIS 10.0.0.170
Then turn on SNMP.
sudo service snmpd start
Add new devices using this command.
cd /opt/librenms
./addhost.php 10.0.0.170 ap v3 public CHANGETHIS CHANGETHIS sha aes 161 udp
Reference
- https://fineconnection.com/how_to_install_and_enable_snmpv3_on_a_linux_system_for_authentication_en_encryption_testing-2/
- https://www.incredigeek.com/home/setup-snmp-v3-on-debian-or-ubuntu/
Add distro detection for Debian OS
sudo curl https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro -o /usr/local/bin/distro &&
sudo chmod 777 /usr/local/bin/distro
sudo curl https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro -o /usr/bin/distro &&
sudo chmod 777 /usr/bin/distro