summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Asir <tjeyasin@redhat.com>2014-05-07 15:34:08 +0530
committerTimothy Asir <tim.gluster@gmail.com>2014-05-16 02:45:57 -0700
commit25a9105f9583cf165526db0c24c67bd12c4336fe (patch)
tree83c8f1c624e508b5260524d6186a8d9e8937380b
parentc910f8e3c94c49e22afd49bf8fb367ca37892b73 (diff)
Add check brick usage pnp4nagios template plugin
Change-Id: If55d9a0f36fbb16136fe46dbbdc31b2f52228a7b Signed-off-by: Timothy Asir <tjeyasin@redhat.com> Reviewed-on: http://review.gluster.org/7691 Tested-by: Timothy Asir <tim.gluster@gmail.com> Reviewed-by: Timothy Asir <tim.gluster@gmail.com>
-rw-r--r--templates/check_brick_usage.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/templates/check_brick_usage.php b/templates/check_brick_usage.php
new file mode 100644
index 0000000..6097a09
--- /dev/null
+++ b/templates/check_brick_usage.php
@@ -0,0 +1,48 @@
+<?php
+#
+# check_interfaces -- template to generate RRD graph
+# Copyright (C) 2014 Red Hat Inc
+#
+# This program 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; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+#
+# set graph labels
+foreach ($this->DS as $KEY=>$VAL) {
+ # $VAL['NAME'] = str_replace("_","/",$VAL['NAME']);
+ $ds_name[$KEY] = "Brick Utilization";
+ $name[$KEY] = "Brick Path: " . $NAGIOS__SERVICEBRICK_DIR;
+
+ # set graph labels
+ $max_limit = $VAL['MAX'];
+ $opt[$KEY] = "--vertical-label \"%(Total: $max_limit GB) \" --lower-limit 0 --upper-limit 100 --title \"$name[$KEY]\" ";
+
+ # Graph Definitions
+ $def[$KEY] = rrd::def( "var1", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE" );
+
+ # disk graph rendering
+ $def[$KEY] .= rrd::area( "var1", "#008000", "Brick Usage" );
+ $def[$KEY] .= rrd::gprint ("var1", array("LAST","MAX","AVERAGE"), "%3.4lf %S%%");
+ $i = 1;
+ $k = $KEY;
+
+ # create warning line and legend
+ $def[$k] .= rrd::line2( $VAL['WARN'], "#FFA500", "Warning\\n");
+
+# create critical line and legend
+ $def[$k] .= rrd::line2( $VAL['CRIT'], "#FF0000", "Critical\\n");
+ $def[$k] .= rrd::comment (" \\n");
+}
+?>