Ad_replication: “Item not found in monitoring data” after Windows updates KB5131089/KB5131090 (repadmin /csv now returns 15 columns, 2.5.0p8)

CMK version: Checkmk 2.5.0p8 (community), Agent 2.5.0p8
OS version: Windows Server 2022 Datacenter (build 10.0.20348), German locale

Hi,

since the Windows updates of this month, the AD Replication <site>/<partner> services on two of our domain controllers went UNKNOWN with “Item not found in monitoring data”. Replication itself is healthy, repadmin /showrepl shows all naming contexts replicating successfully with 0 failures.

  • Plugin: stock ad_replication.bat (not modified by us, deployed manually)

Symptom
The services were discovered earlier and are now “vanished”. cmk -d <host> shows the <<<ad_replication:cached(…)>>> section with correct data, but the check finds no item.

Cause (as far as I can tell)
The agent output now has 15 comma-separated fields per showrepl_INFO line instead of 10/11. In addition to the known columns up to Last Failure Status, there are four new ones at the end (German headers: FQDN des Ziel-DC, FQDN des Quell-DC, Master-NCs des Ziel-DCs, Master-NCs des Quell-DCs). The check (checks/ad_replication) only accepts lines with 10 or 11 fields:

line_parts = line_txt.split(",")
if len(line_parts) in [11, 10]:
    lines.append(line_parts)

All lines with 15 fields are silently dropped, so no item is found.

Sample of the (anonymized) agent output:

<<<ad_replication:cached(…,900)>>>
showrepl_COLUMNS,Ziel-DSA-Standort,Ziel-DSA,Namenskontext,Quell-DSA-Standort,Quell-DSA,Transporttyp,Fehleranzahl,Zeit des letzten Fehlers,Zeit des letzten Erfolges,Status des letzten Fehlers,FQDN des Ziel-DC,FQDN des Quell-DC,Master-NCs des Ziel-DCs,Master-NCs des Quell-DCs
showrepl_INFO,Default-First-Site-Name,DC1,"DC=example,DC=local",Default-First-Site-Name,DC2,RPC,0,0,2026-11-11 07:48:32,0,DC1.example.local,DC2.example.local,"DC=DomainDnsZones,DC=example,DC=local;DC=ForestDnsZones,…","DC=DomainDnsZones,…"

What changed
The extra columns appear only on the DCs that installed this month’s updates KB5131089 and KB5131090 (installed 2026-11-10). A DC without these updates still returns the old format with 11 columns, and its AD Replication services are fine:

DC repadmin /csv columns latest updates
DC-A 11 KB5126654, KB5126655, KB5127687 (2026-10-20)
DC-B 15 KB5131089, KB5131090 (2026-11-10)
DC-C 15 KB5131089, KB5131090 (2026-11-10)

I have not verified which of the two KBs adds the columns, only that the change coincides with them.

Verification
I ran the check functions on the real agent output with the lines truncated to the first 11 fields. Discovery then returns both items and the check returns “All replications are OK.” So the parsing logic works as soon as the extra columns are ignored.

Questions

  1. Is this known? Is anyone else seeing UNKNOWN on AD Replication after this month’s Windows updates?
  2. Is a fix planned, either in the check (ignore additional columns) or in the Windows plugin (output only the expected columns)?
  3. Meanwhile: is there a supported way to patch this without modifying shipped files? A local override in local/share/check_mk/checks/ is not loaded in 2.5.

Thanks!

I got this problem reported from one of my colleagues today. But had no time to look into it.

Please note:

The following applies to all directories: Only those with a init.py file can be overshadowed, and even then only if there is also a init.py file in the directory of the same name within ~/local/.

Found on: Checkmk on the command line - Understanding and using commands

If you want to fix the check you need to port it to the new check API - the resulting check needs to be placed inside ~/local/lib/python3/cmk/plugins/collection/agent_based/

Had the same problem on one of our customers’ sites, both updates were installed, so I can’t tell which one changed the repadmin output.
As a quick solution I deployed a local check file with the following patch to the parse function

