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


Remember Me

Directory Tree


Current Version
Last Release Date
Compatible With
  • Nagios 3.x
  • Nagios XI
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This is a Nagios Plugin destined to check the last status and last run of Veeam Backup & Replication job passed as an argument.
Powershell needs to be installed on the Nagios box.

The plugin takes 2 arguments:

- Veeam Backup & Replication 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 Success - 1: warning
Success - 0: ok

It has been successfully tested on Veeam Backup & Replication

check_veeam_backups.ps1 [job name] [number of days]

Reviews (9)
byrich568117, July 8, 2020
1 of 1 people found this review helpful
Great script, helped quite a bit here. I am using VBR 9, so I haven't attempted to work anything on v10 yet. I did however fork the project and create a separate script for backup copies. Both are working in my environment. Feedback is appreciated.
bymartinh, March 2, 2020

Here are some edits to be compatible with v10.0. Get-VBRJobSchedule and also GetScheduleOptions() returns data from an outdated location.

if ($status -eq "None"){
$status = (Get-VBRBackupSession -Name $ | sort -Descending)[1].Result

if ($status -eq "None"){
$status = (Get-VBRBackupSession -Name ($'*') | sort -Descending)[1].Result

In v10 the BackupSession's name parameter includes the type of run (incremental / Full).

$last = $job.GetScheduleOptions()
$last = $last -replace '.*Latest run time: \[', ''
$last = $last -replace '\], Next run time: .*', ''
$last = $last.split(' ')[0]

$last = $job.LatestRunLocal.ToString()
$last.Split(' ')[0]
bynarfight, September 4, 2017
to be compatible with the jobs "backup copy"

Add this after "$status = $job.GetLastResult()" :
if ($status -eq "None")
$status = (Get-VBRBackupSession -Name $ | sort -Descending)[1].Result

(Source :
bydiego.quaglio, May 31, 2017
script return me this error: Snap-in not installed...
instead "asnp VeeamPSSnapin" i use "Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue" and it works.
If you upgrade your Veeam to V9, you have a little action to enable powershell console-in :

Reference :

Enable Powershell :
PS C:check_nagios> Add-PSSnapin VeeamPSSnapin

Exec Powershell command :
PS C:check_nagios> Get-VBRJob -Name *Citrix* FreeBackupImpl : IsFree : False UserCryptoKey : Id : ab7b260e-699f-47dc-916c-xxxxxxxxxxx Info : Veeam.Backup.Model.CDbBackupJobInfo JobType : Backup SourceType : VDDK JobTargetType : Backup TargetType : Other TypeToString : VMware Backup Description : Created by XXXXXXXXXX at 27/11/2015 15:39. Name : Citrix_XXXXX BackupPlatform : EVmware TargetHostId : 00000000-0000-0000-0000-000000000000 TargetDir : \10.xx.xx.xxXXXXXX TargetFile : Citrix_XXXXX
bypitw, February 27, 2015
There's a missing bracket in Line 61.

This one works perfectly - also with B&R 8:

if((Get-Date $now) -gt (Get-Date $last))
byladinek, January 15, 2015
Excellent script. During attemps to get it up and running, I encountered two problems.
1. There is a bug at line 56 - missing opening bracket.
if((Get-Date $now) -gt (Get-Date $last))
if(Get-Date $now) -gt (Get-Date $last))

Second, I have Windows 2012 server as my Veeam box. Locales are Czech. From some unknown reason, all functions like Get-Date return date in English format (even more confusing, when you try the same from command line, the locales _are_ taken into account). However, the GetScheduleOptions call returns date with proper locale, so after this attempt to convert it to date results in format error. Even I donĀ“t understand exact nature of this problem, I found fix (this is for Czech format date):
The section of the code looks like this:
$last = $last -replace '\], Next run time: .*', ''

$fmt="d. M. yyyy H:mm:ss"
$last = [datetime]::ParseExact($last,$fmt, $null)

if((Get-Date $now) -gt (Get-Date $last))

Hope this will somebody save some time.
Mostly works out the box, cheers. I found a couple of bugs which might help someone else:

Firstly line 13 threw an error about the SnapIn already being added - fix was to comment it out:

13: #asnp VeeamPSSnapin

Secondly, the date comparison really didn't work, so I changed it from:

56: if ($now -gt $last)


56: if(Get-Date $now) -gt (Get-Date $last))

Which seemed to do the job quite nicely. :-)

If that inadvertently cocks up something else, then whoops - this is the first and hopefully only time I've had to deal with powershell. Give me bash any day...

byfgranat, December 20, 2012
I tested that script on my Veaam Backup server and nothing seems to happen as you can see below :

PS C:Program FilesNSClient++scripts> cmd /c echo check_veeam_backups.ps1 "[BKUP]-SALAG" 3; exit($lastexitcode) | powershell.exe -command -
check_veeam_backups.ps1 [BKUP]-SALAG 3

The job [BKUP]-SALAG ended successfuly yesterday evening.
Do you have any explanation ?


Owner's reply


What exact version of Veeam Backup & Replication do you use? Please, try to download my latest update of the plugin.

Also, please try double quotation of job name as on an example below:

check_veeam_backups1 = cmd /c echo scriptscheck_veeam_backups.ps1 ""0 - CRITICAL - backup level"" 1; exit $LastExitCode | powershell.exe -command -