Настройка snmp windows server 2019

SNMP (
Simple Network Management Protocol
) — это классический протокол для мониторинга и сбора информации о сетевых устройствах (сервера, сетевое оборудование, рабочие станции, принтеры и т.д.). Протокол SNMP довольно легкий, быстрый, для передачи данных использует UDP порты 161 и 162. В этой статье мы рассмотрим, как установить и настроить службу SNMP в Windows Server 2022/2019 и Windows 10/11.

Содержание:

  • Установка службы SNMP в Windows Server 2022/2019
  • Установка SNMP агента в Windows Server Core
  • Установка службы SNMP в Windows 10/11
  • Настройка службы SNMP в Windows Server и Windows 10/11

Установка службы SNMP в Windows Server 2022/2019

В Windows Server службу SNMP можно установить с помощью Server Manager.

Выберите Add roles and features -> Features. Выберите SNMP Service (если нужно отметьте также SNMP WMI Providers).

Служба SNMP WMI Provider позволяет опрашивать SNMP устройство через WMI.

Установка роли SNMP в Windows Server 2019

Нажмите Next -> Install и дождитесь окончания установки.

Установка SNMP агента в Windows Server Core

В Windows Server Core можно установить SNMP с помощью веб-интерфеса Windows Admin Center и PowerShell.

Если вы используете Windows Admin Center, подключитесь к хосту Windows Server, выберите Roles and Features -> SNMP Service.

Установка SNMP через Windows Admin Center

Т.к. в Windows Server Core отсутствует графический интерфейс, а для его управления используется командная строка, вы можете установить службу SNMP из командной строки PowerShell.

Для установки ролей в Windows Server из PowerShell используется командлет Install-WindowsFeature.

Проверьте, что служба SNMP не установлена:

Get-WindowsFeature SNMP*

установить SNMP службу в Windows Server Core из PowerShell

Установите роль SNMP и WMI провайдер:

Install-WindowsFeature SNMP-Service,SNMP-WMI-Provider -IncludeManagementTools

Проверьте, что службы SNMP запущены:

Get-Service SNMP*

В нашем примере SNMP служба запущена, а SNMPTRAP остановлена.

проверить состояние службы SNMP из powershell

Установка службы SNMP в Windows 10/11

Вы можете использовать службу SNMP не только в Windows Server, но и в десктопных редакциях Windows 10 и 11.

В Windows 10/11 служба SNMP, вынесена в отдельный компонент Feature On Demand (как RSAT и OpenSSH).

Вы можете установить SNMP через панель Settings. Перейдите в Apps -> Optional features -> Add an optional feature -> View features.

В списке доступных компонентов выберите Simple Network Management Protocol (SNMP) и WMI SNMP Provider. Для начала установки нажмите Next (понадобится интернет подключение к серверам Microsoft).

установка службы Simple Network Management Protocol (SNMP) в Windows 10 и 11

Для установки службы SNMP через PowerShell, используйте команду:

Add-WindowsCapability -Online -Name SNMP.Client~~~~0.0.1.0

Для установки службы SNMP без подключения к интернету, вам понадобится скачать ISO образ Windows 10/11 Features on Demand из личного кабинета на сайте лицензирования Volume Licensing Service Center (VLSC).

Для офлайн установки службы SNMP с такого ISO образа используется команда:

Add-WindowsCapability -Online -Name SNMP.Client~~~~0.0.1.0 -LimitAccess -Source \\msk-fs01\Distr\Windows-FOD\Win11\

Настройка службы SNMP в Windows Server и Windows 10/11

Вы можете настроить параметры службы SNMP в консоли services.msc. Найдите службу SNMP Services в списке и откройте ее свойства.

Обратите внимание, что у службы SNMP есть несколько дополнительных вкладок:

  • Agent
  • Traps
  • Security

На вкладке Agent указывается базовая информация об устройстве (контакты администратора, местоположение). Здесь же можно указать тип информации, который может отправлять данное устройство при SNMP опросе.

Базовые настройки службы SNMP в Windows

В старых версиях протокола SNMP (SNMP v.1 и SNMP v.2) для авторизации пользователя используется строка сообщества (community string). На вкладке Security можно создать несколько строк подключения.

Можно выбрать один из пяти уровней доступа для сообщества:

  • READ ONLY — позволяет получать данные с устройства;
  • READ WRITE — позволяет получать данные и изменять конфигурацию устройства;
  • NOTIFY — позволяет получать SNMP ловушки;
  • READ CREATE – позволяет читать данные, изменять и создавать объекты;
  • NONE

