Jannos-443
Checks SQL Backup, Log Backup and Differential Backup Age for every database!
Parameter | Default Value |
---|---|
BackupAgeWarning | 24 (hours) |
BackupAgeError | 27 (hours) |
LogAgeWarning | 24 (hours) |
LogAgeError | 27 (hours) |
DiffAgeWarning | 24 (hours) |
DiffAgeError | 27 (hours) |
-
Make sure your SQL User/Windows User has the required SQL Server permission required Custom SQL Server Role permission:
-
SERVER CONNECT SQL
-
SERVER VIEW SERVER STATE
-
SERVER CONNECT ANY DATABASE
-
-
Make sure the SQLServer Module exists on the Probe
https://docs.microsoft.com/en-us/sql/powershell/download-sql-server-ps-module?view=sql-server-ver15
-
Place
PRTG-SQL-BackupAge.ps1
underC:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML
-
Create new Sensor
Settings Value EXE/Script Advanced PRTG-SQL-BackupAge.ps1 Parameters -sqlInstance "SQL-Test" -IgnorePattern '(SQL-ABC)'
Scanning Interval 10 minutes -
Set the include/exclude parameter if required
Run as Windows User
... -sqlInstance "SQL-Test"
Explicit User and Password
... -sqlInstance "SQL-Test" -username 'YourUser' -password 'YourPassword'
Named SQL Istance
... -sqlInstance "SQL-Server01.example.com\InstanceTest"
Monitor SQL Database Backup
... -sqlInstance "SQL-Test" -BackupAge
Monitor SQL Log Backup
... -sqlInstance "SQL-Test" -LogAge
Monitor SQL Database Backup and SQL Log Backup
... -sqlInstance "SQL-Test" -LogAge -BackupAge
Exclude Databases starting with Test_
... -sqlInstance "SQL-Test" -LogAge -BackupAge -ExcludeDB '^(Test_.*)$'
Change Warning and Error Limit for Log Backup (5h Warning and 7h Error)
... -sqlInstance "SQL-Test" -LogAge -BackupAge -LogAgeWarning '5' -LogAgeError '7'
You can either use the parameter $IncludeDB/ExcludeDB to exclude/include a database on sensor basis, or set the variable $ExcludeScript/$IncludeScript within the script. Both variables take a regular expression as input to provide maximum flexibility. These regexes are then evaluated againt the Database Name
For more information about regular expressions in PowerShell, visit Microsoft Docs.
".+" is one or more charakters ".*" is zero or more charakters