From 25a9105f9583cf165526db0c24c67bd12c4336fe Mon Sep 17 00:00:00 2001 From: Timothy Asir Date: Wed, 7 May 2014 15:34:08 +0530 Subject: Add check brick usage pnp4nagios template plugin Change-Id: If55d9a0f36fbb16136fe46dbbdc31b2f52228a7b Signed-off-by: Timothy Asir Reviewed-on: http://review.gluster.org/7691 Tested-by: Timothy Asir Reviewed-by: Timothy Asir --- templates/check_brick_usage.php | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 templates/check_brick_usage.php (limited to 'templates') 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 @@ +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"); +} +?> -- cgit