Module: check_mk
Branch: master
Commit: da280d72ab132f57ba49fe4fe4e96377f836982e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=da280d72ab132f…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Nov 6 16:22:02 2013 +0100
veeam_client: new check to monitor status of veeam clients with special agent plugin
This new check monitors client operations of the veeam backup tool. It comes with the
check script, template for pnp4nagios, and a special windows agent plugin which needs
to be installed on the veeam server. It monitors the state of the backup operation,
and stores the total backup size, backup duration and data thruput of the backup as
performance data.
---
.werks/63 | 12 ++++
ChangeLog | 1 +
agents/windows/plugins/veeam_backup_status.bat | 8 +++
agents/windows/plugins/veeam_backup_status.ps1_ | Bin 0 -> 9654 bytes
checkman/veeam_client | 26 +++++++++
checks/veeam_client | 71 +++++++++++++++++++++++
pnp-templates/check_mk-veeam_client.php | 52 +++++++++++++++++
7 files changed, 170 insertions(+)
diff --git a/.werks/63 b/.werks/63
new file mode 100644
index 0000000..aaddc7e
--- /dev/null
+++ b/.werks/63
@@ -0,0 +1,12 @@
+Title: veeam_client: new check to monitor status of veeam clients with special agent
plugin
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1383751157
+Class: feature
+
+This new check monitors client operations of the veeam backup tool. It comes with the
+check script, template for pnp4nagios, and a special windows agent plugin which needs
+to be installed on the veeam server. It monitors the state of the backup operation,
+and stores the total backup size, backup duration and data thruput of the backup as
+performance data.
diff --git a/ChangeLog b/ChangeLog
index eb78c38..2b6f686 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Checks & Agents:
* 0060: cisco_fantray: new check for monitoring fan trays of Cisco Nexus switches...
* 0061: cisco_cpu: check now recognizes new object cpmCPUTotal5minRev...
+ * 0063: veeam_client: new check to monitor status of veeam clients with special agent
plugin...
Multisite:
* 0001: New filters for selecting several host/service-groups at once...
diff --git a/agents/windows/plugins/veeam_backup_status.bat
b/agents/windows/plugins/veeam_backup_status.bat
new file mode 100644
index 0000000..1e21286
--- /dev/null
+++ b/agents/windows/plugins/veeam_backup_status.bat
@@ -0,0 +1,8 @@
+@ECHO OFF
+REM version 0.9
+REM Put this file in cmk Plugins-Folder *only* if you need to run
+REM the veeam_backup_status.ps1 powershell script and you
+REM have no 64 bit check_mk agent available
+REM In this case the powershell script needs to be put somewhere else
+REM (see example here) and is called from this .bat script with the 64 bit powershell
+%systemroot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy
Unrestricted " &
""C:\skripte\veeam_backup_status.ps1"""
diff --git a/agents/windows/plugins/veeam_backup_status.ps1_
b/agents/windows/plugins/veeam_backup_status.ps1_
new file mode 100644
index 0000000..e63d945
Binary files /dev/null and b/agents/windows/plugins/veeam_backup_status.ps1_ differ
diff --git a/checkman/veeam_client b/checkman/veeam_client
new file mode 100644
index 0000000..e7d54cb
--- /dev/null
+++ b/checkman/veeam_client
@@ -0,0 +1,26 @@
+title: veeam client backup check
+agents: windows
+catalog: os/storage
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the status of backups of clients carried out by the Veeam
+ backup tool. In order to carry out the checks, the Veeam agent plugin
+ needs to be installed on the backup server. See special instructions in the
+ comment section of the two Veeam agent plugin scripts on how to install
+ the scripts.
+
+ The plugin sends data for all virtual machines as piggyback data in the agent
+ output of the backup server.
+
+ This check is {OK} if the status of the backup is {success}, {Pending}
+ or {InProgress}. It is {WARN} if the status is {Warning}. It is {CRIT}
+ if the status of the backup is {Failed}.
+
+inventory:
+ A check will be created for all hosts known to check_mk and reported
+ by the Veeam agent plugin.
+
+perfdata:
+ Total Size, duration and the average speed of the backup will be recorded
+ as performance data.
diff --git a/checks/veeam_client b/checks/veeam_client
new file mode 100644
index 0000000..3513189
--- /dev/null
+++ b/checks/veeam_client
@@ -0,0 +1,71 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+state = { "Success": 0, "Failed": 2, "Warning":1,
"InProgress":0, "Pending":0 }
+
+def inventory_veeam_client(info):
+ if info[0][0] == "Status":
+ return [ (None, None) ]
+
+def check_veeam_client(item, params, info):
+ if not info[0][0] == "Status":
+ return 3, "No status data found in first line of agent data"
+ result = ""
+ starttime = ""
+ stoptime = ""
+ duration_string = ""
+ infotxt = ""
+ perfdata = []
+ for line in info:
+ if line[0] == "Status":
+ result = line[1]
+ infotxt += line[0] + ":" + line[1] + " "
+ elif line[0] == "DurationDDHHMMSS":
+ duration_string = line[1]
+ spur = map(saveint, duration_string.split(":") )
+ if len(spur) == 4:
+ duration = str(spur[0]*86400 + spur[1] * 3600 + spur[2] * 60 + spur[3])
+ else:
+ duration = "0"
+ perfdata.append(("duration", duration+"s", 0, 0, 0))
+ elif line[0] == "AvgSpeedBps":
+ avgspeed = saveint(line[1])
+ perfdata.append(("avgspeed", avgspeed, 0, 0, 0))
+ elif line[0] == "TotalSizeByte":
+ totalsize = saveint(line[1])
+ perfdata.append(("totalsize", totalsize, 0, 0, 0))
+ else:
+ infotxt += line[0] + ":" + line[1] + " "
+
+ return (state[result], infotxt, perfdata)
+
+check_info["veeam_client"] = {
+ 'check_function': check_veeam_client,
+ 'inventory_function': inventory_veeam_client,
+ 'service_description': 'VEEAM Client',
+ 'has_perfdata': True,
+}
+
diff --git a/pnp-templates/check_mk-veeam_client.php
b/pnp-templates/check_mk-veeam_client.php
new file mode 100644
index 0000000..00f00da
--- /dev/null
+++ b/pnp-templates/check_mk-veeam_client.php
@@ -0,0 +1,52 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+$opt[1] = "--vertical-label 'Bytes' -l 0 --title '$hostname: Total Size
of Backup' ";
+
+$def[1] = "DEF:mb=$RRDFILE[1]:$DS[1]:MAX ";
+$def[1] .= "CDEF:var1=mb,1048576,/ ";
+$def[1] .= "AREA:mb#d080af:\"Total Size \" ";
+$def[1] .= "LINE1:mb#d020a0: ";
+$def[1] .= "GPRINT:var1:LAST:\"last\: %8.1lf MB\" ";
+$def[1] .= "GPRINT:var1:MAX:\"max\: %8.1lf MB \" ";
+
+$opt[2] = "--vertical-label 'time (sec)' -l 0 -X 0 --title '$hostname:
Duration of Backup' ";
+
+$def[2] = "DEF:duration=$RRDFILE[2]:$DS[1]:MAX ";
+$def[2] .= "AREA:duration#d080af:\"duration \" ";
+$def[2] .= "LINE1:duration#d020a0: ";
+$def[2] .= "GPRINT:duration:LAST:\"last\: %8.1lf s\" ";
+$def[2] .= "GPRINT:duration:MAX:\"max\: %8.1lf s \" ";
+$def[2] .= "GPRINT:duration:AVERAGE:\"avg\: %8.1lf s\\n\" ";
+
+$opt[3] = "--vertical-label 'Bytes/sec' -l 0 --title '$hostname:
Average Speed of Backup' ";
+$def[3] = "DEF:avgspeed=$RRDFILE[3]:$DS[1]:MAX ";
+$def[3] .= "CDEF:var2=avgspeed,1048576,/ ";
+$def[3] .= "LINE1:avgspeed#d020a0:\"thruput\" ";
+$def[3] .= "GPRINT:var2:LAST:\" last\: %8.2lf MB/s\" ";
+$def[3] .= "GPRINT:var2:MAX:\"max\: %8.2lf MB/s \" ";
+$def[3] .= "GPRINT:var2:AVERAGE:\"avg\: %8.2lf MB/s\\n\" ";
+
+?>