diff options
author | Nishanth Thomas <nthomas@redhat.com> | 2014-05-09 14:01:37 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2014-05-13 03:23:05 -0700 |
commit | 9379f10239710c950c8ce319a18022215a892a66 (patch) | |
tree | f12a069c8f13bfdd9548d4a563685b38eaebd9c7 /templates | |
parent | fdc74de01faf52114578b64481c44d58abc06405 (diff) |
nagios-server-addons : Added a php template for volume utilization
Volume Utilization plugin didn't have a php template written and
hence the graph was not getting displayed properly
Change-Id: I6726a6de5370d271467be03e9e8500421cf66e39
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1095427
Signed-off-by: Nishanth Thomas <nthomas@redhat.com>
Reviewed-on: http://review.gluster.org/7724
Tested-by: Nishanth Thomas <nishusemail@gmail.com>
Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/Makefile.am | 1 | ||||
-rw-r--r-- | templates/check_vol_utilization.php | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/templates/Makefile.am b/templates/Makefile.am index ccd3006..edece53 100644 --- a/templates/Makefile.am +++ b/templates/Makefile.am @@ -5,6 +5,7 @@ pnp4nagiostemplate_DATA = \ check_interfaces.php \ check_memory.php \ check_swap_usage.php \ + check_vol_utilization.php \ $(NULL) EXTRA_DIST = \ diff --git a/templates/check_vol_utilization.php b/templates/check_vol_utilization.php new file mode 100644 index 0000000..d5f5e39 --- /dev/null +++ b/templates/check_vol_utilization.php @@ -0,0 +1,37 @@ +<?php +# +# check_vol_utilization -- template to generate RRD graph +# for volume utilization plugin +# 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. +# +$def[1]=""; $opt[1]=""; $ds_name[1]=""; +$opt[1] = "--vertical-label \"% Usage\" -r --lower-limit 0 --upper-limit 100 --title \"$NAGIOS_HOSTNAME / $NAGIOS_SERVICEDISPLAYNAME\" --slope-mode -u 100 -N"; +$ds_name[1] = "Volume Utilization"; + +$def[1] = "DEF:utilzation_in=$RRDFILE[1]:$DS[1]:AVERAGE " ; + +$def[1] .= "CDEF:utilzation_out=utilzation_in "; +$def[1] .= "AREA:utilzation_out#ADD8E6:\"utilization\t\t\" "; +$def[1] .= rrd::gprint("utilzation_out", array("LAST", "AVERAGE", "MAX"), "%6.2lf%%"); + +if ($WARN[1] != ""){ + $def[1] .= "LINE2:$WARN[1]#FFA500:\"Warning\\n\" "; +} +if ($CRIT[1] != ""){ + $def[1] .= "LINE2:$CRIT[1]#FF0000:\"Critical\\n\" "; +} +?> |