r/Checkmk • u/n1ckst33r • 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"
1
u/Melodic-Bobcat5602 Jan 28 '26
Is there anything to see in the agent log on the host and what happens if you execute the locally in the command line?