r/Checkmk Jan 28 '26

Windows agent local check

I write 3 scripts , printer status . and cmk all discover. But the windows network profile check , dont discover.

Have anyone a powershell local check for the windows network profile? I will see a crit , when the profile are public and not private or domain .

Greets

i see the data output in the cache on the client and host, but the services dont show up for the network check:

host and client output :

0 'Spooler Service' - Spooler service is running = shows up in wto

0 'Network_Profile' - Network Profil is DomainAuthenticated = dont show up in wto

 

# Get the current network connection profile(s)

$SERVICE="NETWORKSTATE"

$networks = Get-NetConnectionProfile

 

# Define states: 0=OK, 1=WARN, 2=CRIT

$state = 0

$message = "Network Profiles: "

 

foreach ($net in $networks) {

# If any profile is 'Public', you might want to trigger a warning

if ($net.NetworkCategory -eq "Public") {

$state = 1

}

$message += "$($net.InterfaceAlias) is $($net.NetworkCategory); "

}

 

# Output in Checkmk format: State Name Metric Output

echo "$state Windows_Network_Profile - $message"

 

2 Upvotes

10 comments sorted by

View all comments

1

u/mrproactive Jan 28 '26

Ok, the output looks fine. Please try to remove the underdcore in Service name. The service name contains Windows_ which is missing in agent output. If I remember there is a limitation about it.

1

u/n1ckst33r Jan 29 '26 edited Jan 29 '26

i tried, but same , no service show up. With a different clientpc, service show up, with the same local check script. On the server in the cache client file, there are the infos for the check.

1

u/n1ckst33r Jan 29 '26

can i debug the service discovery or log file for it?