Chapter Install SNMP on Linux, introducing the process of installing SNMP on Linux.

Install SNMP on Linux

Linux is often the preferred choice for SNMP due to its flexibility, resource efficiency, security, and deep integration with networking tools and monitoring systems.

The following chapters describe the steps to install and configure SNMP on a typical Linux distribution (Red Hat, Ubuntu, Debian).

Install SNMP on RHEL/CentOS

There are differences in installing and configuring SNMP on Debian 12 and Red Hat due to their use of different package managers, default file paths, and system service standards.

To install SNMP on Red Hat (RHEL), you can follow these steps:

Screenshot: SNMP installation on RHEL Screenshot: SNMP installation on RHEL
SNMP installation on RHEL

Update the System

First, ensure that your system is up-to-date by running:

sudo dnf update

Install SNMP Packages To install SNMP and the SNMP daemon (snmpd), run:

sudo dnf install net-snmp net-snmp-utils

Confirm with y.

This command installs:

  • net-snmp: The SNMP daemon (snmpd) and SNMP management tools.

    net-snmp-utils: Utilities for SNMP operations, such as snmpwalk and snmpset.

Verify Installation

Check if the installation was successful:

snmpd --version

Modify the Configuration

Open the newly created snmpd.conf file for editing:

sudo nano /etc/snmp/snmpd.conf

Set the Community String:

Look for the line that starts with rocommunity and update it with your desired community string.

Adding an accepted community name (e.g., "public") in the SNMP Service Properties is essential because it is a basic authentication mechanism for SNMP communication. Without an accepted community name, SNMP monitoring tools like Zabbix, Nagios, or PRTG cannot authenticate or retrieve data from the server.

public is a common default SNMP community name for Read-Only access.

public is the default value for the rocommunity (read-only community string) in many SNMP configurations, including the default configuration file for snmpd.

-V systemonly restricts access to the systemonly view, preventing monitoring tool like Zabbix from querying detailed anynode SNMP data.

By removing the -V and systemonly option, you ensure the monitoring server can access all necessary anynode-specific SNMP data for proper operation and monitoring.

Limit access to specific IPs or subnets by adding their IP addresses after the rocommunity string.

Add the host name or IP address of your monitoring system. In our example, the default access control is restricted to localhost, intended for local testing and usage.

Add.1.3.6.1.4.1.42303.2 to restrict access to this particular OID subtree.

OID Explanation: .1.3.6.1.4.1: Refers to the enterprise-specific MIB subtree.

42303: This is the enterprise number for TE-SYSTEMS

2: A specific branch within anynode's MIB, likely containing metrics or settings for a particular functionality.

Enable SNMP Deamon as Master Agent

The SNMP daemon as a Master Agent acts as a single interface for SNMP queries from monitoring tools like Zabbix. Subagents, such as anynode's SNMP integration, register their SNMP MIBs (Management Information Bases) with the Master Agent via the AgentX protocol. Zabbix queries the Master Agent for SNMP data, which then includes metrics from anynode and other subagents.

master agentx: Enables SNMP daemon as a master agent, allowing it to aggregate data from subagents via the AgentX protocol.

AgentXSocket tcp:127.0.0.1:705: Configures AgentX communication over a TCP socket at localhost (127.0.0.1) on port 705. This allows subagents (e.g., anynode) to register SNMP data dynamically with the master agent.

TCP sockets offer flexibility and are essential for subagents using TCP for communication. anynode exposes SNMP metrics to Zabbix via the master agent. SNMP clients (e.g., snmpwalk) retrieve data from both the master agent and subagents like anynode.

Screenshot: SNMP installation on RHEL and edited configuration file. Screenshot: SNMP installation on RHEL and edited configuration file.
SNMP installation on RHEL and edited configuration file.

Save Your Changes (if needed):

Press Ctrl + O (write out) to save the file.

Nano will prompt for a filename; press Enterto confirm or type a new name.

  • Exit Nano:

Press Ctrl + X


Apply the configuration changes by restarting the SNMP daemon:

sudo systemctl restart snmpd

If you are using a firewall, allow SNMP traffic on UDP port 161:

sudo ufw allow 161/udp

Check the service status:

sudo systemctl status snmpd

Test the SNMP service locally:

snmpwalk -v2c -c public localhost .1.3.6.1.4.1.42303.2

Screenshot: SNMP installation on RHEL and test of the SNMP service with snmpwalk. Screenshot: SNMP installation on RHEL and test of the SNMP service with snmpwalk.
SNMP installation on RHEL and test of the SNMP service with snmpwalk.

Install SNMP on Debian/Ubuntu

Before installing SNMP, ensure your system is up to date:

sudo apt update && sudo apt upgrade -y

Run the following command to install the SNMP client (snmp) and the SNMP daemon (snmpd):

sudo apt install -y snmp snmpd

The client (snmp) is not necessarily needed, unless you want to use it locally. However, you can still include it because, without it, the snmpwalk tool cannot be tested. We will explain this later.

Screenshot: SNMP installation on Linux / Debian 12. Screenshot: SNMP installation on Linux / Debian 12.
SNMP installation on Linux / Debian 12.

The SNMP daemon configuration file is located at

/etc/snmp/snmpd.conf

Backup the Original Configuration

sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak

Edit the Configuration File:

Open the configuration file with a text editor:

sudo nano /etc/snmp/snmpd.conf

Set the agent address:

Look for the line that starts with agentaddress and update it.

The agentaddress setting in the SNMP configuration tells the agent which IP addresses it should listen to for SNMP requests.

In our example:

Screenshot: SNMP daemon configuration file on Linux / Debian 12 with editing of agentaddress. Screenshot: SNMP daemon configuration file on Linux / Debian 12 with editing of agentaddress.
SNMP daemon configuration file on Linux / Debian 12 with editing of agentaddress.
  • <IP address> - (not shown) is the Debian 12 server's IP address.

  • 127.0.0.1 This is the IPv4 loopback address, used for localhost communication with the anynode frontend.

  • [::1]: This is the IPv6 loopback address, serving the same purpose as 127.0.0.1, but for IPv6. If you want Zabbix to monitor SNMP, add the Zabbix server's IP address to this line so the SNMP agent listens to it

If you want Zabbix to monitor SNMP, add the Zabbix server's IP address to this line so the SNMP agent listens to it as well. For example: agentaddress <IP address>,127.0.0.1,Zabbix_Server_IP

Set the Community String:

Screenshot: SNMP daemon configuration file on Linux / Debian 12 with editing of rocommunity line. Screenshot: SNMP daemon configuration file on Linux / Debian 12 with editing of rocommunity line.
SNMP daemon configuration file on Linux / Debian 12 with editing of rocommunity line.

Look for the line that starts with rocommunity and update it with your desired community string.

Adding an accepted community name (e.g., "public") in the SNMP Service Properties is essential because it is a basic authentication mechanism for SNMP communication. Without an accepted community name, SNMP monitoring tools like Zabbix, Nagios, or PRTG cannot authenticate or retrieve data from the server.

public is a common default SNMP community name for Read-Only access.

public is the default value for the rocommunity (read-only community string) in many SNMP configurations, including the default configuration file for snmpd.

-V systemonly restricts access to the systemonly view, preventing monitoring tool like Zabbix from querying detailed anynode SNMP data.

By removing the -V and systemonly option, you ensure the monitoring server can access all necessary anynode-specific SNMP data for proper operation and monitoring.

Limit access to specific IPs or subnets by adding their IP addresses after the rocommunity string.

Add the host name or IP address of your monitoring system. In our example, the default access control is restricted to localhost, intended for local testing and usage.

Screenshot: SNMP daemon configuration file on Linux / Debian 12 with editing of rocommunity line and access settings. Screenshot: SNMP daemon configuration file on Linux / Debian 12 with editing of rocommunity line and access settings.
SNMP daemon configuration file on Linux / Debian 12 with editing of rocommunity line and access settings.

Save Your Changes (if needed):

Press Ctrl + O (write out) to save the file.

Nano will prompt for a filename; press Enter to confirm or type a new name.

  • Exit Nano:

Press Ctrl + X

Apply the configuration changes by restarting the SNMP daemon:

sudo systemctl restart snmpd

If you are using a firewall, allow SNMP traffic on UDP port 161:

sudo ufw allow 161/udp

Configuration anynode Frontend (Linux)

This section explains how to configure anynode to respond to monitoring requests from external SNMP-based platforms under Linux. By default, the SNMP interface is disabled in anynode to minimize the network attack surface and prevent potential unauthorized access to system information.

The default setting applies only to new installations, and existing ones continue to function as configured.

To modify the default settings for SNMP in anynode, open the anynode frontend and navigate to Extras -> Monitor Settings.

Screenshot: anynode frontend with main menu with extras and monitor settings. Screenshot: anynode frontend with main menu with extras and monitor settings.
anynode frontend with main menu with extras and monitor settings.

Then, select the SNMP tab to configure how anynode interfaces with external monitoring systems.

Screenshot: anynode frontend with SNMP settings in the monitor configuration.  Screenshot: anynode frontend with SNMP settings in the monitor configuration.
anynode frontend with SNMP settings in the monitor configuration.

