For a long time I was going to configure monitoring of the DFS Replication service on our Zabbix, but I did not find any ready-made templates on the network. I came across several abandoned projects here and here , but the first author did not complete it, and in the second the link for downloading the template did not work. In addition, both were limited only to monitoring backlogs, although in fact there are much more metrics. Therefore, I decided to make my bike with a round handlebar and turbines template with discovery and scripts. I started a long time ago, but my hands did not reach the end. As the saying goes, there is a silver lining: at a remote location in self-isolation, I finally completed it. A lot of work has been done, but I'm not greedy, so I share. :)
Before you begin
Further in the text, under the host, I mean the server with the DFSR role, for which monitoring is configured.
Sometimes, for brevity, I will use the abbreviations RG and RF instead of replication group and replicated folder .
Overall
First of all, it was necessary to determine what to monitor and how to monitor.
It was easy for me to answer the second question. Of course, this will be monitoring by an agent with LLD and custom scripts. Choosing a language for scripting, I, without hesitation, settled on PowerShell. Many opportunities, Microsoft is actively promoting, we love me dearly :). There was also a thought to do it in VBScript for lightness of compatibility with old versions of Windows, but on reflection , I gave up this idea.
There are two PS-scripts in the solution: Get-DFSRObjectDiscovery.ps1 and 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