Hi, i hope someone can help me... I'm working for now 2 weeks on a sensor, that shows me how old a backup is. The result from the PowerShell script is:
<prtg> <result> <channel>Backup Job 1</channel> <value>21</value> </result> <result> <channel>Backup Job 2</channel> <value>248</value> </result> <result> <channel>Backup Job 3</channel> <value>18</value> </result> </prtg>
The scipt worked verry well, but when i create a custom XML sensor the values are wrong. In this case:
Backup Job 1 = 84 Backup Job 2 = 384 Backup Job 3 = 194 The code is very simple: $BackupJob1 = "Backup Job 1" $LastBackup1 = (Get-ChildItem 'backups:\Backup Job 1').LastWriteTime | Sort-Object LastWriteTime | Select-Object -Last 1 $BackupAge1 = (Get-Date) - $LastBackupJonas | Select-Object -Property Days | Format-Wide | Out-String $BackupAge1 = $BackupAge1.Trim() $BackupAge1 = $BackupAge1.ToDecimal($null)
The integer that comes out of the Sript is right, but PRTG shows a different one... I don't know why and i can't see a scheme on it.
I hope some one can help me, I'm despairing.
Greetings from Germany