By Gerald Schoch • Mar 14, 2017
How to Enable SNMP on Your Operating System
The Simple Network Management Protocol (SNMP), that has accompanied IT professionals for decades, is available on a large number of devices and solutions. This is great because it's one of the most basic technologies for monitoring and other network management tasks. Although SNMP won't fix the internet for you, you won't come across SNMP if you are a system administrator and responsible for IT infrastructure.
There are several things to consider when configuring SNMP for monitoring. The first and most important step is: Enable SNMP! How to do this depends on your specific piece of hardware (read the friendly manual if you need help). How enabling SNMP works on computers and servers with Windows, Linux, and macOS operating systems is something we'll show you in this article.
Enabling SNMP on Windows
Installing and configuring the SNMP service on the different Windows client and server versions mostly works the same way. On Windows versions older than Windows 8 and Windows Server 2012, it is already installed. For Windows 8, Windows 10, Windows Server 2012, and Windows Server 2016, you will have to install the SNMP service first. (Yes, that's correct. Although you might have read contrary statements on some boards, SNMP is still available on Windows Server 2012 and 2016!)
What you have to do is to open the Control Panel on your Windows machine. Open the Programs and Features section where you can Turn Windows features on or off.
On Windows workstations select Simple Network Management Protocol (SNMP) and install it.
On Windows Server you'll have to click Next in the Add Roles and Features Wizard until you reach the Features sections where you can install the SNMP Service.
After installing the SNMP service, configure it appropriately. So, run services.msc as administrator and navigate to the properties of the SNMP service. Choose Automatic as startup type to have the service always running, even after turning your computer off and on again.
For monitoring purposes, you should also check all services on the Agent tab to have all SNMP values available.
Don't forget to adjust security parameters like the community string and the IP/host filter list to your security compliances! For example, add the community name public with READ ONLY rights and accept SNMP packets from at least the address of your monitoring server.
That's it! You have successfully configured SNMP on your Windows machine.
Enabling SNMP on Linux
On Debian-based systems, install the SNMP daemon with these commands:
- sudo apt-get install snmpd
- sudo apt-get install snmp
You will now find the SNMP configuration in /etc/snmp/snmpd.config. Make a backup of the original configuration file and open snmpd.config with an editor. Find the following entry:
- # sec.name source community
com2sec paranoid default public
Change the security setting paranoid to readonly or readwrite. Just like SNMP on Windows, adjust the community string if needed. Now restart the SNMP daemon with
- sudo service snmpd restart
and you have accomplished the basic setup for SNMP v1 and SNMP v2c. Use snmpwalk to request available parameters.
It might be necessary to create a usable snmpd.config first. You can start a basic setup with this command:
- sudo snmpconf -g basic_setup
The configuration assistant will ask you several questions. Grant read-only community access for SNMP v1/v2c and make desired counters available for your first basic SNMP configuration.
For other Linux distributions like RedHat, CentOS, and Suse you will have to adapt these steps a bit. Find more information about SNMP installation and configuration on these systems in this article on dump.4network.eu.
Enabling SNMP on macOS
Current macOS versions include SNMP by default. You can use the basic setup assistant to appropriately configure SNMP on your Mac:
- Open a new terminal and use this command:
- sudo snmpconf -g basic_setup
Configure read-only community access for SNMP v1/v2c by answering the setup questions and start the SNMP daemon:
- sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist
Best practice is to add your SNMP daemon to automatic startup to manage the macOS machine via SNMP in a comfortable way.
Enabling SNMP on your operating system wasn't so hard, was it? Configuring access from other servers to useful system parameters via SNMP might be harder. We will cover this topic in the next articles about SNMP on our blog. Stay tuned!