Last active
January 20, 2021 01:44
-
-
Save mariotpc/984a9bbe3937f5b0e01749909a6fb585 to your computer and use it in GitHub Desktop.
Configure SNMP on my Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First all I found that the package net-snmp must be installed on the system | |
After install the package, the file snmpd.conf must be edited in order to allow the queries | |
In my case, just add... | |
rocommunity secret 186.151.0.0/16 # <- network for example pourposes | |
configure iptables on the server to let UDP traffic flow on port 161,162 | |
iptables -D IN_public_allow -s 186.151.XXX.XXX -p udp -m udp --dport 161 -j ACCEPT | |
iptables -D IN_public_allow -s 186.151.XXX.XXX -p udp -m udp --dport 162 -j ACCEPT | |
Let check on client side | |
alpine:~# snmpget -v 1 -c secret -Oqv 181.115.XXX.XXX IF-MIB::ifInOctets.2 | |
3018304626 | |
alpine:~# snmpget -v 1 -c secret -Oqv 181.115.XXX.XXX IF-MIB::ifOutOctets.2 | |
767023988 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment