Durante mucho tiempo iba a configurar la monitorización del servicio de Replicación DFS en nuestro Zabbix, pero no encontré ninguna plantilla lista para usar en la red. Me encontré con varios proyectos abandonados aquí y aquí , pero el primer autor no lo completó, y en el segundo no funcionó el enlace para descargar la plantilla. Además, ambos se limitaron a monitorear los retrasos, aunque en realidad hay muchas más métricas. Por lo tanto, decidí hacer mi bicicleta con un manillar redondo y una plantilla de turbinas con descubrimiento y guiones. Empecé hace mucho tiempo, pero mis manos no llegaron al final. Como dice el refrán, hay un lado positivo: en un lugar remoto en autoaislamiento, finalmente lo completé. Se ha trabajado mucho, pero no soy codicioso, así que lo comparto. :)
Antes de que empieces
Más adelante en el texto, debajo del host, me refiero al servidor con el rol DFSR, para el cual está configurado el monitoreo.
A veces, por brevedad, usaré las abreviaturas RG y RF en lugar de grupo de replicación y carpeta replicada .
En general
En primer lugar, era necesario determinar qué monitorear y cómo monitorear.
Fue fácil para mí responder a la segunda pregunta. Por supuesto, esto será monitoreado por un agente con LLD y scripts personalizados. Al elegir un idioma para los scripts, sin dudarlo, me decidí por PowerShell. Muchas oportunidades, Microsoft está promocionando activamente, me queremos mucho :). También se pensó en hacerlo en VBScript por ligereza de compatibilidad con versiones antiguas de Windows, pero pensándolo bien , abandoné esta idea.
Hay dos scripts PS en la solución: Get-DFSRObjectDiscovery.ps1 y 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