Hi there,
We recently bought Check_MK Enterprise and one of the uses we want to give it is to spread the agent throughout many machines (Microsoft) within the infrastructure with Powershell scripts in order to monitor a few services from all those machines (their physical location/network are different from eachother) to get the perception of how the service is doing from all the different locations.
The following script, if ran locally, always returns values under 10ms:
$response = (Measure-Command { Invoke-WebRequest -Uri āSOMEURLā -UseBasicParsing }).TotalMilliseconds
$status = 2 #critical
$crit = 200
$warn = 120
if ($response -gt $crit) {
$status = 2 #critical
}
elseif ($response -gt $warn) {
$status = 1 #warning
}
else {
$status = 0 #ok
}
ā$status HTTPResponseTime-Exchange response_time=$response;$warn;$crit;; HTTP response time $response msā
Result: 0 HTTPResponseTime-Exchange response_time=7.9582;120;200;; HTTP response time 7.9582 ms
But the same script will always return values above 300ms when ran via agent:
2 HTTPResponseTime-Exchange response_time=3763.0363;120;200;; HTTP response time 3763.0363 ms
The script is located at C:\ProgramData\checkmk\agent\local
Iāve been running some tests over the past days and I can assure you that the MS is under the influence of how many local scripts weāre running on the machine: If I copy this very same script 50 times and run the agent output test, the MS response Iāll get will go from 200 (which is already a wrong value) up to 3500+.
Iāve done this before some years ago in different CMK builds and I never had this issue so Iām not sure where to go from here.
Thank you,
Daniel