mag72

How To Enable SNMP on Windows, Linux & Mac OS X

howto enable snmp windows linux and mac osx

Jeff Parker

IT technicians and experts have been using the Simple Network Management Protocol (SNMP) for decades now.

It’s one of the most widely used protocols to monitor an extensive range of devices and solutions, and perform other network management tasks as well.

SNMP can be implemented in a network of any size; however, it proves its value when you are handling an enterprise-size network. It is undoubtedly a time-consuming and challenging process to manually log into hundreds of nodes in a network. But if a network administrator uses SNMP with a Network Management System (NMS), it allows him to manage all of the nodes from a single interface.

Before you start monitoring your network, enabling SNMP is the first and most crucial step. In this article, we will explain how you can enable SNMP on your system or servers with different operating systems like Windows, Linux, and Mac OS X.

Configuring SNMP on Windows OS

On Windows systems older than Windows 8 and Windows Server 2012, the SNMP protocol is already installed. By following the steps below, you can install and configure SNMP on other Windows systems. The process is almost similar on all windows systems.

  1. Go to “Control Panel” on your Windows system.
  2. In section “Programs and Features,” you will find “Turn Windows features on or off.” Click it.

    snmp in windows

  3. Check the option “Simple Network Management Protocol (SNMP)” on Windows system and initiate “installation.
    • On Windows Server 2008, in the “Server Manager” that opens after finishing step 2, find the SNMP protocol under “Features | Add Features.
    • On Windows Server 2012, 2016, and 2019, after finishing step 2, keep clicking “Next” until you find “Features” where you can choose and install “SNMP service”.
      snmp server enable
  4. Open “services.msc” as an administrator, after the SNMP installation finished.
  5. Open “Properties” of “SNMP Service” by double-clicking it.
  6. In the “General” tab, choose “Automatic” for “Startup Type”.
  7. On the “Security” tab, you can leave the default community name “public” or it will be more secure if you choose your own. Click on “Add” if you need to choose your own. For accepted community names, leave “Community Rights” as Read-Only and select a secure Community Name. Click on “OK” and remove the “public” entry.

    smnp community string configure windows

  8. On the “Security” tab in the lower half, you have the option to choose the IP addresses which are allowed to access the SNMP service.
  9. On the “Agent” tab, just fill out all edit options and enable all check-boxes to make all SNMP values available.

    contact

  10. Now save the properties and then restart the server.

 

Configuring SNMP on Windows 10 version 1809

With Windows 10 version 1809, the process to configure the SNMP has been changed. SNMP has been set as an optional feature for this version of Windows 10. Here is how you can enable SNMP on it.

  1. Go to “Settings” on your Windows machine.
  2. Visit “Apps”.
  3. Select “Manage optional features” under “Apps & features”.
  4. Click on “Add a feature”, the button with the “+” symbol.
  5. Choose “Simple Network Management Protocol (SNMP)” from the list. You will find the Simple Network Management Protocol in that list.  You may then find the service started, but not configured.

    windows 10 snmp app

  6. Click on “Install” and SNMP will be enabled on your system.

 

Configuring SNMP on Linux OS

Now we will explain a step-by-step procedure to configure and enable the SNMP service on the Linux operating system.

1. To install the SNMP daemon on Debian-based systems, run below given commands:

    sudo apt-get install snmpd

    sudo apt-get install snmp

2.The configuration file of SNMP service can be found at /etc/snmp/snmpd.conf. Make a copy of the file before modifying it by the command:

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

 

3. Open the snmpd.config with an editor. Now find the below entry:

# sec.name source community 
com2sec paranoid default public

4. Establish “community string” for SNMP. This string is like a user id or password that is required to access the device's statistics. It will be used by the client machines to retrieve the data. The community string is an essential configuration parameter. It can be identified where you will see “rocommunity”. The default value is public which is not secured because everybody knows it by default.

Use below command to restart the SNMP daemon:

sudo service snmpd restart

 

5. Now, you have successfully completed the basic setup for SNMP v1 and SNMP v2c. You can request available parameters using snmpwalk command.

 

6. It is mandatory to create a usable snmpd.config first. You can start a basic setup with this command:

sudo snmpconf -g basic_setup

7. You will have to answer different questions from the configuration assistant. For SNMP v1 and SNMP v2c, select read-only community access and other parameters required for your first SNMP configuration.

 

The procedure to install other Linux distributions like Ubuntu and Centos almost remains the same. Both distributions can be installed using the below commands.

  • For Ubuntu:
# apt-get install -y snmpd snmp

 

  • For Centos:
# yum install -y net-snmp net-snmp-utils

 

Configuring SNMP on Mac OS X

By default, the SNMP service is included in current macOS versions and the basic setup assistant will help you configure SNMP on your Mac. Follow the complete guide below to configure SNMP service successfully on your macOS. These steps don’t need a system restart and will not affect any service.

1. Open a new terminal window and enter the below command.

sudo snmpconf -g basic_setup

2. Make a copy of the default SNMP configuration file using below command.

sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

3. Create and edit a new SNMP configuration file:

sudo nano /etc/snmp/snmpd.conf

4. Set the “community string” for SNMP v1/v2c with another string if you prefer to do so. As mentioned before, it’s recommended as the default value is public and it is not secured. Now, save the configuration file and exit the nano editor.

5. Enable the SNMP daemon with below command.

sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist

 

It will be required to run the below commands instead of the above launchctl command if you alter the SNMP settings on your MacOS later.

sudo launchctl unload /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist

 

Next Step

Setting up SNMP in your computer is a matter of a few steps. You can similarly follow the steps shown above, and configure it in your servers.

But setting it up to get specific SNMP parameters from those servers is the next step, and it is a bit more challenging.