Module: check_mk
Branch: master
Commit: c0faf306bed7d5d0ba5522ae183c2fb98cb4db8d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0faf306bed7d5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 3 14:59:00 2016 +0100
#3045 FIX veeam_backup_status: Fixed wrong date format reported by agent
Fixing an exception during date parsing of the agent output. This has been
fixed in the agent, you should update it. But the current check has also
been made compatible to the old output.
---
.werks/3045 | 11 +++++++++++
ChangeLog | 1 +
agents/windows/plugins/veeam_backup_status.ps1_ | 8 ++++----
checks/veeam_client | 11 +++++++++--
4 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/.werks/3045 b/.werks/3045
new file mode 100644
index 0000000..c5bd562
--- /dev/null
+++ b/.werks/3045
@@ -0,0 +1,11 @@
+Title: veeam_backup_status: Fixed wrong date format reported by agent
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1454507896
+Class: fix
+
+Fixing an exception during date parsing of the agent output. This has been
+fixed in the agent, you should update it. But the current check has also
+been made compatible to the old output.
diff --git a/ChangeLog b/ChangeLog
index dfc3ca8..8b675b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -243,6 +243,7 @@
* 2987 FIX: esx_vsphere_counters: Improved accuracy of all counter values...
* 3065 FIX: mem.win: renamed "Pagefile" to "Commit Charge" to
clarify what the number actually expresses...
* 3043 FIX: agent_emcvnx: Fixed error handling in case of missing naviseccli command
+ * 3045 FIX: veeam_backup_status: Fixed wrong date format reported by agent...
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 99ee5d3..df9d9b1 100644
--- a/agents/windows/plugins/veeam_backup_status.ps1_
+++ b/agents/windows/plugins/veeam_backup_status.ps1_
@@ -53,10 +53,10 @@ foreach ($myJob in $myBackupJobs)
$myJobLastSession = $myJob.FindLastSession()
$myJobCreationTime = ""
- $myJobCreationTime = $myJobLastSession.CreationTime | get-date -Format "dd.MM.yyyy
HH:mm:ss" -ErrorAction SilentlyContinue
+ $myJobCreationTime = $myJobLastSession.CreationTime | get-date -Format "dd.MM.yyyy
HH\:mm\:ss" -ErrorAction SilentlyContinue
$myJobEndTime = ""
- $myJobEndTime = $myJobLastSession.EndTime | get-date -Format "dd.MM.yyyy
HH:mm:ss" -ErrorAction SilentlyContinue
+ $myJobEndTime = $myJobLastSession.EndTime | get-date -Format "dd.MM.yyyy
HH\:mm\:ss" -ErrorAction SilentlyContinue
$myJobsText = "$myJobsText" + "$myJobName" + "`t" +
"$myJobType" + "`t" + "$myJobLastState" + "`t" +
"$myJobLastResult" + "`t" + "$myJobCreationTime" +
"`t" + "$myJobEndTime" + "`n"
@@ -109,12 +109,12 @@ foreach ($myJob in $myBackupJobs)
$myTaskText = "$myTaskText" + "TransferedSizeByte" + "`t"
+ "$myTaskTransferedSize" + "`n"
$myTaskStartTime = ""
- $myTaskStartTime = $myTask.Progress.StartTime | get-date -Format "dd.MM.yyyy
HH:mm:ss" -ErrorAction SilentlyContinue
+ $myTaskStartTime = $myTask.Progress.StartTime | get-date -Format "dd.MM.yyyy
HH\:mm\:ss" -ErrorAction SilentlyContinue
$myTaskText = "$myTaskText" + "StartTime" + "`t" +
"$myTaskStartTime" + "`n"
$myTaskStopTime = ""
- $myTaskStopTime = $myTask.Progress.StopTime | get-date -Format "dd.MM.yyyy
HH:mm:ss" -ErrorAction SilentlyContinue
+ $myTaskStopTime = $myTask.Progress.StopTime | get-date -Format "dd.MM.yyyy
HH\:mm\:ss" -ErrorAction SilentlyContinue
$myTaskText = "$myTaskText" + "StopTime" + "`t" +
"$myTaskStopTime" + "`n"
diff --git a/checks/veeam_client b/checks/veeam_client
index a240b17..4ca42cd 100644
--- a/checks/veeam_client
+++ b/checks/veeam_client
@@ -103,13 +103,20 @@ def check_veeam_client(item, params, parsed):
infotexts.append("Size (%s): %s" % ("/".join(size_legend),
"/ ".join(size_info)))
+
+ # Bugged agent plugins were reporting . instead of : as separator for
+ # the time. This has been fixed in the agent, but be compatible to old agent.
+ timesep = ":"
+ if "StopTime" in data and timesep not in data['StopTime']:
+ timesep = "."
+
# Check Stop time in any case, that we can catch hanging backups
if "StopTime" not in data:
state = 2
infotexts.append("No complete Backup(!!)")
# If the Backup currently is running, the stop time is strange.
- elif data['StopTime'] != "01.01.1900 00:00:00":
- stop_time = time.mktime(time.strptime( data['StopTime'], "%d.%m.%Y
%H:%M:%S"))
+ elif data['StopTime'] != "01.01.1900
00"+timesep+"00"+timesep+"00":
+ stop_time = time.mktime(time.strptime( data['StopTime'], "%d.%m.%Y
%H"+timesep+"%M"+timesep+"%S"))
now = time.time()
age = now - stop_time
warn, crit = params['age']