Install & Configure SNMP (RHEL 8) – Quick Working Setup

Objective

Install SNMP, back up existing configuration, apply a fresh working config, and ensure connectivity.


1. Install Required Packages

yum install -y net-snmp net-snmp-utils

2. Backup Existing Configuration

mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak 2>/dev/null

3. Create New SNMP Configuration

cat > /etc/snmp/snmpd.conf << 'EOF'
agentAddress udp:161
rocommunity public
sysLocation "Server"
sysContact "root@localhost"
EOF

4. Enable & Restart SNMP Service

systemctl enable snmpd
systemctl restart snmpd

5. Allow SNMP Port in Firewall

firewall-cmd --add-port=161/udp --permanent
firewall-cmd --reload

6. Adjust SELinux (if Enforcing)

setsebool -P snmpd_disable_trans 1

7. Verify Service Status

systemctl status snmpd

8. Test SNMP Locally

snmpwalk -v2c -c public localhost

9. Test SNMP Remotely

snmpwalk -v2c -c public <server-ip>

Expected Result

  • SNMP responds without timeout

  • Data (OID tree) is returned


Notes

  • Community string: public (open access)

  • Suitable for testing/monitoring only

  • Not recommended for production without restrictions

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to restrict direct root access in Linux

We can do it just in two steps. Step One: At first we will create new root user as follows (for...

How to extract .tar.gz files in Linux/UNIX OS

A tarball is a group of files that are bundled together using the tar command. Use the...

How to add welcome message when SSH start?

You need to change the contents of /etc/motd. Unfortunately, by default, /etc/motd is a link to...

How to change root password when SSH logged in

Run the following command: passwd Now type your new passwordOnce done, retype new passwordDone!...

How to install Pinguzo on any Linux/UNIX OS

Login to Pinguzo panel using Softaculous account or create an account of Pinguzo To add new...