I'm trying to run the following script to monitor the state of Windows Server backup:
Code: Select all
$statusAlive = "ScriptRes:Host is alive:"
$statusDead = "ScriptRes:No answer:"
$statusUnknown = "ScriptRes:Unknown:"
$statusNotResolved = "ScriptRes:Unknown host:"
$statusOk = "ScriptRes:Ok:"
$statusBad = "ScriptRes:Bad:"
$statusBadContents = "ScriptRes:Bad contents:"
if (!$args[0])
{
echo $statusUnknown"Threshold parameter is not specified"
exit
}
$TargetSystem = $args[0]
$DaysToLook = $args[1] * 86400000
$JobCount = 0
$JobCount = (get-winevent -ComputerName "$TargetSystem" -LogName "Microsoft-Windows-Backup" -FilterXPath "*[System[TimeCreated[timediff(@SystemTime) <= $daystolook]]]" | where {$_.id -eq 4}).count
if ($JobCount -gt 0)
{
echo $statusOk
}
else
{
echo $statusBad
}
[17:54:19] Agent: X is going to execute "PowerShell: Windows Server Backup check" script ...
[17:54:20] Script started, invalid result received:
----------
ÿþS
The "ÿþ" is actually displayed as a square in HostMonitor/RCC UI.
Restarting the agent service or rebooting the server does not help. I have two RMAs installed on two servers in the same network (primary and backup), and the problem occurs on both. However, I haven't run into this issue on any other network yet.