Navigate to Access to anynode for External SNMP Monitoring Queries.

Enable Simple Network Management Protocol (SNMP).

Click on Ok.

Fixed SNMP Index

Enable fixed SNMP index in anynode whenever you plan to monitor indexed SNMP tables, especially for long-term graphing, alerting, or correlation of dynamic objects. The fixed index can be explicitly assigned within the node object configuration in anynode.

Navigate to the desired node object and open the Object register.

Screenshot: anynode frontend with SNMP index assignment in the Microsoft Teams node object. Screenshot: anynode frontend with SNMP index assignment in the Microsoft Teams node object.
anynode frontend with SNMP index assignment in the Microsoft Teams node object.

In SNMP monitoring, each node object in anynode is represented by an index within the SNMP table. By default, these indices are generated dynamically based on the current list of enabled nodes. As a result, indices can shift when nodes are temporarily disabled or re-enabled—potentially leading to inconsistencies or mismatches in external monitoring systems.

To avoid such issues, anynode allows administrators to manually assign a fixed SNMP index to each node.

Assign a unique and fixed index to each node to avoid conflicts or ambiguity across the SNMP table. If Fixed SNMP Index is not enabled in the Monitor Settings, any manually assigned index values will be ignored. In this case, indices continue to be generated dynamically based on the list of currently active nodes.

Click Commit to apply and finalize the index assignment.

Troubleshooting Linux

Check anynode Monitor Settings

Before troubleshooting SNMP connectivity issues, ensure that the anynode Monitor Settings are properly configured.

These configuration steps are explained earlier in this document under:

  • Configuration anynode Frontend (Linux)

Disabled monitoring options are common causes of SNMP communication problems.

When configuring and troubleshooting SNMP with anynode under Linux, follow these steps:

Ping the host

Test connectivity from the monitoring server to the anynode host you want to monitor:

ping <anynode_IP_address>

Note: Some systems may block ICMP (ping) traffic, so this test might not always work. However, it's a basic way to check if the host is reachable.

Check if the SNMP service is running

Verify the status of the SNMP daemon (snmpd):

systemctl status snmpd

Screenshot: SNMP status verification under Linux / Debian 12. Screenshot: SNMP status verification under Linux / Debian 12.
SNMP status verification under Linux / Debian 12.

Ensure the SNMP port is listening

Use netstat (or ss if netstat is unavailable) to confirm that the host is listening on port 161 (default SNMP port):

sudo netstat -pln | grep :161

This will show if the anynode host is ready to receive SNMP requests on the desired IP.

Screenshot: SNMP netstat under Linux / Debian 12. Screenshot: SNMP netstat under Linux / Debian 12.
Screenshot: SNMP netstat under Linux / Debian 12.

Perform an SNMP query using snmpwalk

You can test SNMP from the same machine running the service to verify it's working locally:

snmpwalk -v2c -c public localhost

-v2c: Specifies SNMP version 2c (change as needed).

-c public: Specifies the community string (replace public with your configured string).

localhost: Tests SNMP on the local machine.

Test SNMP data retrieval with a query to a specific OID. For example, querying anynode license information data can be done as follows:

snmpwalk -v2c -c public localhost .1.3.6.1.4.1.42303.2.4.2

Replace localhost with the anynode host’s IP address if running the command from a different machine.

Refer to the Description of anynode OIDs chapter Description of anynode OIDs for an overview.

Screenshot: snmpwalk query for anynode license data under Linux / Debian 12. Screenshot: snmpwalk query for anynode license data under Linux / Debian 12.
snmpwalk query for anynode license data under Linux / Debian 12.

Resolving snmpwalk Issues

Without the master agentx setting:

  • The SNMP daemon cannot act as a broker for subagents like anynode.

  • SNMP queries (e.g., via snmpwalk) will fail to return anynode-specific data, breaking the integration with monitoring tools like Zabbix.

By checking this configuration, you ensure the SNMP daemon is correctly set up to aggregate data from anynode and serve it to SNMP clients.

Steps to debug and fix:

Verify master agentx is present in /etc/snmp/snmpd.conf

master agentx

Restart snmpd to apply changes:

sudo systemctl restart snmpd

Test with snmpwalk to ensure OIDs are accessible:

snmpwalk -v 2c -c public localhost.1.3.6.1.4.1.42303

Restart SNMP services after configuration changes

If you make any changes to the SNMP configuration (e.g., updating snmpd.conf), restart the SNMP service to apply the changes:

sudo systemctl restart snmpd

By following these steps, you can ensure that SNMP is properly configured and functioning for monitoring anynode on Linux.