Вы можете создать несколько community string. Для этого нужно задать имя и выбрать права/ Для мониторинга состояние сервера достаточно выбрать READ ONLY.

В списке Accept SNMP packets from these hosts можно указать имена/IP адреса серверов, которым разрешено опрашивать данное устройство. Если вы не хотите ограничивать список разрешенных устройств, оставьте здесь Accept SNMP packets from any hosts.

Разрешить доступ к Windows через SNMP, создать community string

На вкладке Traps указываются адрес серверов, на который SNMP агент должен отправлять SNMP-ловушка (SNMP trap). SNMP Trap это широковещательный USP пакет, используемый для асинхронного уведомления менеджера (например, сообщение о критическом событии).

Не забудьте открыть в Windows Defender Firewall правила, разрешающие входящий и исходящий трафик для SNMP запросов и ловушек (TRAP). Нужные правила фаейрвола можно включить с помощью PowerShell.

В Windows Firewall есть несколько готовых правил для SNMP трафика:

Get-NetFirewallrule -DisplayName *snmp* |ft

  • SNMPTRAP-In-UDP
  • SNMPTRAP-In-UDP-NoScope
  • SNMP-Out-UDP
  • SNMP-In-UDP-NoScope
  • SNMP-Out-UDP-NoScope
  • SNMP-In-UDP

Можно включить все правила, или только определенное:

Get-NetFirewallrule -DisplayName *snmp* | Enable-NetFirewallRule

Get-NetFirewallrule SNMP-Out-UDP | Disable-NetFirewallRule

Правила Windows Defender Firewall для SNMP трафика

В списке служб Windows есть еще одна служба SNMP Trap. Она используется для получения сообщений от других SNMP агентов и пересылки на SNMP сервера (обычно это система мониторинга, опрашивающая устройства по SNMP, например PRTG или Zabbix).

Если вы настраиваете SNMP на Windows Server Core, вы не сможете использовать графический интерфейс службы SNMP для настройки ее параметров. Вместо этого придется вносить изменения в реестр с помощью PowerShell. Настройки службы SNMP хранятся в ветке реестра HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters.

Следующие команды зададут описание агента:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent" -Name "sysContact" -Value "[email protected]" -PropertyType REG_SZ
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent" -Name "sysLocation" -Value "MSK_Datacenter1" -PropertyType REG_SZ

Для каждой ловушки SNMP придется создать отдельный ключ в HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration с именем community.

New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration\public1"

Укажите разрешения для community:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" -Name "public1" -Value 4 -PropertyType DWord

Возможные значения:

  • 1 — NONE
  • 2 — NOTIFY
  • 4 — READ ONLY
  • 8 — READ WRITE
  • 16 — READ CREATE

Для каждого community можно указать список серверов, с которых разрешено принимать запросы:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers" -Name "1" -Value "server1.winitpro.ru" -PropertyType REG_SZ

Перезапустите службу SNMP для применения новых настроек из реестра:

Get-Service SNMP|Restart Service

Если нужно распространить эти SNMP настройки на множество компьютеров/серверов Windows в домене, используйте возможности внесения изменений в реестр через GPO.

Проверить работу службы SNMP можно с помощью утилиты snmpwalk (доступна в любом Linux дистрибутиве):

# snmpwalk -v 2c -c public1 -O e 192.168.13.122

В этом примере мы опросили наш Windows хост через версию протокола SNMPv2.

snmpwalk опрос Windows через SNMP

Утилита вернула базовыую информацию о хосте (syscontact, sysname, syslocation) и довольно большое количество информации о состоянии сервера Windows.

Introduction

The Simple Network Management Protocol (SNMP) is a popular protocol for network management. It is used for collecting information from network devices, such as servers, printers, hubs, switches, and routers on an Internet Protocol (IP) network. SNMP protocol is the most common protocol used in monitoring system, usually have ability to connect to any servers and receive performance counters data (such as CPU or RAM usage values).

Let’s Get Started. 🙂

1 – Open the Server Manager, click Add roles and features and proceed installation until you reach the Features page. Check the SNMP Service in the list of features.

snmp1 (5)snmp1 (6)snmp1 (7)snmp1 (8)snmp1 (9)snmp1 (10)snmp1 (11)

2 – Select the SNMP Service then Install the installation process will start.

