Hi All,
Wonder if anyone who is good with powershell help.
I have written a very basic backup check script that i thought was working great. However it seems to give me false positive and i think i know why. However when i make the change which is only putting speech marks around the interger it will work one day and i have to revert it for it to work another.
The script checks "lastbackupresulthr" value which is always 0 if successful and a silly number if not
$errorcode = Get-WBSummary | Select-Object lastbackupresulthr
$status = if($errorcode = "0"){ return "0:Sucess" }else{ return "1:Failed" exit 0 }
"<prtg>" "<result>" "<channel>" "BackupStatus" "</channel>" "<value>" echo $status "</value>" "</result>" "</prtg>"
Add comment