Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
This is a Nagios Plugin destined to check the last status and last run of Symantec Backup Exec 2012 job passed as an argument.
Current Version
1.0
Last Release Date
2012-11-13
Owner
Tytus Kurek
Website
http://tkurek.blogspot.com/
License
GPL
Compatible With
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]
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 }
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?
@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 scriptscheck_backupexec_backups.ps1 ""VEEAM TO TAPES-Full Backup - Monthly"" 35; exit $LastExitCode | powershell.exe -command -
You must be logged in to submit a review.
To:
From: