Module: check_mk
Branch: master
Commit: d6740bd174307948054dfe42d6d2d67f289d522e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d6740bd1743079…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jun 22 10:48:05 2012 +0200
Added MSSQL tablespace perfometer
---
web/plugins/perfometer/check_mk.py | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 9dc44d6..525cfb8 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -433,3 +433,24 @@ def perfometer_fileinfo_groups(row, check_command, perf_data):
perfometers["check_mk-fileinfo"] = perfometer_fileinfo
perfometers["check_mk-fileinfo.groups"] = perfometer_fileinfo_groups
+
+def perfometer_mssql_tablespaces(row, check_command, perf_data):
+ size = float(perf_data[0][1])
+ unallocated = float(perf_data[1][1])
+ reserved = float(perf_data[2][1])
+ data = float(perf_data[3][1])
+ indexes = float(perf_data[4][1])
+ unused = float(perf_data[5][1])
+
+ data_perc = data / reserved * 100
+ indexes_perc = indexes / reserved * 100
+ unused_perc = unused / reserved * 100
+
+ h = '<table><tr>'
+ h += perfometer_td(data_perc, "#80c0ff");
+ h += perfometer_td(indexes_perc, "#00ff80");
+ h += perfometer_td(unused_perc, "#f0b000");
+ h += '</tr></table>'
+ return "%.1f%%" % (data_perc + indexes_perc), h
+
+perfometers["check_mk-mssql_tablespaces"] = perfometer_mssql_tablespaces