Module: check_mk
Branch: master
Commit: 94b78d0c946029a6122cb45491d8de55cdf837b6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94b78d0c946029…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 27 18:37:19 2011 +0100
Added perfometer for ORACLE tablespaces
---
pnp-templates/check_mk-oracle_tablespaces.php | 12 ------------
web/plugins/perfometer/check_mk.py | 14 ++++++++++++++
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/pnp-templates/check_mk-oracle_tablespaces.php
b/pnp-templates/check_mk-oracle_tablespaces.php
index 107203c..88c9371 100644
--- a/pnp-templates/check_mk-oracle_tablespaces.php
+++ b/pnp-templates/check_mk-oracle_tablespaces.php
@@ -45,16 +45,4 @@ $def[1] .= "AREA:used_gb#f0b000:\"Used by user data\"
" ;
$def[1] .= "LINE:used_gb#806000:\"\" " ;
$def[1] .= "GPRINT:used_gb:LAST:\"%2.2lfGB\" ";
-# $def[1] .= "AREA:system#ff6000:\"System\" " ;
-# $def[1] .= "GPRINT:system:LAST:\"%2.1lf%%\" " ;
-#
-# $def[1] .= "AREA:user#60f020:\"User\":STACK " ;
-# $def[1] .= "GPRINT:user:LAST:\"%2.1lf%%\" " ;
-#
-# $def[1] .= "AREA:wait#00b0c0:\"$thirdname\":STACK " ;
-# $def[1] .= "GPRINT:wait:LAST:\"%2.1lf%%\" " ;
-#
-# $def[1] .= "LINE:sum#004080:\"Utilization\" " ;
-# $def[1] .= "GPRINT:sum:LAST:\"%2.1lf%%\" " ;
-
?>
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 7c12b14..2ef7a81 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -211,3 +211,17 @@ perfometers["check_mk-if"] = performeter_check_mk_if
perfometers["check_mk-if64"] = performeter_check_mk_if
perfometers["check_mk-hpux_if"] = performeter_check_mk_if
+def performeter_oracle_tablespaces(row, check_command, perf_data):
+ current = float(perf_data[0][1])
+ used = float(perf_data[1][1])
+ max = float(perf_data[2][1])
+ used_perc = used / max * 100
+ curr_perc = (current / max * 100) - used_perc
+ h = '<table><tr>'
+ h += perfometer_td(used_perc, "#f0b000");
+ h += perfometer_td(curr_perc, "#00ff80");
+ h += perfometer_td(100 - used_perc - curr_perc, "#80c0ff");
+ h += '</tr></table>'
+ return "%.1f%%" % used_perc, h
+
+perfometers["check_mk-oracle_tablespaces"] = performeter_oracle_tablespaces