snmp1 (3)snmp1 (4)

3 – Once the installation complete, click Close.

snmp (11)

4 – Open the Server Manager then click Tools select Services.

12

5 – Open the Services window, find the SNMP Service, and open Properties.

Screenshot (14)Screenshot (15)

6 – On the General tab, be sure to select Automatic in the Startup Type section so that it is always available even after a restart of the Server.

Screenshot (16)

7 – On the SNMP Service properties, Click on the Security tab.

Screenshot (17)

8 – To configure SNMP Services, first thing is to give a community name. Enter a Community Name and click on the Add button. For example, i’m used NewHelpTech. Community String and Community Name mean the same thing. (Please take note that don’t assign Read Write rights, just assign Read Only rights)

Screenshot (18)Screenshot (19)Screenshot (20)

9 – Then Select Accept SNMP packets from these hosts option and then click Add to add Hostname, IP Address of the Monitoring Server.

Screenshot (20)Screenshot (21)Screenshot (22)

10 – Just click OK and then restart SNMP Service.

Screenshot (24)Screenshot (25)

Now you have to configure SNMP Service in order to be useful for polling process that will be started from monitoring tool. Next article will be about configuring SNMP service.

Good luck! Just give it try – I’m sure you’ll love it as well. If you have any comments or questions on feel free to contact me.

That’s all for now. 🙂

Hi friends, this time I will share something that might enlighten you when you want to install SNMP agent on Windows Server 2019. 

In the case I presented in this post, the firewall on Windows Server 2019 is disabled, so there is no need to configure UDP port settings for PRTG. My goal is to install this SNMP agent so that the system or server with Windows Server OS can be monitored with PRTG.

Okay, let’s get started with the easy steps. Follow the instructions I’m about to give you below so that the SNMP service can run and be used on Windows 2019.

Step 1 – Install SNMP On Windows Server 2019

Open the Server Manager - Click Manage - Choose Add Roles and Features
Installing SNMP on Windows Server 2019
Installing SNMP on Windows Server 2019

Now, you will be presented with several wizards. You just need to click ‘Next’ until you reach the ‘Features’ wizard.

Before you begin : Next 
Before you begin
Before you begin
Select installation type : Next
Select installation type
Select installation type
Select destination server : Next
Select destination server
Select destination server
Select server roles : Next
Select server roles
Select server roles

We have reached the ‘Features’ wizard because we are going to install SNMP, and SNMP is part of the features of Windows Server 2019.

Features : Checklist SNMP Service - Klik Add Features
Add Features
Add Features
Features : Next
Features
Features

Okay, now we have reached the final step of the installation. Just click and wait until it’s finished.

Confirm installation selections : Install
Confirm installation selections
Confirm installation selections
Installation Progress : Close
Installation progress
Installation progress

Step 2 – Configure SNMP On Windows Server 2019

The SNMP installation process has been successful. Now it’s time to move on to the next step, which is configuring SNMP. You might wonder why it needs to be configured. Well, usually, PRTG network monitoring is on a different server but within the same network. By default, the SNMP agent can only be accessed by the localhost.

In this case, we want to configure the agent to be accessible by other IP addresses within the same network using the desired community string.

Run : windows + r - type services.msc - click ok
services.msc
services.msc

Here is where we will configure it according to our desired settings, based on the case I explained earlier. Just follow the steps.

services : double click SNMP Service - choose Security tab - klik Add - type community name "kitsake" - Klik Add - Checlist Accept SNMP packets from any host - Apply - Ok
SNMP Service Properties (Local Computer)
SNMP Service Properties (Local Computer)

The configuration step is complete, and now you just need to restart the service to apply the configuration changes we made earlier.

services : right click SNMP Service - Click Restart
Restart Service SNMP
Restart Service SNMP

Step 3 – Add Device to PRTG Network Monitor

After SNMP has been successfully installed and configured on Windows Server 2019, it’s time to add it to PRTG and monitor the utilities of that Windows Server 2019 using the SNMP sensor.

The steps to add the device are as follows:

Group on PRTG : right click on Group Add Device
Add Device
Add Device
Add Device : on Credentials for SNMP Devices type community name "kitsake" - Click Save
Setting Credentials for SNMP Devices
Setting Credentials for SNMP Devices

Step 3 – Add Sensor on Device to PRTG Network Monitor

Next is to add several sensors that will be displayed.

Device : Right Click Add Sensor
Add Sensor
Add Sensor

