Setting Up SNMP on a Fedora 39 Workstation and Configuring it in Nagios XI

Picture of Johnny Mengistu
Johnny Mengistu
Fedora 39

Simple Network Management Protocol (SNMP) is a widely-used protocol for monitoring and managing network devices and servers. With SNMP, administrators can gather metrics on hardware status, network traffic, and other key performance indicators. This article will guide you through the process of installing and configuring SNMP on a Fedora 39 workstation and then setting it up in Nagios XI for monitoring purposes.

Prerequisites

Before we begin, ensure that:

  • You have a Fedora 39 workstation.
  • You have root (sudo) privileges on the system.
  • You have Nagios XI installed and running, with access to the web interface.
  • You have basic knowledge of SNMP and Nagios XI’s functionality.

Part 1: Installing and Configuring SNMP on Fedora 39 Workstation

SNMP typically runs on UDP port 161 for general communication and port 162 for traps. We will install and configure the SNMP daemon (snmpd) on Fedora 39.

Step 1: Install the SNMP Packages

Fedora repositories provide the necessary SNMP utilities. First, update the system and install the required SNMP packages.

1. Update system packages:

bash

sudo dnf update -y

2. Install SNMP daemon and utilities:

bash

sudo dnf install net-snmp net-snmp-utils -y

This will install the SNMP daemon (snmpd) and the SNMP utilities that allow you to query and test SNMP configurations.

Step 2: Configure SNMP Daemon

The configuration file for snmpd is located at /etc/snmp/snmpd.conf. Open the file to configure it for your environment.

1. Edit the SNMP configuration file:

bash

sudo vi /etc/snmp/snmpd.conf

2. Basic configuration example:

  • Set the community string to something secure (the default is public, which is insecure and should be changed).Configure access control for SNMP agents.
Here’s a minimal configuration for SNMPv2c (the most commonly used version of SNMP):

# Set the SNMP community string (password)
rocommunity private
# Specify the network range that is allowed to access SNMP information
# You can change this to your network's IP range
rocommunity private default -V systemonly

# Restrict SNMP access to localhost (for security reasons)
agentAddress udp:161,udp6:[::1]:161

  • The rocommunity directive defines a read-only community string.
  • The agentAddress directive ensures SNMP listens on the correct network interfaces (you can modify it for your specific requirements).

3. Restart the SNMP service:

Once the configuration is complete, restart the SNMP daemon for the changes to take effect:

bash

sudo systemctl restart snmpd sudo systemctl enable snmpd

4. Verify SNMP service is running:

To verify that SNMP is running and accessible, you can use the following command:

bash

sudo systemctl status snmpd

If it’s running properly, it should indicate that the service is active.

Step 3: Test SNMP Locally

You can test if SNMP is working locally using the snmpwalk tool, which is included in the net-snmp-utils package.

  1. Test SNMP locally:
bash

snmpwalk -v 2c -c private localhost

  • -v 2c specifies SNMP version 2c.

  • -c private specifies the community string.

  • localhost indicates that you’re querying the local machine.

If everything is configured correctly, you should see a large list of SNMP values and OIDs returned from the system.

Part 2: Configuring SNMP on Nagios XI

  1. Log into Nagios XI , hover over the gear icon and select “Configuration Wizards”.
Config Wiz 1
Config Wizards

2. Search “SNMP” in the search box above and select the Linux SNMP option shown in the picture below.

Linux SNMP Wiz
Linux SNMP Wiz

3. Fill in the necessary information then hit finish at the end or “finish with defaults”

Linux Config Wiz
Linux Config Wiz

Conclusion

You have successfully installed SNMP on a Fedora 39 workstation and configured it in Nagios XI for monitoring. By using SNMP, you can gather various system metrics such as CPU usage, disk space, network interface statistics, and more. Nagios XI provides a powerful platform for monitoring these metrics and alerting you to potential issues. With the steps outlined in this guide, you can now integrate SNMP-based monitoring into your IT infrastructure to ensure smooth operations and proactive system management.

Additional Resources

Visit Our Website: https://www.nagios.com

Visit Nagios Support: https://support.nagios.com/

Visit Nagios Exchange: https://exchange.nagios.org/

Share: