Skip to content

Instantly share code, notes, and snippets.

@fo40225
Last active November 22, 2024 06:18
Show Gist options
  • Save fo40225/b2fc652dee35fc217bb7f6c5c394e6f0 to your computer and use it in GitHub Desktop.
Save fo40225/b2fc652dee35fc217bb7f6c5c394e6f0 to your computer and use it in GitHub Desktop.
snmp v2c
# ubuntu 24.04
sudo apt install snmpd
sudo vim /etc/snmp/snmpd.conf
#agentaddress 127.0.0.1,[::1]
rocommunity public default #-V systemonly
rocommunity6 public default #-V systemonly
sudo vim /lib/systemd/system/snmpd.service
[Service]
Restart=always
sudo systemctl daemon-reload
sudo systemctl restart snmpd.service
# RHEL 8
sudo dnf install net-snmp
sudo firewall-cmd --zone=public --add-service snmp --permanent
sudo firewall-cmd --reload
sudo vim /etc/snmp/snmpd.conf
# Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view all included .1
####
# Finally, grant the group read-only access to the systemview view.
# group context sec.model sec.level prefix read write notif
#access notConfigGroup "" any noauth exact systemview none none
access notConfigGroup "" any noauth exact all none none
sudo systemctl restart snmpd.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment