What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Windows backup monitoring - how to and where's the new sensor?

Votes:

0

Your Vote:

Up

Down

I'm pretty sure I read in some release notes, that there is a new sensor for monitoring windows backups. Searching the KB, I see some posts regarding various methods, but most of these are late 2011.

What's the current best way to do this? Note I'm looking for monitoring and email alerts of the NATIVE Windows Backup system - not a 3rd party tool.

Thanks! :-D

backup custom-script-exe prtg windows windows-backup

Created on Jun 12, 2012 3:35:59 PM by  Matthew Day (0) 1

Last change on Jun 17, 2016 6:09:39 AM by  Luciano Lingnau [Paessler]



9 Replies

Votes:

0

Your Vote:

Up

Down

This is done via the newly implemented "Process Email Content" option of the IMAP sensor.

Please have a look at IMAP sensor manual page.

Created on Jun 13, 2012 8:38:59 AM by  Dirk Paessler [Founder Paessler AG] (10,932) 3 4



Votes:

0

Your Vote:

Up

Down

Thanks Dirk - so this is basically no good for Windows Backup, as it doesn't have any native email reporting?

Unless there's a way to convert an event log entry into an email?

Sorry I am new to PRTG :)

Thanks again,

Matt

Created on Jun 13, 2012 1:52:00 PM by  Matthew Day (0) 1



Votes:

0

Your Vote:

Up

Down

The new sensor can only work with emails, sorry. You could use the Event Log sensor to watch for "failed" events of Windows Backup, I assume.

Created on Jun 14, 2012 11:22:27 AM by  Dirk Paessler [Founder Paessler AG] (10,932) 3 4



Votes:

1

Your Vote:

Up

Down

Hi There

I have written a PowerShell script which you can use for the extended script sensor. You only need to specify the '%host' variable in the sensor settings. The sensor extracts the backup events and the time since last backup has run. The script is tested on a Windows Server 2012R2 using the built-in backup tool.

param([string]$hostname = "N/A")

Invoke-Command -ComputerName $hostname{
$today=(Get-Date)
$dateshift=(Get-Date).AddHours(-24)
$EventError=Get-WinEvent -LogName Microsoft-Windows-Backup| Where-Object {$_.TimeCreated -gt $dateshift} | Where-Object {$_.LevelDisplayName -eq "Error"}
$EventWarning=Get-WinEvent -LogName Microsoft-Windows-Backup| Where-Object {$_.TimeCreated -gt $dateshift} | Where-Object {$_.LevelDisplayName -eq "Warning"}
$EventOK=Get-WinEvent -LogName Microsoft-Windows-Backup| Where-Object {$_.TimeCreated -gt $dateshift} | Where-Object {$_.LevelDisplayName -eq "Information"}

$backupsets=Get-WBBackupSet
$lastbackup=(Get-Date)-($backupsets.BackupTime |Measure-Object -Maximum |Select-Object -ExpandProperty Maximum)
$lastbkround=[math]::Floor($lastbackup.TotalHours)

Write-Host '<?xml version="1.0" encoding="Windows-1252" ?>'
Write-Host '<prtg>'
Write-Host '<result>'
Write-Host '<channel>Error Events</channel>'
Write-Host '<value>'$EventError.Count'</value>'
Write-Host '</result>'
Write-Host '<result>'
Write-Host '<channel>Warning Events</channel>'
Write-Host '<value>'$EventWarning.Count'</value>'
Write-Host '</result>'
Write-Host '<result>'
Write-Host '<channel>Information Events</channel>'
Write-Host '<value>'$EventOK.Count'</value>'
Write-Host '</result>'
Write-Host '<result>'
Write-Host '<channel>Hours Since Last Backup</channel>'
Write-Host '<value>'$lastbkround'</value>'
Write-Host '</result>'
Write-Host '</prtg>'

Created on Jun 16, 2016 7:53:38 PM by  Liceo (10) 1

Last change on Jun 17, 2016 6:09:02 AM by  Luciano Lingnau [Paessler]



Votes:

0

Your Vote:

Up

Down

Hello Liceo, thank you for sharing your script!

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Jun 17, 2016 6:10:39 AM by  Luciano Lingnau [Paessler]

Last change on Jun 17, 2016 6:11:00 AM by  Luciano Lingnau [Paessler]



Votes:

0

Your Vote:

Up

Down

Hi Liceo, is your script missing a "}" somewhere? I'm getting an error executing it manually.

Also, do you run it in the default security context?

Created on Aug 19, 2016 4:37:12 PM by  robles (0)



Votes:

0

Your Vote:

Up

Down

You could also try Heath Trengove's powershell sensor from GitHub: https://github.com/htrengove/PRTGwindowsbackup/

Thanks, Heath!

Created on Nov 2, 2016 3:38:15 PM by  Kimberley Trommler [Paessler Support] (7) 3

Last change on Nov 2, 2016 3:56:49 PM by  Kimberley Trommler [Paessler Support] (7) 3



Votes:

0

Your Vote:

Up

Down

Hi Liceo,

I am trying your powershell script and i have an issue with it.
If i run the script in an 64 powershell box the "Get-WBBackupSet" works fine But if i run the script in an 32 bit powershell box the "Get-WBBackupSet" CMDlet is not recognized. PRTG is calling a 32bit version of powershell and thus the "Get-WBBackupSet" CMDlet is not working.

How can i fix this?

Created on Jul 17, 2020 9:37:24 AM by  Eric Koster (0)

Last change on Jul 17, 2020 12:54:16 PM by  Moritz Heller [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi there,

I cannot help you by fix the custom script, however, you can try the tool "PSx64" from the PRTG Tools Family to execute your script in 64bit mode: http://prtgtoolsfamily.com/downloads/sensors

Created on Jul 17, 2020 12:56:16 PM by  Moritz Heller [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.