N-able / CustomMonitoring

Custom Monitoring components for N-Central
52 stars 45 forks source link

Uint issue #14

Open Greyspirit128 opened 7 years ago

Greyspirit128 commented 7 years ago

The Symantec System Recovery poll script sometimes fails. copied the script from NCentral and put it on the server and ran it manually. Looking closer I found that the line 91

$lastBackupMinsAgo = (($lastBackupDate - $timenow).Totalminutes) * -1

sometimes returns a negative number causing a UINT callout. Seems to be mostly when run right after backup completes. Sometimes for unknown reason, even after 24 hours it still does it. Might be sometime with the time of day but I didn't have time to localize it further. I propose a change to cause it to always be a positive number.

$lastBackupMinsAgo = [Math]::ABS( (($lastBackupDate - $timenow).Totalminutes) )

jamesweakley commented 7 years ago

While it would be ideal to determine what causes the problem (perhaps continually poll and log the last backup date during the backup?)

Failing that, this workaround seems pretty safe, the worst it would do is turn the existing monitoring error into a failed backup alert.