Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_backupexec_backups

Current Version
1.0
Last Release Date
2012-11-13
Compatible With
  • Nagios 3.x
  • Nagios XI
Owner
License
GPL
Hits
54268
Files:
FileDescription
check_backupexec_backups.ps1check_backupexec_backups.ps1
Nagios CSP

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!
This is a Nagios Plugin destined to check the last status and last run of Symantec Backup Exec 2012 job passed as an argument.
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]
Reviews (3)
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
}
byjakommo, August 7, 2013
0 of 1 people found this review helpful
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.
bytribbink, November 14, 2012
2 of 3 people found this review helpful
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?
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 -