Мониторинг windows с помощью snmp

Как установить стандартную службу SNMP в Windows и настроить мы разобрали тут Установка и настройка службы SNMP в Windows
Стандартный Шаблон ОС Windows SNMPv2

Теперь перейдем к пункту как получать с нее данные.

Неполный список MIB, которые поставляются с системой.
Они устанавливаются вместе со службой SNMP в каталоге %systemroot%\system32
Полный список баз MIB см. в наборе ресурсов Windows.

В моем случае были следующие MIB: Для Windows 10 x64 и один в один Server 2008 R2
accserv.mib 14кб
authserv.mib 15кб
dhcp.mib 4кб
ftp.mib 6кб
hostmib.mib 48кб
http.mib 21кб
inetsrv.mib 1кб
ipforwd.mib 15кб
lmmib2.mib 26кб
mcastmib.mib 30кб
mib_ii.mib 107кб
msft.mib 1кб
msipbtp.mib 13кб
msiprip2.mib 34кб
rfc2571.mib 22кб
smi.mib 4кб
wins.mib 26кб

Скачать

Зависимости
FROM SNMPv2-SMI
FROM SNMPv2-TC
FROM SNMPv2-CONF
FROM RFC-1212
FROM SNMP-FRAMEWORK-MIB +
FROM RFC1155-SMI +
FROM RFC1213-MIB +
FROM MSFT-MIB +
FROM INTERNETSERVER-MIB +
FROM WINS-MIB +

Переименовал для удобства если выходит какая ошибка.
Стало — было
RADIUS-ACC-SERVER-MIB.mib — accserv.mib 14кб
RADIUS-AUTH-SERVER-MIB.mib — authserv.mib 15кб
DHCP-MIB.mib — dhcp.mib 4кб
FTPSERVER-MIB.mib — ftp.mib 6кб
HOST-RESOURCES-MIB-WIN бы такая но внутри разные HOST-RESOURCES-MIB.mib — hostmib.mib 48кб
HTTPSERVER-MIB.mib — http.mib 21кб
INTERNETSERVER-MIB.mib — inetsrv.mib 1кб
RFC1354-MIB.mib — ipforwd.mib 15кб
LanMgr-Mib-II-MIB.mib — lmmib2.mib 26кб
IPMROUTE-MIB.mib — mcastmib.mib 30кб
RFC1213-MIB.mib — mib_ii.mib 107кб
MSFT-MIB.mib — msft.mib 1кб
MSIPBOOTP-MIB.mib — msipbtp.mib 13кб
MSIPRIP2-MIB.mib — msiprip2.mib 34кб
SNMP-FRAMEWORK-MIB.mib — rfc2571.mib 22кб
RFC1155-SMI.mib — smi.mib 4кб
WINS-MIB.mib — wins.mib 26кб

Скачать:

Описание для некоторых Mib
lmmib2.mib — это частный MIB для серверов Windows.
dhcp.mib — Определенная Microsoft MIB, содержащая типы объектов для мониторинга сетевого трафика между удаленными узлами и DHCP-серверами.
hostmib.mib — Содержит типы объектов для мониторинга и управления ресурсами хоста.
lmmib2.mib — Охватывает службы рабочих станций и серверов
mib_ii.mib — Содержит информационную базу управления (MIB-II), которая обеспечивает простую работоспособную архитектуру и систему для управления Интернетом на основе TCP/IP.
wins.mib — Определенная Microsoft MIB для службы имен Интернета Windows (WINS)
База сведений об управлении SNMP (MIB)

Дополнительная информация:
Windows NT: обычно можно скопировать MIB из агента расширения SNMP, который поддерживает конкретный MIB. Некоторые дополнительные базы MIB доступны в комплекте ресурсов Windows NT 4.0.

Библиотеки DLL агента расширения для MIB-II, LAN Manager MIB-II и MIB ресурсов хоста устанавливаются вместе со службой SNMP. Библиотеки DLL агента расширения для других MIB устанавливаются при установке соответствующих служб. Во время запуска службы служба SNMP загружает все библиотеки DLL агента расширения, перечисленные в реестре.

Пользователи могут добавлять другие библиотеки DLL агента расширения, которые реализуют дополнительные MIB. Для этого они должны добавить запись реестра для новой библиотеки DLL в службе SNMP. Они также должны зарегистрировать новую MIB в приложении консоли управления SNMP. Дополнительные сведения см. в документации, прилагаемой к вашему приложению консоли управления.

Microsoft назначено пространство имен 1.3.6.1.4.1.311, определенное в MSFT.MIB. Microsoft имеет право назначать имена объектам в любом месте ниже этого пространства имен.

Идентификатор объекта в иерархии записывается как последовательность субидентификаторов, начинающаяся с корня и заканчивающаяся на объекте. Подидентификаторы разделяются точкой.

Возьмем пример: Мониторить состояние запущенных в Windows служб через SNMP
используя MIB, кажется, что вы можете получить статус каждой службы, обратившись к LanMgr-Mib-II-MIB::svSvcOperatingState, Я боролся с доступом к OID, который включал «строку имени службы».

Сразу напишу такое
Сама функция агента SNMP является услугой, официально предоставляемой MS. (—> Когда я обратился на форум MS, мне ответили, что «работа по SNMP не рекомендуется»…)

Изначально я нашел очень много инфы на такой вид запроса

Код: Выделить всё

snmpwalk -v 2c -c public IP:Port LanMgr-Mib-II-MIB::svSvcOperatingState["index","LanMgr-Mib-II-MIB::svSvcName","Имя Службы"]

Пример:

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcOperatingState["index","LanMgr-Mib-II-MIB::svSvcName","Zabbix Agent"]

Или по OID

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 1.3.6.1.4.1.77.1.2.3.1.3[index,1.3.6.1.4.1.77.1.2.3.1.1,"Zabbix Agent"]

И в ответ я должен был получить статус запрошенной службы
Рабочий статус сетевой службы:
активный(1)
ожидающий продолжения(2)
ожидающий паузы(3)
приостановленный(4)

Но приходил все к ошибке, разберем более детально:
Используем файл mib для запроса: LanMgr-Mib-II-MIB
Параметр: SvSvcOperatingState — Вы можете получить статус службы
LanMgr-Mib-II-MIB::svSvcOperatingState — объект, возвращающий рабочее состояние службы.
LanMgr-Mib-II-MIB::svSvcName — который возвращает имя службы.

По раздельности запросы выполнялись

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcOperatingState

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcName

получаем ответ
LanMgr-Mib-II-MIB::svSvcName.»Zabbix Agent» = STRING: «Zabbix Agent»
LanMgr-Mib-II-MIB::svSvcName.»…………» = Hex-STRING: D0 A1 D0 B5 D1 80 D0 B2 D0 B5 D1 80

Русские символы в Hex формате.

Так же можно запросить данные по всем mib и выгрузить их в файл:

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 >> Host3.log

Наткнулся на японскую статью по запросам служб windows snmp Японский Вариант статьи

Оказалось что имя службы не воспринимается для Английского языка имя службы нужно преобразовать в Десятичную систему ASCII
И синтаксис команды запроса будет другим.

Однако кажется, что часть символьной строки необходимо преобразовать в код ASCII. ( Я использовал этот сайт Преобразователь кода ASCII)

Видео подробно о кодировках

В десятичное число переводим имя

Skype for Business Server XMPP Translating Gateway
Получаем в 10тичной
83 107 121 112 101 32 102 111 114 32 66 117 115 105 110 101 115 115 32 83 101 114 118 101 114 32 88 77 80 80 32 84 114 97 110 115 108 97 116 105 110 103 32 71 97 116 101 119 97 121

Когда строка символов преобразуется
svSvcOperatingState.○.83.107.121.112.101.32.102.111.114.32.66.117.115.105.110.101.115.115.32.83.101.114.118.101.114.32.88.77.80.80.32.84.114.97.110.115.108.97.116.105.110.103.32.71.97.116.101.119.97.121
становится

Вам нужно ввести длину этой строки символов в начале получаем 50
Итак, в итоге будет следующее.
svSvcOperatingState.50.83.107.121.112.101.32.102.111.114.32.66.117.115.105.110.101.115.115.32.83.101.114.118.101.114.32.88.77.80.80.32.84.114.97.110.115.108.97.116.105.110.103.32.71.97.116.101.119.97.121

Для имени Службы: APC PBE Agent
APC PBE Agent — 65 80 67 32 80 66 69 32 65 103 101 110 116
Когда строка символов преобразуется
65.80.67.32.80.66.69.32.65.103.101.110.116
Кол-во чисел 13
Получаем OID
13.65.80.67.32.80.66.69.32.65.103.101.110.116

Пробуем запросить

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcOperatingState.13.65.80.67.32.80.66.69.32.65.103.101.110.116

Ответ:
LanMgr-Mib-II-MIB::svSvcOperatingState.»APC PBE Agent» = INTEGER: active(1)

Запрос

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcName."Zabbix Agent"

В ответ ошибка
LanMgr-Mib-II-MIB::svSvcName.Zabbix Agent: Unknown Object Identifier (Index out of range: Zabbix Agent (svSvcName))

Если имя переведем в десятичную систему сформируем OID
Zabbix Agent — 12.90.97.98.98.105.120.32.65.103.101.110.116
Запрос

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcName."12.90.97.98.98.105.120.32.65.103.101.110.116"

Ответ
LanMgr-Mib-II-MIB::svSvcName.»Zabbix Agent» = STRING: «Zabbix Agent»
И ответ пришел.

Запрос

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcOperatingState."12.90.97.98.98.105.120.32.65.103.101.110.116"

или

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 1.3.6.1.4.1.77.1.2.3.1.3.12.90.97.98.98.105.120.32.65.103.101.110.116

Ответ
LanMgr-Mib-II-MIB::svSvcOperatingState.»Zabbix Agent» = INTEGER: active(1)

Ради эксперимента попробуем первый запрос с OID

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcOperatingState["index","LanMgr-Mib-II-MIB::svSvcName","12.90.97.98.98.105.120.32.65.103.101.110.116"]

Ответ
LanMgr-Mib-II-MIB::svSvcOperatingState[index,LanMgr-Mib-II-MIB::svSvcName,12.90.97.98.98.105.120.32.65.103.101.110.116]: Unknown Object Identifier

Запрос полностью в OID

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 1.3.6.1.4.1.77.1.2.3.1.3["index","1.3.6.1.4.1.77.1.2.3.1.1","12.90.97.98.98.105.120.32.65.103.101.110.116"]

Ответ
.1.3.6.1.4.1.77.1.2.3.1.3[index,1.3.6.1.4.1.77.1.2.3.1.1,12.90.97.98.98.105.120.32.65.103.101.110.116]: Unknown Object Identifier (Sub-id not found: svSvcEntry -> 3[index,1)

Еще попробуем так:

Код: Выделить всё

snmpwalk -v 2c -c public 192.168.150.3:161 LanMgr-Mib-II-MIB::svSvcOperatingState."Zabbix Agent"

Ответ
LanMgr-Mib-II-MIB::svSvcOperatingState.Zabbix Agent: Unknown Object Identifier (Index out of range: Zabbix Agent (svSvcName)
И везде получаем ОШИБКИ

Для других языков
Однако если имя службы содержит японский язык, на него нельзя будет сослаться, даже если оно будет преобразовано в код ASCII.

Ниже описана процедура подтверждения SNMP OID японской службы.

Поскольку значение, возвращаемое Snmpwalk, представляет собой шестнадцатеричное число,

Веб-конференции Skype для бизнеса Server (Hex)
Hex-STRING: 53 6B 79 70 65 20 66 6F 72 20 42 75 73 69 6E 65 73 73 20 53 65 72 76 65 72 20 57 65 62 20 E4 BC 9A E8 AD B0

↑ Возвращаемое значение для запроса имени службы.

Исследуйте только «встречную» часть строки.

Часть «Встреча» → Раскрыт код символа → UTF-8 (шестнадцатеричный)
E4 BC 9A E8 AD B0
Преобразовать в двоичный

Стандарт преобразования сайта 32 символа (1 символ полной ширины считается за 1 символ) 32.83.101.114.118.101.114.32.87.101.98.32.228.188.154.232.173.176
→ НГ

Стандарт преобразования сайта 34 символа (1 символ полной ширины считается за 2 символа) 32.83.101.114.118.101.114.32.87.101.98.32.228.188.154.232.173.176
→ НГ

Стандарт конверсии сайта 36 символов (считается по количеству элементов, а не по количеству символов) 115.115.32.83.101.114 .118.101.114.32.87.101.98.32.228.188.154.232.173.176
→ Успех

Возвращаемое значение: LanMgr-Mib-II-MIB :: svSvcOperatingState.»Skype for Business Server Web ……» = ЦЕЛОЕ ЧИСЛО : активно (1 )

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

По-видимому, когда служба не запущена, доступ к самому OID недоступен, и сторона диспетчера SNMP выдает ошибку «Такого OID нет». (Нет такого экземпляра в настоящее время не существует с этим OID)

Кроме того, похоже, что с момента остановки (запуска) службы проходит около 2 минут, пока статус не может быть обнаружен SNMP.

Вывод:
Мониторить состояние работы службы Windows можно прямо из SNMP-менеджера, но, похоже, потребуется некоторая изобретательность.

Немного из другой оперы но так же про кодировки в snmp
Аналогично например с антеннами microtik при обнаружении элементов вместо одного значения дает целую строку в шестнадцатеричных числах. Их необходимо преобразовать и получить 1 значение.

Что то вроде предобработки на JAVA

Код: Выделить всё

//разбиваем на части по разделителю "точка"
var a = value.split('.');
//последний элемент разбиваем на части по разделителю "двоеточие"
var b = a[a.length-1].split(':');
//и в цикле каждый его компонент преобразуем из HEX в DEC
for (var i=0; i<b.length; i++) {
b[i] = parseInt(b[i], 16)
}
//после чего собираем всё обратно
a[a.length-1] = b.join('.');
return a.join('.');

«Code:
.1.3.6.1.4.1.14988.1.1.1.2.1.3.c4:ad:34:50:3a:4c
При использовании в правилах LLD на входе будет не одна строка такого вида, а сгенерированный Zabbix-ом JSON, где строка такого вида — лишь одно из полей.
Поэтому логично, что скрипт ломается.»

Если в вашей среде есть старые SNMP-устройства, и их время безотказной работы отображается как дата и время в шестнадцатеричных числах. Это требует многого, чтобы фактически преобразовать эти данные во что-то более понятное.
«используйте строго»; var str = значение; alert(«str: » + str); var y256 = str.slice(0,2); var y = str.slice(3,5); var m = str.slice(6,8); var d = str.slice(9,11); var h = str.slice(12,14); var min = str.slice(15,17); var y256Base10 = +(«0x» + y256); var yBase10 = +(«0x» + y); var Год = 256*y256Base10 + yBase10; var mBase10 = +(«0x» + m); var dBase10 = +(«0x» + d); var hBase10 = +(«0x» + h); var minBase10 = +(«0x» + min); var YR = String(Year); var MM = String(mBase10); var DD = String(dBase10); var HH = String(hBase10); var MIN = String(minBase10); если (mBase10 < 10) MM = «0» + MM; если (dBase10 < 10) DD = «0» + DD; если (hBase10 < 10) HH = «0» + HH; если (minBase10 < 10) MIN = «0» + MIN; var Date = YR + «-» + MM + «-» + DD + » » + HH + «:» + MIN; Дата возврата;
С помощью предварительной обработки JavaScript вы можете получить более читаемые значения.

Преобразование SNMP «DateandTime» в метку времени

HEX в DEC

Problem to convert a data Hex-string in Zabbix Item Value

���������� Windows �������� � ������� Nagios � SNMP

� ����������, ��������������, ��� �� ��������� ������,
�������� ����������� ������ ��������� � ��������� Nagios. ���� ���� ������� ������ ��� �� ���� ������. ��� ��
����� ��������� ��� �� ������������ �� ��������� �������
����������� ����� ������ ����� ������ � ������ ������ ��������� Nagios ��� �������� ��
��������� ����������� ��� ����������� ��������� ������������ ������ Windows. ��� ���������� ����� ����� ��
�������������� ������ ��������������� ��������� NSClient, � ������ ���������� � ������� ������
check_nt.

������� �� ������ ������ ������ �����������. ��� ��������� ����������� ������ �� �����
������������ SNMP (Simple Network Management Protocol). ����������� ������, ������������� �����
��������� ���� ������, ����� ����� ��������� ��� ��������� �� ������ ������ ����������� �� ������
Nagios. ��������� ��������� ������ SNMP � ������������ ������ ��������� � Windows � ���� �������
�������� �������� ������ ��� ������ ������ �������� �����������, ���������� � SNMP. ��������, ���
����� ���� mrtg, OpenNMS, Dec PolyCenter Network Manager, HP Open View, IBM AIX NetView/600 �
����� ������ ��������� ���������� �������� �����������������.

������� ������ ���������� � ���������� ������ ����� ���������. ������ ������� �� ���������, ��������
����� ���������, ��������� ����������� ����������� ��� ������ � SNMP, ���������� �������. � ���� �������,
���������, ���������� �� ������� ���������� �����, ���������� ����������. ����� ��������� ����������� �����
����������� ����������� ������������ ������� � ����������. ������ �������������� ���������� �� ����������
��������� � �������� ��������� �������. �������� ���������� ������ ������. ��� ��� ������������, ��������
������ � ���������� �� �����. � ��������� ������� ����� ����� �������������� ������������ ����� �������.
������ � ������ ������ ���� ������ ������ �������, � ����������� ������� �� ������ ���������� ���������.
����� �������� �� ������ ���������� ��������� �����-���� �������� � ����� �� ����������. ��������, ������
��������� ����� ���� ����� �� ����� ������-���� ���������� ������ ������������ �������, ��������� ������������,
��������� ������� ������� ��� ����� ������ ����������� ��������. ��������� ���������� � �������� ��������� SNMP
���������� ��������� ������� (SNMP Trap).

��� ����, ����� �������� ��� ��������� ������ ������� ������ ������������, �����- ������������� �������
����������� ����������� ������, ����������� �������� ������ � ���������� ������ ������������. � ������
���������� ������� ������, ����������� ��� ���������� � ��������. ��������, ������ �������� ������� ������
����� ��������� � ���� ��������� ������:

  • ����� ������ � ������� ��������� ������������
  • �������� ����������
  • ���������� ������ ��������
  • ������ ������� �����
  • ���������� ������������ ���������
  • ������ ������� ��������
  • ����� ���������� ������� � �������
  • ���������� ������� � ������� ������� ��������
  • ����� ���������� ����������� �������
  • ���������� �������, ����������� ������ ���������
  • ������ IP- ������� ��� �������������, ����������� �������
  • ���������� � ������ �������, ������������ ������ �������������
  • ������� ����������� ����������� � ��������� ����
  • ������ ������� �� ���� �����������
  • ����������, ������, ��� �������, ��������� ����� ������ ���������
  • ����� ������ ����������� ������
  • ������ ��������� ����������� ������

���������� ��������� ���������� ����������. ����� �������� ��������� � ���������� SNMP
�������� ��� ����, ��� ��� ��������� �� �������������� � �������� ������������� ������� ��
����� ������, �������, � ���� �������, ������������� ����������� ��������� ������� � ������
������������. ����� �������, �������� ����� ����� �������� � ��������, ���������� �������
��������������� ������������. ��� ����, ����� ����� ��� ��������� ������� ������������, �
������� �� �������, � �������� — ������, � ��� ���� ����, ��� ������ ��� ��������� �� ����
� �� �� ������ ��������������� �������. ������ ������ �������� � ���� ������ �����������
���������� — MIB (Management Information Base)
— ������� ��������� ��������� ������ ���������
������������� �������. ��������� ��, �������� ����� ������, ����� �������� ����� ��������
������������, ��� ��� �������� � ������ ���������� ���������� ����� ���������. �����������
MIB ������� ������������ � ���� ����������� ���������. ������������ ����� ����� ������ ��������
������������� ��� ���� ���������� SNMP.

  • System — ���������� ������ � ������� (���, ����� ������ � ������� ��������� ������������)
  • Interfaces — ������ � ������� ���������� (������, ����������, ����, ������ �������,)
  • At (Address translation table) — ������� ���������� �������. ��� �� ������������. �������������� ������ ���� ������������� �� ������� ��������.
  • TCP — ������ ��������� TCP (���������� ����������, �������� � ���������� �������, ���������� ������ )
  • ICMP — ������ ��������� ������ ������������ ����������� ICMP (���������� ��������� �������� � ����������, ���������� ������ � �� ���� )
  • EGP — �������� ������ ����������� � ��������� ������������� (�������� � ���������� �������, ���������� ������)
  • UDP — ������ ��������� UDP (�������� � ���������� ���������, ���������� ������)
  • SNMP — ���������� ������ ������������ ��������� (���������� �������� � ��������� �������, ���������� ��������, ������)
  • IP — ������ � ���������������� ����� ��������� (���������� ������� �������� � ����������, ���������� ������ � �� ������������� )

� ���� ����� ������������� ������������ ����� ���������� ������ ����� ������ ���� �����������
����������. ���� ����� ��� ���������� private. � ������� ������ ����������� ����������� �����������
�������� ������ � �������� � ������, ����������� ������ ��� ����� ������������. ��� ������� ���������
�� ����������� ������� ������, ������������ ������� SNMP, ���������� �� ������ win2000rus.

��������, ��� ���� ����� ������ ����� ������ ������� � ������� ��������� ������������ �����
������ ����� �����. iso.org.dod.internet.mgmt.mib2.system.sysUpTime. ��������� ������ ������������
��� �������� ��������, ��������� � ������ ��������� �������. ��������������, ������ ����� ����
����� ���� �������� �������������.

���������� ����������� �������� �������������
iso 1
org 3
dod 6
internet 1
mgmt 2
mib2 1
system 1
sysUpTime 3

��� ������, ��� ��� �� ����� ���� ���������� ��� .1.3.6.1.2.1.1.3. ���� �
��� ������� ������ ����������, �� ����� ������������ �������� ��������� ��������� .iso.3.dod.1.mgmt.1.1.sysUpTime.

�������� �������, �� �� ����� �������� ������ �� ��������. � ����� ������ ����� ������������ ��� �
�������� �������������. ����� �������, �� �������� ���������� ���������� �����, ���������� ����������������
������, ����������� � ����� ����� �����. � ���������� ����� ���������� �� ����� �������� OID (Object identifier)
���, ������ ������� ������, «������������� �������».

� ����� � ���, ��� ������� iso.org.dod.internet.mgmt.mib2 ����������� ����� � ������ OID, �����������
����� ������ ��������� ��� ������. ��������������� ������� ����� ��������, ������� ����� ����� �����
��������� ����� ��� ������ system.sysUpTime.

�������� �� ��, ��� � ������ ����� ������ ����� ���������� ��������� ����������� ��������, �
��������� ��������� ������ ����. � ���� ������ ��� ������� � ����������������. ��������, ���
������ ������� ������ ����� system.sysUpTime ��� ���������� �������, ������ ��� ����� ������
������� ����� ���� ������ ����. � ������, ���� ��������� ������� ����, ��� ������������� ����� «0».
������ � ��� ������ ����� ��������, ����������� � ���� ���� ��� system.sysUpTime, ���� system.sysUpTime.0.

���������� �������� ������ ������ snmp

�������� �������� ���������� ����������� ������� �������� �����:

  • interfaces.ifTable.ifEntry.ifType — ��� ������� �����
  • interfaces.ifTable.ifEntry.ifIndex — ���������� ����
  • interfaces.ifTable.ifEntry.ifMtu — ������������ ������ ������ ������

������ ���� ������ �������� ������ � ������� ������, ������������� �� ����� ������.
�������� interfaces �������� ����� ���������� ������������. ������ .interfaces.ifNumber
�������� � ���� ����� «2», ��� ������� ���, ��� � ������� ����������� ��� ������� �����.
������ ����� interfaces.ifTable.ifEntry ��������� ������ ������ ������� �����������. ��
���� ���� ��� ��� ������. � ��������� ������ �� ��� ���������� ������������� ��������.
����� interfaces.ifTable.ifEntry.ifIndex ��������� ��� ����� � ����������� ���������
����������������. � ���������� ��� ����� ������������ ��� ����, ����� �� ������ �����
����� ���������� �������� ������ ������ ����������� �����. ����� �������, ����������,
��� �� ������ ������� ����� ��������� ��������� ���������� ��������:

  • interfaces.ifTable.ifEntry.ifType.16777219
  • interfaces.ifTable.ifEntry.ifIndex.16777219
  • interfaces.ifTable.ifEntry.ifMtu.16777219

�� � � ������ ������� ����� ��������� ��������������:

  • interfaces.ifTable.ifEntry.ifType.1
  • interfaces.ifTable.ifEntry.ifIndex.1
  • interfaces.ifTable.ifEntry.ifMtu.1

������������ � �������� ������, �������� � ���������, ������� ����� ��������� � ������� SNMP.

  • GetRequest — ����� ���������������� ��������. ��������� �������� ���������� ������� �� MIB. ������ � ������ ������� ����������� �� Get.
  • GetNextRequest — �������� ��������� ���������� ���������� �� �������. ���������� ���� ����� ��������. � ����� �������������� ���� ��������� ���������� ������. �� ����� ������, ����� �� ��� ������� � ������ ������. � ������� GetRequest ������ ������ ������� ���������� ������ �����. �� ��� �������� � ���, ��� �� �� �����, ������� ��� ����������� �������� ������. ��� ���-�� ��� ���������� GetNextRequest. � ������� ���� �������� �� �������� �� ����� ������ ��������. ��� ������ ��� ����������� ������ ������ �� ������ �����, �������� ������������. ����������� �������� ������ ��� GetNext.
  • SetRequest — ���� �� ��������, ������ ����� ���������� ��� ��� ������� ������ ��� �������� ������ � MIB. ����� � ��� ������� ������ ��� � ������� Set.
  • GetResponse — ����������� ������� � ����� �� ������� GetRequest, GetNextRequest, SetRequest. ���� ��� ����� �� ������ ���, �� ������ ����� ������� ����������� ������, �� � ���� �� ������, �� ������ ����� ������������� �� �������� ����������. ����� ���������������� ������ �������� ��� ���� ������� Reply ��� Response.
  • Trap — �������� ������ ���� ����������� OID, ������������ ��� ��� �������, � ����� ���������� � ��� �����, MIB ������ ��������� ������� � ������ ����� �������. ��� � ���������-�� ������, ������� �������� ������� �� ����������.

��������� ���������� ��� ��� ������� — «����� ���������» (Community Names). ��� �������� ������������
������������ ������� � ������������ ��� ����, ����� ������������, ����� ������� ������ ����� �������� ���
��� ���� ��������. ������ �� ���� ������������� ����� �������� ������ ��������� � ���� ���������� ���
����������, ����� ��� �� ����� ���������. ���� ����� �������� ��������������� �������, �� � ����������
������� � ��������� ������ ���������� ��������� ����� ���������� ������� � ������� �� ������� ���������
��������������. ����� ��������� ������ ���� ����� Read-Only, Read-Write � Trap. ���� �������� ��������
������ ������� GetRequest, GetNextRequest, �� ������ ������ ���� �� ������ ���������� Read-Only �������
����������������� � ������.

���� �� ���������� ������� �������� ������ �� ���������� ������� SetRequest, �� ��� ������ �����������
��� ����������� ������� MIB. ��� ������ ���� read-write. � ������ ����� ���������� �������� �����������
���������� ����� ���������� �� ���������� �� ������� Read-Write. �������� ��������� ����������, ������
���� ��� �������� ����������� � ������������� �����������.

� ����������� ���������� ������ ���������� Trap ���������� �� �����. ������������� ��� ������������ ���
��������������� �������� ��� ���������� ��������� ���������� ������ ��������� ������� �� ������ �����
�������. ��, ��� ������� ���� �������� ������������ ���������, ������������� � ����� ���������� ���������
����� �����.

SNMP �������� �� ������ ��������� UDP � ��� ������� � ����� ���������� ���� ����� 162. �������������
UDP � �������� ������ ��������, ��� ������ ���������� ��� ������������ ����������. ��� ���� �����������
����������� ��������� ���������� � ������� �������������� � ��������� ������� �� �������� ������. ������
SNMP ����� ������������ ����� ������ ATM, Ethernet, IPX.

����� �� �������� ������� � ������������� ��������� SNMP �������� ����� ���������, ������������� �������������
������������ �� ���������. ������ ������������� ���������� � �������� ���� ���� ������������� ��������� �����
«public». ������ �������������� ����� ��������� ������������ ������� �������� � ������������� ������� �����
���������. � ����� ������ ����� ����� ��� ����� ������������� � ��������� SNMP ������������� ����� ��������
������ � ������ �������� ������������. ������ ������� �������� ������� � ���, ��� ������ ��������� SNMP
���������� ����� ���� �������� �������. ����������, ��� ������ ������ ������ ��������� �� ��� �� � ������.
�������� ��������� ��������� � ������������� ��������� �������� �������� �������� �����. �� ������ �������
�����������, SNMP ���������������� ��� «Security Not My Problem». ��������� ����������� ���������� � ���������
������ ������ ��������� SNMP. ��� ��������������� ��������������� ������������ Symmetric Privacy Protocol (SPP),
���������� �������� �� �������������, � ����������� �� ������ Digest Authentication Protocol (DAP). �� � �� ���
���, ���� SNMP v.2 �� ���� ������������ ����������, �� ����� ���������� ���, ��� ����������� �����, ��� ������
��������, ��������� ������������ ������� SetRequest. ��� ��� ���������� ����������� ���������� ��� �������������
�� ���������. ����� �������, ����� �� ������ ������ ��������� � ������, ����������� ������ ������������. ���
����� �������� ������ �� ���������������� ������ ����� ���������� ���������� ������ ��������� SNMP �� ��������
�� ���������� ����. ��� �� ���������� ������ ���������� ���� IP ������� ����������, ������� ��������� ����������
� �������, ����������� ������ ������ ������������. ���� ����� ��������� ����� �������� ����� ��� ��� ���
��������� �����-���� ������� ������ ������ SNMP, ������ ����� �������� ������ ����� ���������� ��������.
������� ��� �����, ������� ����� ��������� ������ ������ snmp faq. � ������, ���� ����� ������ ��������
������������, ����� ���������� � ������������, ����������� ��������. ������ ���������� ����� �������� ��������
RFC 1156, 1213, 1157, 1146, 2571, 2574. �������� � ������� ������� ����� SNMP, �������� � �������������
���������� ���������� ������.

��� ����, ����� �� ������ win2000rus ���������� ������ SNMP, ����� ���������� ���������� ��������� ����������.
������� ��������� �� ������� ���� ����->���������->������ ����������. ������ ������� ����������� «���������
� �������� ��������». � ����������� ���� ���� ������ «���������� � �������� ����������� Windows».

��������� ���������� ������ snmp

������ ������� �������� «�������� ���������� � ����������».

��������� ������ snmp

�������� ������ «������» � ����������� ���������� ��� «�������� SNMP» ���� ������� ��������.

��������� ������ snmp �����������

����� ������� ������ «��» � «�����» ��������� �� ���������� �����������. �� ���������� ���� ���������
������ �����, ���������� �� ���� ������. «������ SNMP» ������ ���� ��������. ������ �� ���� �����, ���
��� ������ ������� �� ����� ��������� � ���� ���������, � ��������������, ������� �� ����� ����� ��
�����, ������� �������������, � ����� � ����� ��������� ������ «������ ������� SNMP».

��������� ������ snmp ����������� �����

����� �������� ������������� �������� ������ SNMP. ���������� Read-Only �� public ���������������
� «QWEmn90» � ���������� Read-Wrie, ������, � «Zxasd098».

��������� ������ snmp ����������� �����

������� �������� �� ��������� ����� �������� ��� ����������� � ���������� ���������� �������, ��
�������� ������������ ������������� SNMP. ������ ������, ���������� Read-Write �������� ����� ������
��������� ��������� ���������������� ����� �� ������. � ������ �����, �� ������� ����� ���������
������ SNMP, ��������� ����� ������ ������� Nagios � ����� Windows ������, ��� ����� �������� ���
���� �������� � ������� ������������. �����, ��� ����� ��� Windows — ��� ���� ���������� ������������,
������������� ������ SNMP, ��� ���� ����� ��������� � ���������� �������� � ����. ������� ����� ����
�� �������� ������ ������������� ������ SNMP, �� ������ ������������ ������ ��� �� ����� ��������.

�������� � ��������������� �����������������, ������������� � ����� ��������. ��������� �� Windows ������
������� SNMP. ��������� ��������� ������ — ��� ������, �� ��� �� ������������ ���������� ������� �� ������
SNMP ������� ��������.

��� ������������� ��� Windows ����� ����� ����������� ����� MS SMS Netmon �� ����� �������������
http://www.microsoft.com/smsmgmt/. � ���� ������������
������� �� ����� GetIf ������ 2.2,
���������� ��� http://www.wtcs.org/snmp4tpc/FILES/Tools/SNMP/getif/getif-2.2.zip.
��� ����� ������
����� �������� �����, ��, ����� �������, ������� �������� � SNMP. � ���� �������� ���� �����������
��� �� ����� ����� ����������� ������ 2.3. ���� ����� ��� ��� �� ����� �������� ��-�� ��������� �
����������. � �������� ����������� ���� ��������� ��� ������ «Next». �� ������ � ������, ��� �� �����
����������� ������������ SNMP ��������. ��� Unix — ������ ����� ������� ����� ����� http://snmpbrowser.sourceforge.net/.

� ���������� ��� ���������� ���������� ��� ������ � GetIf. �������, ��������� ������ ��������� SNMP
������ ���� ����� ������ � ���������. �������� ������� ������ ��� � ������ ���������� ����� �����������
��� ���������� SNMP ������. � ���� «Host Name» ����� ����� ���� ��� ����� Windows ������. ����� � ����
«Read commuinty» � «Write community» ������ «QWEmn90» � «Zxasd098». �������� ������ «Start». ���� ���
������ ������ ����������� �������, � �� ��������� «error» ��� «none» � ���������� ���-�� ��������
�������, ������ SNMP �������� ��������.

��������� SNMP �������� GetIf

������ ��������� � ������� MBrowser, ���� ������������ ������� ��� ��� ���������� � ����������. ���
����, ��� �� �������� ������, ���������� � �����-���� ��������, ����� ������ �������� �� ��������
�������� «iso». �������, � �������, OID iso.org.dod.internet.mgmt.mib-2.system.sysContact , ����������
�������� �������. ������ ����� ��� �������� � ������ ����� ������ ������, �������� ������ «Walk».

���������� ������� Walk � �������� GetIf

�� ������ ������ ������������ ���-�� �������� ������ ������������ ����. ������� ����������, ��� �� �����.
����� ������� ���� �������� ���������� ������� OID ���� ���� ������������� �������� ����� ������ ���� ��
������. ��� ���� ��������� ������ MIB. ������ �� ������ 4 �������������� ����, ����������� ��������� ������.
����� ��� ��� ������� (Type), ������ ����������� � ������� (Access), ������ ��������, ������� ����� ���������
������ (Enums). ��������, ��� OID, ������������ ��������� ������� ����������� .iso.org.dod.internet.mgmt.mib-2.IfTable.IfTable.IfEntry.IfOperStatus,
�������� �������� «up», «down», «testing». ����� ���� ������ ������� (Status) — �������� �� ������ ������������
��� ���. ��� ���� ��������� �������, � ������� ��������� ��������� ����������� �������� ������ ����������
�������. ���� ��������, ���, �� ����� ������, ��� ���� �� ����� �������� ������������, ���������������
���������. ���� � ���������� ������ �� ������ �������, ������ � ����� ���������������� ���������� �������������
�� ��� ���� ����� ������. ��������� ��� ������� ����, ����� ����, � ������� ������������ ���������� ��������,
����������� �� ������� ������� «Walk». ��� � ���� ���������� ��������, ����������� � ��������� ��������.
���� ���� ��������� ������ ����� �����, �������������� ����������� ��������� ������, ����������� ������
���������� �������. �������, ���� ����������� ������������� � ����� ������ ������, � �������� ���� ������
Read-Write. ��� ��� ����� �������� OID, ������������� �� ��������� � ������ ��������������. ����� ����,
��� ��� ����������� ������ ������� � ���� ��������������, ���� ������ «Set» � ������� �� ���������. ������
������� �����, ��� �� ����� �� ������ ������������� ������, �� � �������� ����� ������������� ��. ����� ���,
��� �����������, ��������������� ��� ���������� GetIf, ����� ���� �������, �� ���-��� ��� �� ����� ��������.
��������, ��������� ���� MIB, ������� ��� ����������, ������ ��� � ��������� MIB ������������ �� ��������� ��
������� ������ �������� ������ OID. ����� ����� ����������� ��� MIB �����
http://www.wtcs.org/snmp4tpc/FILES/Tools/SNMP/getif/GETIF-MIBS.ZIP.
������������� ��� �� ��������� ����������,
����� ��� ����� � ����������� .mib �������� � �����, ��� � ��� ����������� ��������� GetIf. ������
��� C:/Program Files/GetIf 2.2/Mibs/. ����� ����������� ������� ���� .index, ���������� ������ ����
������ ������, � ������� ��������� MIB. ��������� Getif, ���� .index ����� ������ ������ � ��������
����� ������� MIB ������ �������������. ��������� �� ������� MBrowser, �������� ������� ��������� ����������
� ���� ����. ���� �� ����� ������ ��� ������, �� ����� ������������ ������������ ������ ���������:

  • Mib_ii
  • MIB_II_TRANSMISSION
  • RFC_BASE_MINIMUM
  • PRIVATE_ENTERPRISES/Microsoft_win2k
  • PRIVATE_ENTERPRISES/Microsoft_Apps

�������� ��������� ����� �� ������, ������� OID, ���������� ������ � �������� ����������.

.iso.org.dod.internet.mgmt.mib-2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad

� ���������, ������, ��������������� Windows ��� ������� ����� SNMP, ��� ��� ������� ������. ��������
�� ����� ����� ������������� ������� ���������, ������������ ������ ���������� ������. ����� �������,
����� ������ ��������� ������������������ (performance counters), � ������� ��� ���� � ������ �����
���� ������, ���� �������� ��� ����� SNMP. �������� ��������� ��������� ������� ����� � �������
���������, ���������� SNMP4W2K. ��� Windows NT, ��������������, ��� ����� ���������� SNMP4NT. ���
��������� ������������� �������� ���������������� � ���� ���������. ���������� ����������� ������
���������� SNMP4W2K-STD � SNMP4NT-STD. ��������������, ������� ������ ������� SNMP4W2K-PLUS � SNMP4NT-PLUS.
� ����� � �������� ������ �� ���� Windows NT ,� ����� � �� ������� ������ SNMP4NT-PLUS, ����� �������
������� �� � ��������� ������. ����� ��� ����������� �� ������� �������� �� ����� ������� ��� ��������.
������� ����� �������� ������� � �������� ���� MIB � ��������� 50$ �� ���� ��������. ���������� ������,
����� �������� ���������� ����������� ���������, �������� ��� � �������� ��������� �������� Windows:

  • Print Services
  • SMTP Services
  • NNTP Services

������� ������ ��������� ����������� �������� �� ����������, � ������� ���������� ������ ��������� �����:

  • SQL Server 2000
  • Exchange Server 2000
  • ISA Server
  • Media Services
  • Active Directory
  • IIS Global Services

����� ��� ������� ������, ��������������� ����������� �������, ������� � ���� ������������ ������ ��.
��������� ������ ����������� SNMP4W2K.
��������� ������������ � ������� ���������������� ������, �������� ������ ����� ���������� �������� � �����
������ ��� Window NT ����� �� ����� ������ http://www.wtcs.org/snmp4tpc/.
�� � ������ ������� ������ ���������� � ��������� «������» � «��� ��� ��������».

����� ������ SNMP4W2K

��������� ��������� ���������� ������� SNMP, �� �������� � Windows ���� ������������� ����������
SNMP perfmib.dll, �������, �������� �� ���� mib.bin � ������������, ����������� � ����� perfmib.ini,
��������� ��� �������� ������ � �������� ������������������. ������������ ����� ��������� ������������������
� OID �������� � ���� mib.bin. ���������� �����������, ��������� � ����������� � ����������� ���������
SNMP4W2K-STD. ��������� ���� SNMP4W2K-STD.exe. ������������ � ��������� ��������, �������� ����������
��� ����������� C:\Program Files\SNMP4W2K-STD\. ��� ������ ������ ����������� ������ ���������� ��������,
��� ����� ���������� ��� ����� «View Readme File» � «Run Installed Application». ������������ �����
��������� ������ ����� � �������� «��». ����� ����� �������� ���� ���������� �������������� � �����������
���������, ������� ����� ��������. ���������� � �������, ������������ �� ���������, ����� ����� ������
��������� ��� ������� «Y». ��������� ����������� �������������� ������ ��������� � ������ � ������������
������ SNMP. ���� ������� SNMP ��������, ��������� ���. ��� ����, ����� ����� �����, ����������� SNMP4W2K,
��������� � GetIf, ����� ����������� MIB ����� ��������� SNMP4W2K, ����������� � ����������
C:\Program Files\SNMP4W2K-STD\Mibs\ � ����������, ��� ����� ���� MIB ������ ��������
C:\Program Files\Getif 2.2\Mibs\. ����� ������� ���� .index �, �������� GetIf, ���� ���������� ������
.iso.org.dod.internet.private.enterprises. ��� ��������, ����������� ������ ���, ��������� ���������
SNMP4W2K. ����� �������� �������� �� ���� �������� ������ SNMP4W2K. ��������, ���� �� ������ ��������
� ������� ������� ��� ���������, ���������� ������ ����� SNMP4W2K, �� ��� ����� ������� ���������� ����
��������� � ������ ����� ������� SNMP4W2K. ����� ������ ������ ������� — ������ IIS. ���� ��� �����������
����� SNMP4W2K, �� ������������ OID, ������ ������ � �� ���������� ������, �������� �� �����, ������ ���
SNMP4W2K � ������ ����������� �� ����� �� ������ ������ IIS, � ������ �����, ��� ���������� ������ �������
MIB �� �����. ���� �� ��������� �������� — ������� ���������� IIS, � ����� SNMP4W2K, �� ��� ����� ��������
��� ��������. �� �������� ���� �������� ����� ������������ �������� �� ���� ��� �������� �������. ��� �����
��� ������� ���������� ����������������� ��������� SNMP4W2K.

��� ��� �� ���� ������ ��� �������� ����� WINS, SMTP, DNS �� ����������� �������� ��� ����������
���������� ��������� � �������� �����
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.

������� �����������, ����� OID �� ����� ������������ ��� ����� ����������� ��� ������.
� �������, �������� ���������� ����� ������ � ������� ������ OID:
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.cpuprocessorTable.cpuprocessorEntry.cpuPercentProcessorTime.

� ���������, ������� ������������� SNMP �� ��� �� � �����. ��� ����, ����� ������� ���������� �������
����������� ������, ��� �������� �������� ��������� �������. ����� ���������� OID .iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.memmory.memmoryCommitLimit,
��������������� ���������� �������� «\������\������ ���������� ����������� ������», ����� ��� �� 100
� �������� ��������, ������������, ������� ���� ����������� �� ���� ������� ������. � ���� ������
���������� �������� 3.184.967 ����. ������ ������� �����, ��� �� ���� ������ ���� ������� ��� �����
��� ��������� ������. �������� ������ � ���������� ��������������� ������
.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.memmory.memmoryCommittedBytes,
��������������� �������� «\������\���� ���������� ����������� ������». � ���� ������� ���
53776337 ����. ����� ���������� �������� �� ������ ������ ��������, ������� 3184967 ����,
� �������� 16.88%. ������, ��������� ������ ��� ����������. ������ ����� �������� ��������
�� ����� ������������ ��� ��������� ������� ������������ ��������� 90% — 286647030 ���� �
������ �������������� 80% — 254797360 ���� ��� �������, � ������� �������� Nagios ����� �������
�� ������������ ������.

��������� ������, �� ������� ����� ������� — ��������� ����� �� ������� ������ Windows ������. � ���������,
��� ��� � �� ������� ��������� �������� ����� .iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.pdiskphysicalDiskTable
� .iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.ldisklogicalDiskTable,
���������� �� ���������� ���������� ������� ������ � ���������� ���� �������� ������. �� ���������� �� �����
������ �� �����. ������ OID, ��������� SNMP4W2K, �� ����� ������������ ����������� �����
.iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable. ������ ����� ���������� � �����
.iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr ����� ������,
����� �� ��������� ��� ����������. ��������� OID hrStorageDescr, ������ ��������� �������� ��������,
������������ ������ �������, �������������� � ���� �����.

��� ������� ����������
hrStorageDescr.1 A:\
hrStorageDescr.2 C:\ Label: Serial Number 445c03ba
hrStorageDescr.3 D:\
hrStorageDescr.4 Virtual Memory

��� �� �����, ������ ����� 1 — ��� �������� ������ ������, � ������ 2 � 3 — ��������������, C:\
— ������� ���� � D:\ — CD-ROM. ����� ��������� ����� 4, �������������� ������, ���������� ������ �
���������� ��������� ����������� ������. ���� �� ������ ������� ������ � ���������� � OID
hrStorageAllocationUnits, ������������ ������ � ������ ������ ����� ������ ������� �� ������������� ���������.

��� ������� ����������
hrStorageAllocationUnits.1 0
hrStorageAllocationUnits.2 2048
hrStorageAllocationUnits.3 0
hrStorageAllocationUnits.4 65536

�������� �� ������� ����������� ���� ����� ������� ����� ���, ������ ����� ��� ����� C:\
����� 2048 ������, � ��� ����������� ������ ������������� 65536 ����. ������ ����� ������ �����
������ ������ ������� �� ������������� ���������, ��������� OID hrStorageSize.

��� ������� ����������
hrStorageSize.1 0
hrStorageSize.2 1044209
hrStorageSize.3 0
hrStorageSize.4 4859

����� ��������, ��� ������ ��������� � ������, � ������� �� �������� �����. ������, ����� ������ ������
����� C:\ � ������, �������� hrStorageAllocationUnits.2 �� hrStorageSize.2 � � ���������� ���� ���� ����������
�������� �����, �������� ������ ���� ����������. ����� �� �������� ��������� ������ ����������� ������ �
�������� 318439424 �����. ������ ��������, �������� � ������ ��������. ������ � ���, ������� ������ ���
�������������, ��������� ������ hrStorageUsed.

��� ������� ����������
hrStorageUsed.1 0
hrStorageUsed.2 418859
hrStorageUsed.3 0
hrStorageUsed.4 0

��� ��� �������������� ����� ���������� ����� �� � ������, �� ���������� ��� � ����� ������� ������ ���.
������� ������� ����� ��������, ����������� ������� ������������� ������. ����������, ��� ������, �������
������ � ����� ��������, ��������. � �����, �� � ���� ����� ������� ��������� ��� ����� C:\ ����� � 80%
� 90% ����������. ��� ���� ������� ��� �������������� 835367 � 938788 ������. ��� ���������� ���� ��������
Nagios ������ ����� ���������� ��� ��������������.

��� ����� �� ����������, �� �������� ����� �������, �������� ������� ������������� ����� ��������. ��� �����
��� ����� ����� ������ �� ������� � ����� ������:

.iso.org.dod.internet.private.enterprises.microsoft.software.systems.os.windowsNT.performance.pagefilepaging-FileTable.pagefilepaging-FileEntry.pagefilePercentUsage

� �����, ��������� ���� �������� ���������� ��� ��������� �����������. �� ������ ���������� �� ������ ��������
����� ������ ������� � ����� ������. � ���, ��������, ����� �������� ������, ������� �� ���� �������� ������
�����������. �����, ���������� ������, ���������� � ���� MIB ���������, �������� ����� ��������� ����������.

�������� ������ � Windows, ��������� � FreeBSD. ��� ��������� ������ ����� SNMP Nagios ���������� ������
check_snmp. �� � ���, � ���� �������, ��������� �� ����� �������� net-snmp, ��������������� ��� ������ �
���������� SNMP. ������ �� ��������������� ���� ����� �������� ��� ������ ��������� ucd-snmp. �� ������
������������ ���� ucd-snmp, ���� net-snmp. � �� �� ����� ����� ������������� �������� �������� ������������
�������� �� ���������� �� ������ ������ ������������ �����������. �������, ������ net-snmp, �������� �����
��������� ������ ������ ������ http://net-snmp.sourceforge.net/.
�� ������ ��������� ������ ��� ���� ������ 5.0.8. ������������ ����� ��������� ���� � ������� ���������.

# tar zxvf net-snmp-5.0.8.tar.gz

����� ����, ��� � �������� ������ configure, �� ������ ��������� ��������� ��������, �� ������� �����������
����� ���� �����.

# ./configure
Defaul version  of SNMP to use (3): 3
# ������ ��������� SNMP, ������� �������� ������������ �� ��������� 
#��� ���� ��������.
# ����� �������� 1, 2c, 3. �, ��� ������, ������ ����� �����. 

System contact infomation  root@: tigrisha@sysadmins.ru
# ����� ����, �������������� �� ������ SNMP. ����� ������ ��� ������.

System Location (Unknown): home
# �������������� �������������� ���� ������. ����� ����� ������ ���, ���
# ������ � ������.

Location to write log file /var/log/snmpd.log:  /var/log/snmpd.log
# ���� ����� snmpd ����� ���������� ����� �������� ����� ������

Location to write persistent information  /var/net/snmp:  /var/net/snmp
# � ��� ���������� SNMP ����� ������� ���� ������� ����������

���������� � ���, ��� ������ configure �������� ������ ��� ������, �������� ������.

# make

�����, ����� � ������� ������� umask ����� �� ��� ����� ����������� �����, �������� �����������.

# umask 022
# make install

��� ����������� ����� �������� �� ����� ������ ��������������� � /usr/local/bin/. ���� ���� ����������
���������, ������ ��� � ������� �������� ������ ��� ����� ����������. �� ���������� ��������� �
/usr/local/bin �������� ��������� ������� ��� ������ � SNMP:

snmpbulkget
snmpbulkwalk
snmpcheck
snmpconf
snmpdelta
snmpdf
snmpget
snmpget.old
snmpgetnext
snmpinform
snmpnetstat
snmpset
snmpstatus
snmptable
snmptest
snmptranslate
snmptrap
snmpusm
snmpvacm
snmpwalk

�� ����� �����������, ���� ��������� ����������� �� �����-���� �������� � ��� �� ���������. Net-snmp,
��� � ucd-snmp, ����� ���������� �� ������ ��� �������, �������������� ������ � FreeBSD. ��������, �
������������ FreeBSD 4.7, �� ������� �������� ����������� �������, ��� ������������� ��������� �����
�������� � 4-�� �����, ����������� ��������� �������. ��� ���������� ������ ��������� ������ ����� Net.
� �������, �� ������ �������������� ������������� ��������� �� ������ ��� �������. ���� ����� ���������
�� ���� ���������, �� �� ����� ����� ������������ �������� ������ ����������� net-snmp ������ 5.0.3_2
��� ucd-snmp ������ 4.2.5_2. ����� ����� �����, �������� ��������� �� ���� ����������. ��� ��� �������
��������� ��������� ���� �����. ���� �������, ��� ��� �������� ���������, � ��������� �� ������ �����
������ ��� ��������� ���������.

����� ����������� ����� �������� ��������� ��������, ����������� ��� ����� ���������� ������ �������
�����������. � ��������� ����� ����������������� �������� ������������ ����� SNMP. �������� �� ���
���� �����������, ���� ����� ��� �� �����, ��� ��� ���� FreeBSD ������ �� ����� ��������� ��������
SNMP �������. ��� ����, ����� ��������� ��������� �������, ��� ���������������� ���� �� ���������.
�������� �� ��� �������������, ������� �������������, � ����� � ��������� ��������� ������ snmpd.
��� ���������� ����� ����� ������� ���������� �� ������� /usr/local/etc/rc.d/snmpd.sh, ������������
������ ����� ������ ������������ �������.

# /usr/local/etc/rc.d/snmpd.sh stop
# chmod  ugo-x /usr/local/etc/rc.d/snmpd.sh

� �������, ��� ��� ������: ������������ ������ Nagios ��������� � ������ nagios-plugins. � ����������� ������
1.3.0 — beta 3. �������� �� ��, ��� ���� ����� � ��� ������ ����� ��� ����������, ������ check_snmp � ����������
/usr/local/libexec/ ������ ����� ���. ����� ������� ������� ����������� �������� �����. � ��������� ��� ������,
��� �� ������ ������� ��� ���������� nagios-plugins � ������ ����� ���� �� ������ snmp. ������ configure,
����������� ����� ����������� �������, ������� ������������� ��� �����������, ������������� �������,. �� �����
�� ����� ������ �� ucd-snmp �� net-snmp. ������, ��� ����� ���������������� ����� nagios-plugins ������. �����
���������� ��������� � ������� � ��������� �������� nagios-plugins � ��������� ��������� �������:

# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-grp=nagios
# gmake all
# gmake install

������������ � �������������� ����������, ��������� � �������� ����, ��� ��� ��������. ��� ����� ������ ������
check_snmp ���������� ��������� snmpget. ������� ��������� ��������� �� ��������� ������ �������� �������
������ Windows ������ � ������� ��������� ������������.

#/usr/local/nagios/libexec/check_snmp -H win2000rus -C QWEmn90 -o system.sysUpTime.0
SNMP problem - No data recieved from host
CMD: /usr/local/bin/snmpget -m ALL -v 1 -c  QWEmn90  win2000rus system.sysUpTime.0

������� ������, �� ����������, � ������ ������ ������. ����� ��������� �������� ������, �� ������ ��������
��� ��������������. ����, ������� �������� � ������� � ������ ���������������� ������ check_snmp. ���
������ ������� check_snmp ������� �������� ������� snmpget, �������� ���������� ��������� ��������� �������.

-v 1

# ������ ���������. Windows ������������ ������ 1 � 2c. ����� ������������ 2� ,
# ������ ��� ������ 1 �����������.

-m ALL

# ����������� ������������ ��� ��������� ����� MIB

-c QWEmn90

# ��� ����������, ������������ ��� ������� � ������. ��������� ������ ������.

win2000rus

# ��� ��� IP ����� ������, ������� ����� ��������� ������.

OID

# ������������� �������, � ������� ��������� ������������ ��� ������.

� ���� �������, ���������� ������ snmpget �������������� check_snmp � ���������� Nagios. ��� ��� ��� ���������
��� �������. �������� ������ ������� � ���, ��� ������ ������ snmpget ������� �� ����, �� ������ ������
������������� ��������� ������� ��� ������ � SNMP.

���������� �������� �� ������� �������, ������� ������ �������� � ��������� ������ ����� ������ �������.

������ net-snmp:
# /usr/local/bin/snmpget -v2c -m ALL -c QWEmn90 win2000rus system.sysUpTime.0

������ ucd-snmp:
# /usr/local/bin/snmpget -m ALL -c QWEmn90 -v2c win2000rus system.sysUpTime.0

��������� ��� ������� �, � ����������� �� ������ SNMP ��������, ����������� �� ����������� ������.
������ �������� ������� � ���, ��� snmpget ������ �� ����� �������� � OID, ���������� SNMP4W2K � SNMP4NT. �
�������, ���������� ��������� ��� ������ �������� �������, ���������� � ��������� ������ ������ � ��������
����������. �������� ��������, OID ��� ��������� ������� � �������� ����.

������ net-snmp:
# /usr/local/bin/snmpget -v2c -m ALL -c QWEmn90 win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1

������ ucd-snmp:
# /usr/local/bin/snmpget -m ALL -c QWEmn90 -v2c win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1

�������� ��, ��� ������, ���������� � ����� �� �������, ������ ���������� ��� � ����������� �������������.
�� �� ��� �� ����. ������ snmpget �� ������ ������������ ��������� snmpwalk, ������� ������� ���������� ��������
� �������������� OID. ����, ������������ ���� ������� � ����� �������� �����.

������ net-snmp:
# /usr/local/bin/snmpwalk -v2c -m ALL -c QWEmn90 win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1

������ ucd-snmp:
# /usr/local/bin/snmpwalk -m ALL -c QWEmn90 -v2c win2000rus .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1

������������ � ����� ������� ����������, ��������� � ������ �� ����������� ������ check_snmp. ���� � ����������
plugins � ��������� �� �������������� ���� ��������� ���� check_snmp.c. ���� � ��� ��� ����� �������� ������,
���������� �� ����� ������� snmp_get:

	/* create the command line to execute */
	command_line = ssprintf
		(command_line,
		 "%s -m ALL -v 1 %s %s %s",
		 PATH_TO_SNMPGET, server_address, community, oid);

����� ������ ��������, �������� ��� �� ������� ��� ����� ������ ������ snmp.

������ net-snmp:

/* create the command line to execute */
	command_line = ssprintf
		(command_line,
		 "%s -v2c -m ALL -c %s %s %s",
		 "/usr/local/bin/snmpwalk",community ,server_address , oid);

������ ucd-snmp:

/* create the command line to execute */
	command_line = ssprintf
		(command_line,
		 "%s -m ALL -c %s -v2c %s  %s",
		 "/usr/local/bin/snmpwalk", community, server_address, oid);

������������, ������� � ��������� �������� ����������, � ����� ��� � �����������.

# gmake all 
# gmake install

������ ������ ����� ����� ��������� ����������������� ������ check_snmp. ��� ����� �� ���������� ��������
����������� ����������� ����� ������ � �������� ���������� Windows ������. ������ ������, ��������� ���������
�������� OID �� ��������� SNMP4W2K

#/usr/local/nagios/libexec/check_snmp -H win2000rus -C QWEmn90 -o .1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1
SNMP OK - INTEGER: 12 

���� �� ����������� ������, ������ �������-�� ��������� ��� ��������. �������� ���������� ����� 12 ���������,
��� � ����� ����� ���� �������.

������ ��������� � ��������� ������ Nagios. ������ ����� � ����� checkcommands.cfg ��� ����� ����������
������� check_snmp_oid, ������� �� ����� ������������ ��� ����� ������.

define command{

command_name check_snmp_oid
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -C $ARG2$ -w $ARG3$ -c $ARG4$ -u $ARG5$ -l «»
}

������� ���������� �� ��������� ��������, ������������ ������� check_snmp.

  • $USER1$ — ���� � ���������� /usr/local/nagios/libexec/
  • $HOSTADDRESS$ — ����� ����������� ������
  • $ARG1$ — OID, ������ �������� �� ����� ������
  • $ARG2$ — ��� ���������� SNMP$ARG1$ — OID, ������ �������� �� ����� ������
  • $ARG3$ — �����, ��� ���������� �������� ����� ������������ ��������������
  • $ARG4$ — ����� ������������ ���������
  • $ARG5$ — ������, ������� ���������� �������� � ���������� ����������. ��������, ��� �������� ����� � ����������� �������� � ��������� ������ ���������� ������ «bytes»

�������� �������� �� ����� -l «» . ��� ��������� �������� ������, ����������� � ��������� ������ snmp �������.
������ ������ �������� ��� «SNMP OK». ��� ��� ������ ���������� ������, ������� � ������� �� ��������.

� ���������� � �����������, ��� ��, �������� ������ ����� ������, ������ ��� ����������� ��� ������ � �������
win2000rus ������ � ����� hosts.cfg, hostgroups.cfg, ������� �������� � ��� �� �� �����. ������������ �
������������ ������, ��������� � �������� ����������� ��������.

# ������, ������������ ������ � �������� ������������� ����� ��������
define service{
use generic-service
host_name win2000rus
service_description SNMP Page File Usage
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24×7
notification_options c,r

# ����� �������������� ������������� �� 80%, � ����������� ��������� �� 90%
# �������� �������� �� ���� «%», ������������ � ��������� ���������.
# �� ������������ ���� ���� � �����������, ������������ �����
# ���������� �������.

check_command check_snmp_oid!.1.3.6.1.4.1.311.1.1.3.1.1.6.1.3!QWEmn90!80!90!%
}


# ������ � �������� ����������, ���������� ����� SNMP4W2K

define service{
use generic-service
host_name win2000rus
service_description SNMP CPU Load
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24×7
notification_options c,r
check_command check_snmp_oid!.1.3.6.1.4.1.311.1.1.3.1.1.2.1.3.1!QWEmn90!80!90!%
}


# ������ � �������� ����������, ���������� ����� ����������� �����
# .iso.org.dod.internet.mgmt.mib-2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad


define service{
use generic-service
host_name win2000rus
service_description SNMP hrProcessorLoad
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24×7
notification_options c,r
check_command check_snmp_oid!.1.3.6.1.2.1.25.3.3.1.2.2!QWEmn90!80!90!%
}


# ����� ������ ������� � ������� ��������� ������������


define service{
use generic-service
host_name win2000rus
service_description SNMP Up Time
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24×7
notification_options c,r

# �������� �������� �� ��, ��� ������ �������������� �
# ������������ ��������� ��� ������� ������� ������ ��
# �����, ������� ��������� � ������� ������ ������� «».
# ���������� � ��������� ���� ������ �� �����, � ������
# ����� ����� ������������ «»

check_command check_snmp_oid!.1.3.6.1.2.1.1.3!QWEmn90!»»!»»!»»
}


# ������� ������������� ����������� ������


define service{
use generic-service
host_name win2000rus
service_description SNMP Virtual Memory usage
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24×7
notification_options c,r
check_command

# ����� �������������� ������������� �� ���������� 80% ����������,
# ��������������� 254797360 ������, � ����������� ���������,
# ����������� ��� ���������� 90% ������, ������������� �� ������� �
# 286647030 ����.
# � ���������, ������������ �������, ��������� ������ «bytes»

check_snmp_oid!.1.3.6.1.4.1.311.1.1.3.1.1.1.3.0!QWEmn90!254797360!286647030!bytes
}


# ������� ����� ������������� �� ����� C:\


define service{
use generic-service
host_name win2000rus
service_description SNMP Space used on disk C:\
is_volatile 0
check_period 24×7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups win-admins
notification_interval 120
notification_period 24×7
notification_options c,r

# ����� �������������� ��������� ��� ������� 80% ������������ ����� —
# ��������������, 835367 �����.
# ����������� ��������� ��������� ��� ���������� 90% ������������.
# ��� ���� ������ ��� 938788 ������.
# � �����, ������������ �������, ��������� ������ «blocks»

check_command check_snmp_oid!.1.3.6.1.2.1.25.2.3.1.6.2!QWEmn90!835367!938788!blocks
}

������, ����� � ���������� ���������, ���������� Nagios ��������� ����������� ����� ������������.

# /usr/local/etc/rc.d/nagios 

���� ������ �� ��������, �� �������� �������� � ���������� � �������� ����������� �������� �� Windows
������. ������� ������ ���������� ������������ �������, ��������, ��� ������ �� ���� ���� ������� ��
�������� ��� ��������. � ���������� ������ �������� �� �������, ��� SNMP4W2K ��������� ������� �� �������
������� ������� ����������� �������� ������� � �����, ���������� ��� ����������� Windows, ��� � ���� �������
� ���� ������. � �����, ����� ������ ����������������, ��, �������, �������������� �������� ������ �� ���
������ ��������������� ���� �����, ��������������� SNMP.

Skip to content

Zabbix Monitor Windows using SNMP

Zabbix Monitor Windows using SNMP

Would you like to learn how to monitor a Windows computer using SNMP? In this tutorial, we are going to show you how to install SNMP on Windows and how to configure the Zabbix server to monitor a Windows computer without the need to install the Zabbix agent.

• Zabbix version: 3.4.12
• Windows version: 2012 R2

Hardware List:

The following section presents the list of equipment used to create this Zabbix tutorial.

Every piece of hardware listed above can be found at Amazon website.

Zabbix Playlist:

On this page, we offer quick access to a list of videos related to Zabbix installation.

Don’t forget to subscribe to our youtube channel named FKIT.

Zabbix Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Zabbix installation.

Tutorial – SNMP Installation on Windows

First, we need to install and configure the SNMP service on Windows.

Open the Server Manager application.

Access the Manage menu and click on Add roles and features.

Windows 2012 add role

Access the features screen, select the SNMP service option and finish the installation.

windows 2012 install snmp

On the following screen, click on the Add features button.

windows 2012 install snmp feature

The SNMP feature was installed on your computer but we still need to configure the SNMP service.

Open the Windows service management screen and access the SNMP service properties.

Windows SNMP Service

Access the Agent tab, select all the options and enter the device contact information.

snmp service agent

Access the Security tab and select the Accept SNMP packets from any host option.

You need to create a Read-only SNMP community.

Here is a summary of our configuration example:

The GokuBlack Community has read-only permission on the Windows server.

The contact person responsible for this Windows computer was configured as Zamasu.

The location of the equipment was configured as the IT Room of Universe 10.

You have successfully installed the Windows SNMP service.

You have successfully configured the Windows SNMP service.

To test your SNMP configuration, use the following commands on a computer running Ubuntu Linux.

# apt-get install snmp
# snmpwalk -v2c -c GokuBlack 192.168.0.50

Here is a small sample of the SNMPWALK output.

iso.3.6.1.2.1.1.1.0 = STRING: “Hardware: Intel64 – Software: Windows Version 6.3
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.311.1.1.3.1.3
iso.3.6.1.2.1.1.3.0 = Timeticks: (614928) 1:42:29.28
iso.3.6.1.2.1.1.4.0 = STRING: “Zamasu <zamasu@dbsuper.com>”
iso.3.6.1.2.1.1.5.0 = STRING: “TECH-DC01.TECH.LOCAL”
iso.3.6.1.2.1.1.6.0 = STRING: “Universe10 – IT Room”

Congratulations! you have installed the SNMP service on a computer running Windows.

Keep in mind that your Windows firewall application needs to accept connections from the Zabbix server.

The Windows firewall should accept network packets on UDP port: 161

You can now use the Zabbix server dashboard to add this computer to the network monitoring service.

Tutorial – Zabbix Monitor Windows using SNMP

Now, we need to access the Zabbix server dashboard and add the Windows computer as a Host.

Open your browser and enter the IP address of your web server plus /zabbix.

In our example, the following URL was entered in the Browser:

• http://35.162.85.57/zabbix

On the login screen, use the default username and default password.

• Default Username: Admin
• Default Password: zabbix

After a successful login, you will be sent to the Zabbix Dashboard.

zabbix dashboard

On the dashboard screen, access the Configuration menu and select the Host option.

zabbix add host

On the top right of the screen, click on the Create host button.

On the Host configuration screen, you will have to enter the following information:

• Host Name – Enter a Hostname to identify the Windows server.
• Visible Hostname – Repeat the hostname.
• New group – Enter a name to identify a group of similar devices.
• Agent Interface – Click on the Remove option.
• SNMP Interface – Enter the IP address of the Windows server.

Here is the original image, before our configuration.

zabbix linux - Antes

Here is the new image with our configuration.

Zabbix Windows Host SNMP

Next, we need to configure the SNMP community that Zabbix will use to connect on the Windows computer.

Access the Macros tab on the top of the screen.

Create a macro named: {$SNMP_COMMUNITY}

The {$SNMP_COMMUNITY} macro value should be the Windows Computer SNMP community.

Zabbix SNMP Macro Linux

Next, we need to associate the host with a specific network monitor template.

By default, Zabbix comes with a large variety of monitoring templates.

Access the Templates tab on the top of the screen.

Click on the Select button and locate the template named: TEMPLATE OS Windows SNMPv2.

Zabbix Windows Template SNMP

Click on the Add button (1).

Click on the Add button (2).

After a few minutes, you will be able to see the initial result on the Zabbix Dashboard.

The final result will take at least one hour.

By default, Zabbix will wait 1 hour to discover the number of interfaces available on the Windows computer.

By default, Zabbix will wait 1 hour before collect information from the network interfaces.

In order to test your configuration, access the Monitoring menu and click on the Graphs option.

Zabbix graphic

On the top right of the screen, select the group named ALL.

Select your Windows computer host name.

Select the graph named: MEMORY UTILIZATION

Windows memory utilization

You should be able to see the graphic of Memory utilization.

Zabbix windows monitor memory

Congratulations! You have configured the Zabbix server to monitor a Windows computer.

VirtualCoin CISSP, PMP, CCNP, MCSE, LPIC22019-06-11T10:40:07-03:00

Related Posts

Page load link

This website uses cookies and third party services.

Ok

SNMP (Simple Network Management Protocol) is a network protocol that allows one device to query another device for information, change information on a device, or for one device to send a message to another device. It is widely used to monitor hardware and software components of web sites during normal operations or during testing. That is why advanced load testing tools, such as WAPT Pro, usually have ability to connect to any servers and receive performance counters data (such as CPU or RAM usage values).

Older versions of Windows, like XP, had SNMP service installed by default, so you only had to start it or enable automatic start. After that you could connect to that system with any SNMP client and monitor anything you needed.

For some reason Microsoft does not like SNMP. I do not know why. They think that this service is unnecessary even for server solutions, which looks strange in my opinion. In practice this resulted in harder configuration procedures for modern OS, like Windows 8 or Windows Server 2012.

The good news is that it still takes just couple minutes to setup, but you need to know where to click. Here is the instruction.

On Windows 2012 you need to open the Server Manager. If you are using Windows 7/8, skip to the next step.

snmp_1

Click the “Add roles and features” link.

On the followed pages click the “Next” button several times leaving the default choices until you get to the Features page. Check the “SNMP Service” in the list of features.

snmp_2

Click the “Next” button and “Install” button on the next page. The installation process will start.

snmp_3

When it is finished, close the window.

If your OS is Windows 7 or 8, instead of the above steps you can simply choose “Turn Windows features on or off” option from the Control Panel and select SNMP in the following dialog.

snmp_4

Now open the Services window. You can do this from Control Panel in any OS. If you do not know where to click, just type “services” in the search field and it will show you the link.

snmp_5

Double-click the “SNMP Service” item and specify the following settings on the Security tab.

snmp_6

To do this you will need to click the “Add…” button and add the “public” community.

If you want to connect to the SNMP service from the same system, you can do this now. If you want to access it from a different system, you need to do couple more steps to open SNMP port for incoming connections.

Open the Windows Firewall. You can do this from the Control Panel. Click the “Advanced settings” link in the Windows Firewall window.

snmp_7

Select the “SNMP Service” rule, the one that works for “Private, Public” profiles.

snmp_8

If you open the “Scope” tab, you will see that this rule initially allows access only for a list of IP addresses, but no addresses are specified. So, you can either specify the addresses from which you are going to connect or check the “Any IP address” option.

snmp_9

Now your SNMP service should work fine and it is available from other systems. Note however that if you use other firewalls, you should add the corresponding rule to them. SNMP work over UDP protocol and uses port number 161, so you should open it.

For example, if you run your system in Amazon EC2, you should create the following rule in the security group of your instance.

October 5th, 2021. Windows 11 is now generally available. It delivers modern and fresh design, it utilizes the power of the cloud and Microsoft 365, Microsoft Teams comes integrated and delivers the best Windows ever for gaming. If you are coming from the network monitoring world, you are probably asking yourself if you can still monitor your Windows 11 machines using SNMP.

The short answer is: “Yes, you can”. But, how? Can you still install it via Control Panel? Does it include SNMP?

For the sake of sharing, a new Windows 11 layout

Microsoft deprecated SNMP from Control Panel > Add Program and Features applet due to security reasons.

Install SNMP via Settings

However, in Windows 11 23H2 (other versions were not tested in this blog article, but you can still try them), you can still install it via Settings.

  1. Hold the Windows logo and press I to open Settings.
  2. Click on Systems on the left side, and then click Optional features.

Windows 11 Optional features
  1. Click on View features.

Add new features
  1. Enter SNMP, and then select SNMP and WMI SNMP Provider, and click Next.

Select SNMP and WMI SNMP Provider
  1. Click Add.
  2. Wait until SNMP and WMI SNMP Provider are installed.

Recent actions related to the installation of SNMP
  1. Right click on Start Menu > Run > type services.msc to open Services applet and then navigate to installed SNMP Service > Right click > Properties.
  2. Click on the Security tab to configure the community string and ACL.
  3. Click on Add… under Community to create a community string. In my case, the community string is called prtg.
  4. Select Accept SNMP packets from these hosts and click Add… to add the IP of your NMS (Network Monitoring Solution). In my case, the IP is 192.168.88.245 which is my PRTG Core Server. This means the Windows machine will only accept SNMP communication coming and going to my NMS.

Configure SNMP
  1. Click Apply and OK and you are done.

Install SNMP via Windows Terminal

If that doesn’t work, the alternative that works on every Windows version is using Windows Terminal (formerly PowerShell).

In order to install the SNMP using Windows Terminal, follow the instructions below.

  1. Right click on Start Menu and select Windows Terminal (Admin). It was called PowerShell in Windows 10.
  2. Type the following command and press Enter.
Add-WindowsCapability -Online -Name “SNMP.Client~~~~0.0.1.0“

Enable SNMP via PowerShell
  1. Right click on Start Menu > Run > type services.msc to open Services applet and then navigate to installed SNMP Service > Right click > Properties.
  2. Click on the Security tab to configure the community string and ACL.
  3. Click on Add… under Community to create a community string. In my case, the community string is called prtg.
  4. Select Accept SNMP packets from these hosts and click Add… to add the IP of your NMS (Network Monitoring Solution). In my case, the IP is 192.168.88.245 which is my PRTG Core Server. This means the Windows machine will only accept SNMP communication coming and going to my NMS.

Configure SNMP
  1. Click Apply and OK and you are done.

How to monitor Windows 11 using PRTG

SNMP is ready and you can monitor your Windows 11 machine by using SNMP, or SNMP Traps (requires additional configuration). In the case below, I do monitor different metrics (uptime, CPU load, RAM, HDD usage, network traffic, and DNS service) on my Windows 11 machine using PRTG.

Monitoring Windows 11 with PRTG and SNMP

What if you need to perform secured Windows monitoring using SNMPv3?

Microsoft doesn’t natively support SNMP v3 (encryption, authentication). As it isn’t possible to achieve it due to the lack of native SNMP v3 functionalities in Windows and Windows Server, the alternative is to install and use third-party SNMP v3 agents. I got you covered with an article that explains all the steps How to achieve SNMPv3 compliance in Windows and Windows Server.

If you think this article is useful and it can be useful to other IT folks, please feel free to share it via the social media buttons below. In case of any questions, feel free to comment or contact me.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как удалить теневые копии windows 10
  • Azurewave bluetooth driver windows 10 x64
  • Enable windows virtualization based security перевод
  • Windows корпоративная на английском
  • Логи установки обновлений windows