Module: check_mk
Branch: master
Commit: f18f14f1075766d982122bccd90568df5a872e02
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f18f14f1075766…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 6 11:49:48 2015 +0100
#2726 FIX veeam_backup_status: Fixed missing agent section error in case of aborted tasks
---
.werks/2726 | 10 ++++++++++
ChangeLog | 1 +
agents/windows/plugins/veeam_backup_status.ps1_ | 16 ++++++++++++++--
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/.werks/2726 b/.werks/2726
new file mode 100644
index 0000000..5e97975
--- /dev/null
+++ b/.werks/2726
@@ -0,0 +1,10 @@
+Title: veeam_backup_status: Fixed missing agent section error in case of aborted tasks
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446806931
+
+
diff --git a/ChangeLog b/ChangeLog
index b3d6d35..81c1705 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -50,6 +50,7 @@
* 2737 FIX: bluecoat_sensors: fix crash when using Nagios as core (missing
include)...
* 2738 FIX: Check_MK Caching agent on Linux: introduce timeout for lock...
* 2725 FIX: Dynamic levels: Enforce config of levels for filesystems larger than 0
bytes...
+ * 2726 FIX: veeam_backup_status: Fixed missing agent section error in case of aborted
tasks
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/agents/windows/plugins/veeam_backup_status.ps1_
b/agents/windows/plugins/veeam_backup_status.ps1_
index 8daed9f..99ee5d3 100644
--- a/agents/windows/plugins/veeam_backup_status.ps1_
+++ b/agents/windows/plugins/veeam_backup_status.ps1_
@@ -60,10 +60,22 @@ foreach ($myJob in $myBackupJobs)
$myJobsText = "$myJobsText" + "$myJobName" + "`t" +
"$myJobType" + "`t" + "$myJobLastState" + "`t" +
"$myJobLastResult" + "`t" + "$myJobCreationTime" +
"`t" + "$myJobEndTime" + "`n"
+ # For Non Backup Jobs (Replicas) we bail out
+ # because we are interested in the status of the original backup but
+ # for replicas the overall job state is all we need.
+ if ($myJob.IsBackup -eq $false) { continue }
+
# Each backup job has a number of tasks which were executed (VMs which were processed)
# Get all Tasks of the L A S T backup session
- # Caution: Each backup job MAY have run SEVERAL times for retries
- $myJobLastSessionTasks = $myJobLastSession | Get-VBRTaskSession -ErrorAction
SilentlyContinue
+ # Caution: Each backup job MAY have run SEVERAL times for retries,
+ # thats why we need all sessions related to the last one if its a retry
+ $sessions = @($myJobLastSession)
+ if ($myJobLastSession.IsRetryMode)
+ {
+ $sessions = $myJobLastSession.GetOriginalAndRetrySessions($TRUE)
+ }
+
+ $myJobLastSessionTasks = $sessions | Get-VBRTaskSession -ErrorAction SilentlyContinue
# Iterate through all tasks in the last backup job
$myTask = ""