Há muito tempo que estou planejando configurar o monitoramento do serviço Replicação DFS em nosso Zabbix, mas não encontrei nenhum modelo pronto na rede. Encontrei vários projetos abandonados aqui e aqui , mas o primeiro autor não concluiu, e no segundo o link para baixar o template não funcionou. Além disso, ambos se limitaram a monitorar atrasos, embora na verdade haja muito mais métricas. Portanto, decidi fazer minha bicicleta com um guiador redondo e modelo de turbinas com descoberta e scripts. Comecei há muito tempo, mas minhas mãos não chegaram ao fim. Como diz o ditado, há um forro de prata: em um local remoto e isolado, eu finalmente concluí. Muito trabalho foi feito, mas não sou ganancioso, então compartilho. :)
Antes de você começar
Mais adiante no texto sob o host, quero dizer o servidor com a função DFSR, para o qual o monitoramento está configurado.
Às vezes, para abreviar, usarei as abreviações RG e RF em vez de grupo de replicação e pasta replicada .
No geral
Em primeiro lugar, era necessário determinar o que monitorar e como monitorar.
Foi fácil para mim responder à segunda pergunta. Claro, isso será monitorado por um agente com LLD e scripts personalizados. Escolhendo uma linguagem para scripts, eu, sem hesitação, optei pelo PowerShell. Muitas oportunidades, a Microsoft está promovendo ativamente, nós me amamos muito :). Houve também um pensamento para fazê-lo em VBScript para leveza de compatibilidade com versões antigas do Windows, mas na reflexão , eu desisti dessa idéia.
Existem dois scripts PS na solução: Get-DFSRObjectDiscovery.ps1 e Get-DFSRObjectParam.ps1
, - (item Zabbix), - . WMI-. , .. .
" ?" . DFSR , , DFSR, , .
, :
;
;
;
DFSR;
;
.
.
DFSR, . , Active Directory MyRG3, , . .
Microsoft.
Zabbix 2.2 5.0 Windows 2008R2 SP1 2019, Zabbix 3.4, Zabbix 5.0 Windows 2012 R2.
(value mapping), Zabbix.
(DFS Replication Groups)
:
(outbound connections);
(inbound connections);
(number of folders);
(blank schedule).
DFS Replication Groups LLD.
, , , . , , . . , , 1, 0.
, . , .
(DFS Replicated Folders)
:
(backlog size);
(state)
(enabled)
" " ('read-only' mode)
" " ('remove deleted' enabled)
(redundancy)
, (stage quota)
(stage used)
(stage free (percentage))
, (conflict quota)
(conflict used)
(conflict free (percentage))
;
DFS Replicated Folders Backlog LLD. . -, DFSR - , , , DFSR-. , , = , , . -, , , , , .
3 :
{$BACKLOGMAXWARNING} - warning- ( 10);
{$BACKLOGMAXAVERAGE} - average- ( 100);
{$BACKLOGPERIOD} - ( 15 ).
, 10 15 , warning-. 100, average-.
, DFSR, , Managment Pack SCOM ("" Microsoft) . , . :

( ) DFS Replicated Folders LLD. , state redundancy.
State - , :
Uninitialized (0)
Initialized (1)
Initial Sync (2)
Auto Recovery (3)
Normal (4)
In Error (5)
Redundancy - , Normal. , , .
stage free (percentage) conflict free (percentage), . , , , zabbix-.
5% , . 5% {$STAGEDIRPFREEMIN} {$CONFLICTDIRPFREEMIN}.
DFS Replicated Folders PerfCounters LLD. , .., , , . , . , , .
, , Conflict Files Generated, , RF. . :
{$CONFLICTSGENERATEDCHANGEWARNING} - , warning- ( 10);
{$CONFLICTSGENERATEDCHANGEAVERAGE} - average- ( 100);
{$CONFLICTSGENERATEDPERIOD} - , , ( 5 ).
, 5 10- , warning-, 100 - average-.
? . , DFSN \\abc.com\Share. ( ): \\server1\Share \\server2\Share. + . AD- ( Office1 Office2). Office1, \\abc.com\Share, server1, Office2 - server2 (, , , ). \\abc.com\Share\_.xlsx ( - ) . , , , , , , Ctrl+S 5 , . , , , , .
, , - , - , DFS-. , .
RF 4 :
(conflict space usage)
(stage space usage)
, (received bytes)
(received files and conflicts)
(DFS Replication Connections)
:
(state);
(enabled);
(blank schedule);
.
: DFS Replication Connections LLD - , DFS Replication Connections PerfCounters LLD - .
State - , :
Connecting (0)
Online (1)
Offline (2)
In Error (3)
Enabled - .
Blank schedule - RG. , , RG.
RF, , bytes received per second, :

DFSR (DFS Replication Service Volumes)
:
(state);
.
: DFS Replication Service Volumes LLD DFS Replication Service Volumes PerfCounters LLD. - state, :
Initialized (0)
Shutting Down (1)
In Error (2)
Auto Recovery (3)
.
(DFS Replication Partners)
:
PING (ping check);
WMI (WMI check).
DFS Replication Partners LLD. , : , "" ICMP WMI. WMI , - zabbix-. WMI- - , DFSR- backlog size redundancy ( ). , zabbix- . , WMI- , - . :

(General)
:
DFSR (DFS Replication role installed);
, (Number of replication groups);
DFSR (DFSR Event Log);
(DFS Replication service state);
(DFS Replication service uptime);
(DFSR Service Version);
DFSR (DFSR Provider Version);
DFSR (DFSR Monitoring Provider Version);
.
, Items .
. 3 , :
DFSR Event Log: number of warnings
DFSR Event Log: number of errors
DFSR Event Log: number of critical errors
, - PS-. (, , ) , . , . , . :
{$DFSRLOGCRITICALMAX} - "" DFSR, high- ( 0);
{$DFSRLOGERRORSMAX} - "" DFSR, average- ( 0);
{$DFSRLOGWARNINGSMAX} - "" DFSR, warning- ( 0);
{$DFSRLOGPERIOD} - ( 1 )
:
Service Starting (0)
Service Running (1)
Service Degraded (2)
Service Shutting Down (3)
Stopped (100)
Not Found (101)
, .
, RG Zabbix- RG , .
:
- RF: Zabbix "perf_counter[\XXX\YYY]" is not supported: Cannot obtain performance information from collector. Windows (perfmon, typeperf, Get-Counter) . Zabbix Agent. RF-, (, ) .
.
Get-DFSRBacklog (Technet gallery)
DFS Replication Backlog Discovery
DFS Replication Management Pack for Windows Server 2008 R2
Optional configuration for the DFS Replication Management Pack
PowerShell — Zabbix — Json ConvertTo-Json2
Displaying Unicode in Powershell
powershell : changing the culture of current session