Install snmpd on CentOS/RHEL
If you already know how to install snmpd on Ubuntu, doing it on the Red Hat side is the same idea with different plumbing. To install snmpd on CentOS or RHEL you pull the Net-SNMP package with the system package manager, drop your config into /etc/snmp/snmpd.conf, and start the service. The daemon, the config file, the OIDs it serves, and the query tools are all identical to a Debian box — only the install command and a couple of file paths differ. This page walks the whole thing end to end for the Red Hat family: CentOS, RHEL, Rocky, and AlmaLinux behave the same way here.
Prerequisites
Not much stands between you and a running agent on snmp rhel systems:
- A CentOS, RHEL, or compatible host (Rocky/AlmaLinux included) that you can reach over the network.
- Root or sudo — installing packages and editing
/etc/snmp/snmpd.confboth need it. - Network reachability to your package mirrors so the package manager can fetch Net-SNMP.
- A plan for a read-only community string and the OIDs you intend to expose. Sketch those with the OID allowlist guide before you open the config.
- The Net-SNMP client tools to test — the utilities package ships
snmpget,snmpwalk, andsnmptable. More on those in the Net-SNMP toolkit.
Because the steps run so close to the Debian/Ubuntu path, the install snmpd on Ubuntu/Debian page is a useful companion — the config and verification are word-for-word the same.
Step-by-step
The flow is: install, configure, enable, open the firewall, test. Here it is for CentOS/RHEL.
- Install the daemon and utilities. On older CentOS/RHEL the package manager is
yum; on current releases it'sdnf(the commands are interchangeable). Ayum install net-snmppulls the agent; add the utilities package for the client tools:
(On modern RHEL,sudo yum install net-snmp net-snmp-utilssudo dnf install net-snmp net-snmp-utilsis the same operation.) - Back up the stock config, then start clean:
sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig - Write your v2c read-only config into
/etc/snmp/snmpd.conf(full example in the next section). This file lives at the same path as on Debian, so the contents are portable. - Enable and start the service. The daemon is
snmpd. Using the portable service wrapper:
On systemd-based RHEL you can equivalently enable-at-boot and start with the systemd tooling; the effect is the same running agent.sudo service snmpd restart - Open the SNMP port in the firewall. Red Hat systems typically run firewalld, so allow the SNMP UDP port (161 by default) through it. If you've moved to a custom port, allow that number instead — see set a custom SNMP port.
That's the entire install. Note what did not change from the Debian instructions: the config syntax, the OIDs, the snmpwalk/snmpget commands, and the security model are all standard Net-SNMP. The Red Hat differences are narrow — the yum/dnf install line above, and the location of the daemon's options file. On Debian that's /etc/default/snmpd; on the Red Hat family the equivalent options file is generally /etc/sysconfig/snmpd on builds that use one. If you don't need to pass extra launch flags, you can ignore it entirely and let the defaults ride. When in doubt about a Red Hat-specific detail, treat the /etc/default/snmpd guide as the conceptual reference and apply the same idea to the sysconfig path.
Configuration example
The same steps map cleanly from Debian/Ubuntu to CentOS/RHEL:
| Task | Debian/Ubuntu | CentOS/RHEL |
|---|---|---|
| Install package | apt-get install snmpd | yum install net-snmp (or dnf install net-snmp) |
| Config file | /etc/snmp/snmpd.conf | /etc/snmp/snmpd.conf |
| Manage service | service snmpd restart | systemctl restart snmpd |
| Check status | service snmpd status | systemctl status snmpd |
The config is identical to any other Net-SNMP host — this is the portable part. A minimal v2c, read-only, allowlisted /etc/snmp/snmpd.conf:
# /etc/snmp/snmpd.conf — v2c read-only, allowlisted OIDs
agentAddress udp:161,udp6:[::1]:161 # change 161 to a random port for security
# sec.name source community
com2sec ReadUser default <password>
# group sec.model sec.name
group ReadGroup v2c ReadUser
# view incl/excl subtree
view ReadData included .1.3.6.1.2.1.25.1.1.0
view ReadData included .1.3.6.1.2.1.25.3.3.1.2
# ...one 'view ... included' line per allowed OID...
# group context model level prefix read write notify
access ReadGroup "" any noauth exact ReadData none none
Set <password> to a long random string, then add one view ... included line per OID you want reachable. Those two shown expose host uptime (1.3.6.1.2.1.25.1.1.0) and CPU load (1.3.6.1.2.1.25.3.3.1.2) from the Host Resources MIB (RFC 2790). Add memory, storage, and system-load OIDs the same way — the sensor catalog lists each. Keep write and notify at none; this agent only answers reads.

Verify it works
Confirm the service is up, then prove it answers. Status first:
service snmpd status
Look for an active/running state. Then query the agent locally:
snmpget -v2c -c <community> localhost 1.3.6.1.2.1.25.1.1.0
A TimeTicks uptime value means the install and config are good. Walk a table to see more than one row come back:
snmpwalk -v2c -c <community> localhost 1.3.6.1.2.1.25.3.3.1.2
That returns one hrProcessorLoad line per CPU. Finally, test from another machine using the server's IP to confirm the firewall is letting SNMP through — a local success but a remote timeout means the firewalld rule for the UDP port is missing or wrong. Anything stubbornly silent is covered in the troubleshooting guide.
Security note
A default Net-SNMP install is not hardened. On RHEL, tighten it before it faces anything:
- Replace any default community. Never leave
publicin place — use a long, random read-only string. See secure the community string. - Allowlist OIDs. Expose only what you monitor; deny the rest with a tight
view, per the OID allowlist. - Scope the firewalld rule to the hosts that actually poll, not the whole internet.
- Move off UDP 161 to a random high port to cut scanner noise — custom port.
- Use SNMPv3 where you need authentication and encryption; v2c sends the community in clear text (RFC 1901).
The full picture is in the security section.
Next: connect external monitoring
A freshly installed agent on CentOS still has the same blind spot every local monitor has: if the server crashes, whatever runs on it to warn you crashes too. Watching from outside removes that dependency. An independent poller keeps checking your agent from another network and turns a dead host into an alert instead of a gap in the graph — the essence of double durability, where a second, independent source catches what the first can't report.
ostr.io Monitoring polls the OIDs your CentOS/RHEL agent exposes from outside your network and sends real-time email and SMS alerts on outages, slow responses, and resource spikes — no extra software on the box. When the agent's verified, add an SNMP endpoint in ostr.io.