Search for sensors based on the keyword ‘SNMP’.

Search Sensor : type snmp
Choose sensor what you want added to PRTG Network Monitoring with snmp sensor
Choose sensor what you want added to PRTG Network Monitoring with snmp sensor

In my example, I added a disk for monitoring, and you can select which partition you want to monitor.

Select Disk : Checklist on Disk C - Click Save
Sample sensor disk with agent snmp
Sample sensor disk with agent snmp

And here are the results of several sensors that use SNMP to monitor the utilities on Windows Server 2019.

Result on PRTG Network Monitoring for Device Windows Server 2019
Result on PRTG Network Monitoring for Device Windows Server 2019

Maybe that’s all I can share with you guys, hopefully this article will be useful.

Thank You 

SNMP (Simple Network Management Protocol) is a classic protocol for monitoring and collecting information about network devices (servers, network hardware, workstations, printers, etc.). SNMP is quite a lightweight and fast protocol, it uses UDP ports 161 and 162 to transfer data. In this article, we’ll show how to install and configure SNMP service on Windows Server 2022/2019 and Windows 10/11.

Contents:

  • How to Install SNMP Service on Windows Server 2022/2019?
  • Installing SNMP Agent on Windows Server Core
  • Enabling SNMP Service in Windows 10/11
  • How to Configure SNMP Service on Windows?

How to Install SNMP Service on Windows Server 2022/2019?

In Windows Server, you can install the SNMP service using Server Manager. Select Add roles and features -> Features. Click SNMP Service (if needed, also check SNMP WMI Providers).

The SNMP WMI Provider allows you to query an SNMP device via WMI.

install snmp service on windows server 2019

Click Next -> Install and wait till the installation is over.

Installing SNMP Agent on Windows Server Core

In Windows Server Core, you can install SNMP using the Windows Admin Center web interface or PowerShell.

If you are using the Windows Admin Center, connect to your Windows Server host, and select Roles and Features -> SNMP Service.

install snmp server using windows admin center

Since there is no graphical interface on Windows Server Core and the Server Core host can be managed from the  command prompt, you can install the SNMP service using PowerShell.

You can use the Install-WindowsFeature PowerShell cmdlet to install roles and features on Windows Server.

Check that the SNMP service is not installed:

Get-WindowsFeature SNMP*

powershell: check snmp service

Install the SNMP role and WMI provider:

Install-WindowsFeature SNMP-Service,SNMP-WMI-Provider -IncludeManagementTools

Make sure that SNMP services are running:

Get-Service SNMP*

In our example, the SNMP service is running, and SNMPTRAP is stopped.

snmptrap service on windows

Enabling SNMP Service in Windows 10/11

You can use the SNMP service not only on Windows Server but also on Windows 10 and 11 desktops. In Windows 10/11, the SNMP service is a part of the Features on Demand (like RSAT or OpenSSH).

You can install SNMP via the Settings panel. Go to Apps -> Optional features -> Add an optional feature -> View features.

Select Simple Network Management Protocol (SNMP) and WMI SNMP Provider in the list of available components. To start the installation, click Next (you will need an Internet connection to Microsoft servers).

installing Simple Network Management Protocol (SNMP) on Windows 11

To install the SNMP service using PowerShell, run the command below:

Add-WindowsCapability -Online -Name SNMP.Client~~~~0.0.1.0

To install the SNMP service offline (without an internet connection), download the Windows 10/11 Features on Demand ISO image from your account on the Volume Licensing Service Center (VLSC) website.

To install SNMP from the ISO image offline, use this command:

Add-WindowsCapability -Online -Name SNMP.Client~~~~0.0.1.0 -LimitAccess -Source \\munfs01\Distr\Win11\FoD

How to Configure SNMP Service on Windows?

You can configure the SNMP service options with the services.msc console. Find the SNMP Service in the list and open its properties.

Note that the SNMP service has some additional tabs:

  • Agent
  • Traps
  • Security

The Agent tab contains basic information about the device (administrator contact information, location). Here you can also select the type of information that the device can send when polling via SNMP.

snmp agent contact info

In earlier SNMP protocol versions (SNMP 1 and SNMP 2), a community string is used for authentication. In the Security tab, you can create multiple connection strings.

You can select one of five available access levels for the community:

  • READ ONLY — allows getting information from a device
  • READ WRITE —get information and edit a device configuration
  • NOTIFY — allows receiving SNMP traps
  • READ CREATE – to read data, change, and create objects
  • NONE

