Hi,
i'm trying to get get PRTG to execute a Powershell Script to return the number of unregistered XenDesktops. The Script is working without PRTG but wihin PRTG i only get an error message. The weird part is that the Error Message evreytime is Error:PU132*(Code: PE132*), except the * are the real Values from the script.
For example if i have 4 unregistered machines i get the message Error: PU1324 (Code: PE1324).
Am i doing anything wrong? Here is the script:
asnp citrix.broker*
$unregistered = Get-BrokerDesktop -SummaryState Unregistered
$unregisteredcount = @($unregistered).Count
if ($unregisteredcount -eq 1)
{
$unregisteredcount = 0;
}
write-host $($unregisteredcount)
The if-Sequnece in the middle i'm using because the script always returns atleast 1.
Article Comments
Hi,
the return values (in order for PRTG to understand them) have to be in the format:
value:message
Return Code
where Return code is optional. So in your case the return value should look something like the following:
asnp citrix.broker*
$unregistered = Get-BrokerDesktop -SummaryState Unregistered
$unregisteredcount = @($unregistered).Count
if ($unregisteredcount -eq 1)
{
$unregisteredcount = 0;
}
$returnValue = $unregisteredaccount ":Some Message"
write-host $returnValue
exit 0
Where the following Exit Codes can be used to control the sensor status in PRTG:
Value | Description |
0 | OK |
1 | WARNING |
2 | System Error (e.g. a network/socket error) |
3 | Protocol Error (e.g. web server returns a 404) |
4 | Content Error (e.g. a web page does not contain a required word) |
For further information see also the documentation.
Best regards
Oct, 2012 - Permalink
Hi,
the return values (in order for PRTG to understand them) have to be in the format:
where Return code is optional. So in your case the return value should look something like the following:
Where the following Exit Codes can be used to control the sensor status in PRTG:
For further information see also the documentation.
Best regards
Oct, 2012 - Permalink