def parse_ad_replication_info(info):
lines = []
for line_parts in info:
# Make lines split by , instead of spaces
line_txt = " ".join(line_parts).replace(",CN=", ";CN=").replace(",DC=", ";DC=")
line_parts = line_txt.split(",")
# Newer agent output appends 4 extra columns (FQDNs and master NCs)
if len(line_parts) >= 14:
line_parts = line_parts[:-4]
if len(line_parts) in [11, 10]:
lines.append(line_parts)
return lines

This seems to work well on all sites.

i edited the .bat file

find the line starting with “reapadmin /showrepl” and replace it with the following:

repadmin /showrepl /csv | find /V “repadmin_ERROR,” | powershell.exe -NoProfile -Command “$input | ForEach-Object { $s = $_; $quoted = $false; $commas = 0; $end = $s.Length; for ($i = 0; $i -lt $s.Length; $i++) { if ($s[$i] -eq [char]34) { $quoted = -not $quoted }; if (($s[$i] -eq ‘,’) -and (-not $quoted)) { $commas++; if ($commas -eq 11) { $end = $i; break } } }; $s.Substring(0,$end) }”

I had to adjust the quotations..

repadmin /showrepl /csv | find /V "repadmin_ERROR," | powershell.exe -NoProfile -Command "$input | ForEach-Object { $s = $_; $quoted = $false; $commas = 0; $end = $s.Length; for ($i = 0; $i -lt $s.Length; $i++) { if ($s[$i] -eq [char]34) { $quoted = -not $quoted }; if (($s[$i] -eq ',') -and (-not $quoted)) { $commas++; if ($commas -eq 11) { $end = $i; break } } }; $s.Substring(0,$end) }"

The “whole area” of the script:

where /Q repadmin > nul
if ERRORLEVEL 1 goto SERVER_NOT_IN_DC_LIST
echo ^<^<^<ad_replication^>^>^>
repadmin /showrepl /csv | find /V "repadmin_ERROR," | powershell.exe -NoProfile -Command "foreach ($s in $input) { $quoted = $false; $commas = 0; $end = $s.Length; for ($i = 0; $i -lt $s.Length; $i++) { if ($s[$i] -eq [char]34) { $quoted = -not $quoted }; if (($s[$i] -eq [char]44) -and (-not $quoted)) { $commas++; if ($commas -eq 11) { $end = $i; break } } }; $s.Substring(0,$end) }"
:SERVER_NOT_IN_DC_LIST

I created an internal ticket.

We’re having this problem, too. Is an official solution being worked on, or do I need to implement a fix myself?

We have an internal ticket. You can help speeding this up by sending me the agent section as it currently looks like. I’ll attach this to the internal ticket. Just mail it to mattias.schlenker@checkmk.com.

What exactly does “agent section” mean? If you let me know, I’d be happy to forward it.

Use the “Download agent output” function in the monitoring (service list of host, hamburger menu of service Check_MK).

Then identify the section starting with…

…and copy that until the end of the section. That’s what I need.

@mschlenker sent you right now an email. Password: adrepl%2026%November

Having the same issue, I’ll go ahead and send our logs your way as well, if it helps.

Were there any necessary steps after editing the .bat file?

I modified it and restarted the Checkmk Agent service, but the scan is still unchanged it seems.

@freindl I’ve already received an mkp with a hotfix and informed @mschlenker that the fix works. As soon as the fix arrives, there’s no need to edit the .bat file anymore.
But until then you have to change the line with the repadmin command.
@Andy.Smith I think the quotations are depending on the Regional Settings possibly. Mine and @khiwg are different.

I ran into the same issue on Windows Server 2022 after the November updates.

As a workaround, I replaced the original ad_replication.bat with a PowerShell version that keeps only the original 11 fields from repadmin /showrepl /csv.

The additional four fields introduced with the new repadmin output are therefore removed before the data is passed to Checkmk. This matches the workaround already described in this thread, where truncating the lines to the first 11 fields restores discovery and checking.

On the affected domain controller I replaced:

C:\ProgramData\checkmk\agent\plugins\ad_replication.bat

with:

C:\ProgramData\checkmk\agent\plugins\ad_replication.ps1

The contents of ad_replication.ps1:

PowerShell

# Checkmk - AD Replication Plugin
# Compatible with newer repadmin /showrepl /csv output
# Only the original 11 fields are returned.

$CMK_VERSION = "2.5.0p22"

# Check whether repadmin is available
if (-not (Get-Command repadmin.exe -ErrorAction SilentlyContinue)) {
    exit 0
}

# Checkmk section header
Write-Output '<<<ad_replication>>>'

# Load CSV parser
Add-Type -AssemblyName Microsoft.VisualBasic

# Get repadmin output
$repadminOutput = & repadmin.exe /showrepl /csv 2>$null

foreach ($line in $repadminOutput) {

    # Corresponds to the original:
    # find /V "repadmin_ERROR,"
    if ($line -like '*repadmin_ERROR,*') {
        continue
    }

    # Ignore empty lines
    if (:IsNullOrWhiteSpace($line)) {
        continue
    }

    try {
        $reader = New-Object System.IO.StringReader($line)

        $parser = New-Object Microsoft.VisualBasic.FileIO.TextFieldParser($reader)
        $parser.TextFieldType = [Microsoft.VisualBasic.FileIO.FieldType]::Delimited
        $parser.SetDelimiters(",")
        $parser.HasFieldsEnclosedInQuotes = $true
        $parser.TrimWhiteSpace = $false

        $fields = $parser.ReadFields()

        $parser.Close()
        $reader.Close()

        # Keep only the original first 11 fields
        if ($fields.Count -gt 11) {
            $fields = $fields[0..10]
        }

        # Convert fields back to valid CSV
        $csvFields = foreach ($field in $fields) {

            $escapedField = $field.Replace('"', '""')

            if (
                $escapedField.Contains(',') -or
                $escapedField.Contains('"') -or
                $escapedField.Contains("`r") -or
                $escapedField.Contains("`n")
            ) {
                '"' + $escapedField + '"'
            }
            else {
                $escapedField
            }
        }

        Write-Output ($csvFields -join ',')
    }
    catch {
        # Do not output malformed/unparseable data to Checkmk
        continue
    }
}

The important part is that this isn’t just splitting the line on commas. Fields such as the Naming Context contain commas themselves, so the output needs to be parsed as actual CSV.

With this workaround, both the showrepl_COLUMNS header and the showrepl_INFO lines are reduced to the original 11 fields expected by the existing Checkmk ad_replication check.

This is only a workaround until the Checkmk check itself is adjusted to accept or ignore the additional fields in the newer repadmin output.

Just as a note, I had to add “[string]:” to the “ignore empty lines” field, as powershell threw an error about trying to execute it as a command.

Adjusted function:

# Ignore empty lines
if ([string]::IsNullOrWhiteSpace($line)) {
    continue
}

I wasn’t sure how to have Checkmk fire it from a PS1, so I just copied the batch file and changed the original to:

@echo off
set CMK_VERSION=“2.5.0p15”

REM ***
REM * Current batch file broke after November Windows updates due to 15 columns being output instead of 10 or 11. Checkmk is working to fix the plugin.
REM ***

powershell.exe -NoProfile -ExecutionPolicy Bypass -File “C:\Program Files (x86)\checkmk\service\plugins\ad_replication.ps1”

Despite the batch file seeming to give the right output (11 columns with the following santized info), the check still returns the service as not found.

showrepl_COLUMNS,Destination DSA Site,Destination DSA,Naming Context,Source DSA Site,Source DSA,Transport Type,Number of Failures,Last Failure Time,Last Success Time,Last Failure Status
showrepl_INFO,(SITENAME),(DCNAME),“DC=DOMAINNAME,DC=LOCAL”,(SITENAME),(DCNAME),RPC,0,0,2026-11-19 14:58:57,0

@mschlenker Hi Mattias

Will this be fixed in a release soon do you know?

Thanks

Simon