Setup configuration for SNMP
How to setup monitoring using BangDB for SNMP V3
RedHat / CentOS
- Install RPM
- Open Port 161
- Stop snmpd service
- Create snmp v3 user
- Start the service
- Test locally
- Test remotely
// For RedHat sudo yum install net-snmp-utils net-snmp // For CentOS yum install net-snmp-utils net-snmp-libs
Ensure that port 161 is open and snmp service is added.
sudo firewall-cmd --zone=public --add-service snmp
sudo service snmpd stop
sudo net-snmp-create-v3-user -ro -A myauthpass -X myprivpass -a SHA -x AES bangdbuser
sudo service snmpd start // Or you may use these as well sudo systemctl restart snmpd sudo systemctl enable snmpd
snmpwalk -v3 -u bangdbuser -A myauthpass -a SHA -X myprivpass -x AES -l authPriv 127.0.0.1
Now using the right IP address of the server where we just configured the snmp, if you get Timeout then it means the port 161 is not open.
snmpwalk -v3 -u bangdbuser -A myauthpass -a SHA -X myprivpass -x AES -l authPriv 34.12.34.98
Ubuntu / Debian
- Install libraries
- Stop the services
- Add v3 user
- Install necessary MIBs
- Start the service
- Test locally
- Test remotely
sudo apt-get install snmp snmpd libsnmp-dev
sudo service snmpd stop
sudo net-snmp-create-v3-user -ro -A myauthpass -X myprivpass -a SHA -x AES bangdbuser
Edit the file /etc/snmp/snmpd.conf and comment out as shown, then add the line as highlighted below
sudo vim /etc/snmp/snmpd.conf # Listen for connections from the local system only - COMMENT THIS agentAddress udp:127.0.0.1:161 # Listen for connections on all interfaces (both IPv4 *and* IPv6) agentAddress udp:161,udp6:[::1]:161,tcp:161,tcp6:[::1]:161
sudo apt-get install snmp-mibs-downloader sudo download-mibs sudo sed -i 's/mibs :/# mibs :/g' /etc/snmp/snmp.conf
Edit the snmpd.conf file and add following [ sudo vim /e etc/snmp/snmpd.conf] includeAllDisks 10% for all partitions and disks
sudo service snmpd start # Or you may use these as well sudo systemctl restart snmpd sudo systemctl enable snmpd
snmpwalk -v3 -u bangdbuser -A myauthpass -a SHA -X myprivpass -x AES -l authPriv 127.0.0.1
Now using the right IP address of the server where we just configured the snmp, if you get Timeout then it means the port 161 is not open
snmpwalk -v3 -u bangdbuser -A myauthpass -a SHA -X myprivpass -x AES -l authPriv 34.12.34.98
How to setup monitoring using BangDB for SNMP V1/2
RedHat/ CentOS
- Install snmp
- Start the service
// For RedHat sudo yum install net-snmp-utils net-snmp // For CentOS yum install net-snmp-utils net-snmp-libs
Edit the /etc/snmp/snmpd.conf and add following
rocommunity bangdb
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old
rocommunity <CommunityString>
sudo service snmpd start # Or you may use these as well sudo systemctl restart snmpd sudo systemctl enable snmpd
Ubuntu / Debian
- Install snmp
- Edit the snmpd file and do following :
- Install necessary MIBs
- Start the service
sudo apt-get install snmpd
Edit the /etc/snmp/snmpd.conf and add following
rocommunity bangdb
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old
rocommunity <CommunityString>
Comment out following line or similar
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -p /var/run/snmpd.pid'
Add the following like
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
sudo apt-get install snmp-mibs-downloader sudo download-mibs sudo sed -i 's/mibs :/# mibs :/g' /etc/snmp/snmp.conf
Edit snmpd.conf file and add
includeAllDisks 10% for all partitions and disks
sudo service snmpd start # Or you may use these as well sudo systemctl restart snmpd sudo systemctl enable snmpd