Windows Server 2022 - SNMP

Install and configure SNMP on Windows Server 2022

I. Presentation

In this tutorial, we will learn how to install and configure SNMP on a server under Windows Server 2022. The SNMP protocol is very useful when you want to supervise (monitor) equipment (switches, routers, servers, printers, etc.) in order to retrieve information on several metrics. We can cite a few SNMP-compatible monitoring solutions: Centreon, Zabbix, Nagios, Checkmk.

By default, the SNMP functionality is not installed on Windows so it is necessary to add the function with the Windows GUI, with PowerShell or from your favorite configuration management tool (Ansible, PowerShell DSC, etc. ).

Original version: August 27, 2015

II. Installer SNMP sous Windows Server 2022

Here I am using a slot machine Windows Server 2022 but the procedure is the same on other versions including Windows Server 2012 R2, Windows Server 2016, Windows Server 2019.

Open Server Manager, click “To manage” then “Add roles and features“. Go through the first 4 steps without making any changes, until you get to step “Features“. Here you need to tick “Service SNMP” then “SNMP WMI Provider” if you plan to use the WMI layer. You can also add it later.

Installer SNMP Windows Server 2022

Continue to the final step to start the installation and wait a moment! That’s it, SNMP is installed on the Windows server!

III. Installer SNMP en PowerShell

For lovers of PowerShell and scripts, know that it is possible to launch a installation de SNMP en PowerShell rather than going through Server Manager.

Open a PowerShell console as an administrator, and enter the following command:

Get-WindowsFeature -Name *snmp* | Install-WindowsFeature

This command has the effect of installing all the features that contain SNMP in their names, namely:

  • Outils SNMP (“RSAT-SNMP”) : Administering the SNMP Feature
  • Service SNMP (“SNMP-Service”) : SNMP service itself
  • Fournisseur WMI SNMP (“SNMP-WMI-Provider”) : Use WMI queries by SNMP with this extension

To check the installation status if you wish, just run this command:

Get-WindowsFeature -Name *snmp*

You will get this:

Check if SNMP is installed correctly
Check if SNMP is installed correctly

Now let’s get to the configuration.

IV. Configuration du service SNMP

There is no MMC console specific to the management of the SNMP service as one can have for other roles and functionalities. LConfiguration is done using the properties of the SNMP service.

Therefore, navigate to the services console (services.msc) and search for the service named “Service SNMP“. Right click on it and “Properties“.

Access the properties of the SNMP service
Access the properties of the SNMP service

Compared to a classic service, you should observe the presence of additional tabs: Interrupts, Security and Agentsknowing that we mainly use the last two mentioned.

If you don’t see these tabs, don’t panic! Just restart the service by right clicking on “Service SNMP” then “To restart“, sinon par PowerShell :

Restart-Service SNMP

Go back to properties and the tabs should appear.

A. “Security” tab

In this tab, we declare the communities that we accept as well as the rights assigned. Very often, read-only permission is assigned to a community, but several choices are offered.

To add a community, click on “To add” and enter the corresponding information. It is possible to add several communities, with a different level of rights each time if necessary. For the name of the communities, it is preferable to use complex names to avoid it being easily guessed.

Configure an SNMP community on Windows

For security, it is better to check the option “Accept SNMP packets from these hosts” and add your monitoring server to the list. This avoids accepting SNMP packets from anyone…

SNMP sous Windows - Filtrage IP

Let’s go to the tab “Agent“.

B. “Agent” tab

This tab is used to indicate information relating to your server to integrate them into the SNMP agent. The area “Contact” allows you to indicate the information on the person who administers this server (a name, a first name, or an e-mail address), while the field “Emplacement” is used to indicate where this server is located (example: White room).

ws-2012-snmp-4

Finally, various options are offered at the “Service” :

Physique : Does the server manage physical devices? Example: a hard drive.

Applications : Are any applications sending data over TCP/IP?

Data link and subnet : Does the server manage a bridge?

Internet : Is the server a router?

End to end : Is the server connected to the network using TCP/IP?

Don’t hesitate to test your configuration with SNMP test software, or else test directly with your monitoring server. For the configuration to be taken into account, it is preferable to restart the SNMP service.

V. Conclusion

We have just seen how to install and configure SNMP on Windows Server in order to be able to monitor our server! Other techniques are possible in addition, such as the use of NSClient++ in particular to execute PowerShell scripts (via NRPE) and return reports. For instance :

Supervision,Système,SNMP,Windows,

#Install #configure #SNMP #Windows #Server

Leave a Comment

Your email address will not be published. Required fields are marked *