You can create multiple community strings. To do it, enter a name and select the permissions. To monitor the server state, the READ ONLY privilege is enough.

In the Accept SNMP packets from these hosts list, you can enter the names or IP addresses of the hosts allowed to query the device. If you don’t want to use the allowed device list, leave Accept SNMP packets from any hosts here.

snmp community string and list of allowed hosts

The Traps tab allows setting the list of the hosts to which the SNMP agent should send SNMP traps. An SNMP Trap is a broadcast UDP packet used for asynchronous notification of the manager (for example, a notification about a critical event).

Remember to create rules allowing inbound and outbound traffic for SNMP queries and traps in your Windows Defender Firewall. You can enable firewall rules with PowerShell.

There are several predefined rules for SNMP traffic in Microsoft Defender Firewall:

Get-NetFirewallrule -DisplayName *snmp* |ft

  • SNMPTRAP-In-UDP
  • SNMPTRAP-In-UDP-NoScope
  • SNMP-Out-UDP
  • SNMP-In-UDP-NoScope
  • SNMP-Out-UDP-NoScope
  • SNMP-In-UDP

You can enable all rules or just a specific one:

Get-NetFirewallrule -DisplayName *snmp* | Enable-NetFirewallRule
Get-NetFirewallrule SNMP-Out-UDP | Disable-NetFirewallRule

list windows defender snmp rules with powershell

There is the SNMP Trap in the list of Windows services. It is used to receive messages from other SNMP agents and forward them to SNMP servers (usually it is a monitoring system querying devices using via, for example, PRTG or Zabbix).

If you configure SNMP on Windows Server Core, you won’t be able to use the SNMP service GUI to set its settings. You will have to make changes to the registry using PowerShell instead. SNMP service settings are located under the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters.

The following commands will set the agent description:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent" -Name "sysContact" -Value "[email protected]" -PropertyType REG_SZ
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent" -Name "sysLocation" -Value "MUN_DCn2" -PropertyType REG_SZ

You will have to create a separate key with the community name under HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration for each SNMP trap.

New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration\public1"

Set the community permissions:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities" -Name "public1" -Value 4 -PropertyType DWord

Possible values:

  • 1 — NONE
  • 2 — NOTIFY
  • 4 — READ ONLY
  • 8 — READ WRITE
  • 16 — READ CREATE

For each community, you can set a list of hosts they are allowed to accept queries from:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\PermittedManagers" -Name "1" -Value "mun-mon1.woshub.com" -PropertyType REG_SZ

Restart your SNMP service to apply new settings from the registry:

Get-Service SNMP|Restart Service

If you want to deploy the SNMP service settings to multiple Windows computers/servers in your domain, use Group Policy Preferences to modify the registry.

To make sure if SNMP is working, use the snmpwalk tool (available in any Linux distro):

# snmpwalk -v 2c -c public1 -O e 192.168.12.200

In this example, we have polled our Windows host using SNMPv2.

snmpwalk - test SNMP service connection on Windows

The tool has returned basic host information (syscontact, sysname, syslocation) and a lot of data on the Windows server state.

The simple network management protocol (SNMP) is the most commonly used for network management. It is used for grouping data from several devices more precisely network devices like printers, switches, hubs, IP networks, and servers. The most common protocol used in monitoring devices is SNMP as it can be connected to any device or server and can gather information from any source of data it being CPU, RAM, or any other device.

PROCEDURE:

  1. From Server manager use the App roles and features option and go on the tabs until you reach the option of SNMP in the features

2- By selecting the SNMP service you will continue to install

3- When the installation is done close the program.

4- After installing, select Services from tools of the server manager.

5- From Services tab open SNMP and its properties

6- Make sure that you select the Automatic from the startup section in the General tab so that it remains available even after restarting.

7- Open security tab on SNMP server

8- To get services you have to assign a community name as help tech is used by me. Please make sure to assign READ ONLY RIGHTS.

9- Then select packets from host options and add further information as hostname and IP address.

10- You are done! Select OK and restart.

You have to design an SNMP service in such a way that it could monitor any device and when it’s ready to gather information.

  • Настройка realtek hd audio для windows 10
  • Настройка samba debian для windows
  • Настройка radius server на windows 2016 для wifi
  • Настройка ntp сервера windows server 2019
  • Настройка realtek pcie gbe family controller для windows 10