Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_backupexec_backups
1.0
2012-11-13
- Nagios 3.x
- Nagios XI
GPL
54311
File | Description |
---|---|
check_backupexec_backups.ps1 | check_backupexec_backups.ps1 |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Powershell needs to be installed on the Nagios box.
The plugin takes 2 arguments:
- Symantec Backup Exec job name
- Number of days that have to elapse since the last job run before it's assumed to be in critical state
It checks both last job status and last job run date. If the number of days that have elapsed since the last job run date is greater than the second argument the job is assumed to be in critical state. If no, last job status is checked. Based on the status then plugin returns the following exit codes:
Error - 2: critical
non Error / non Succeeded - 1: warning
Succeeded - 0: ok
It has been successfully tested on Symantec Backup Exec 2012 14.0.1798.
Usage:
check_backupexec_backups.ps1 [job name] [number of days]
The plugin takes 2 arguments:
- Symantec Backup Exec job name
- Number of days that have to elapse since the last job run before it's assumed to be in critical state
It checks both last job status and last job run date. If the number of days that have elapsed since the last job run date is greater than the second argument the job is assumed to be in critical state. If no, last job status is checked. Based on the status then plugin returns the following exit codes:
Error - 2: critical
non Error / non Succeeded - 1: warning
Succeeded - 0: ok
It has been successfully tested on Symantec Backup Exec 2012 14.0.1798.
Usage:
check_backupexec_backups.ps1 [job name] [number of days]
Reviews (3)
byRedFish, April 27, 2016
With my regional seetings I had to modify the script, I also added some performance datas. The modifications do start afet line 48 :
$now = (Get-Date).AddDays(-$period)
$lastend = (Get-BEJobHistory -Name $name -FromLastJobRun).EndTime.ToString("dd.MM.yyyy HH:mm")
$laststart = (Get-BEJobHistory -Name $name -FromLastJobRun).StartTime
$jobsize = (Get-BEJobHistory -Name $name -FromLastJobRun).TotalDataSizeBytes/1000000000
$jobsize = "{0:N0}" -f $jobsize
$jobduration = (Get-BEJobHistory -Name $name -FromLastJobRun).ElapsedTime.Hours*60 +(Get-BEJobHistory -Name $name -FromLastJobRun).ElapsedTime.Minutes
$name = " + $name + "
if ($now -gt $laststart)
{
Write-Host "CRITICAL! Last run of job: $name on $lastend."
exit 2
}
else
{
$jobsize=$jobsize+"B"
Write-Host "OK Job $name ($jobsize GB) completed successfully on $lastend in $jobduration minutes.|Job_size=$jobsize; Duration_minutes=$jobduration"
exit 0
}
$now = (Get-Date).AddDays(-$period)
$lastend = (Get-BEJobHistory -Name $name -FromLastJobRun).EndTime.ToString("dd.MM.yyyy HH:mm")
$laststart = (Get-BEJobHistory -Name $name -FromLastJobRun).StartTime
$jobsize = (Get-BEJobHistory -Name $name -FromLastJobRun).TotalDataSizeBytes/1000000000
$jobsize = "{0:N0}" -f $jobsize
$jobduration = (Get-BEJobHistory -Name $name -FromLastJobRun).ElapsedTime.Hours*60 +(Get-BEJobHistory -Name $name -FromLastJobRun).ElapsedTime.Minutes
$name = " + $name + "
if ($now -gt $laststart)
{
Write-Host "CRITICAL! Last run of job: $name on $lastend."
exit 2
}
else
{
$jobsize=$jobsize+"B"
Write-Host "OK Job $name ($jobsize GB) completed successfully on $lastend in $jobduration minutes.|Job_size=$jobsize; Duration_minutes=$jobduration"
exit 0
}
My Server runs on German locale and I had to change "$now = $now.ToString("yyyy-MM-dd")" to "$now = $now.ToString("dd.MM.yyyy")" for this to work.
Hi
cmd /c echo scriptscheck_backupexec_backups.ps1 "B2D full-Full" "7" | powershell.exe -command -
always comes with critical, last night the backup ran ok. Doing something wrong?
cmd /c echo scriptscheck_backupexec_backups.ps1 "B2D full-Full" "7" | powershell.exe -command -
always comes with critical, last night the backup ran ok. Doing something wrong?
Owner's reply
@tribbink:
You have a typo in script execution command. There is no backslash between 'scripts' and 'check_backupexec_backups.ps1'. Also, please try double quotation of job name as on an example below:
check_backupexec_backups1 = cmd /c echo scripts\check_backupexec_backups.ps1 ""VEEAM TO TAPES-Full Backup - Monthly"" 35; exit $LastExitCode | powershell.exe -command -