diff options
-rw-r--r-- | nagios-server-addons.spec.in | 1 | ||||
-rw-r--r-- | templates/Makefile.am | 1 | ||||
-rw-r--r-- | templates/check_vol_utilization.php | 37 |
3 files changed, 39 insertions, 0 deletions
diff --git a/nagios-server-addons.spec.in b/nagios-server-addons.spec.in index 997c07f..7eb153c 100644 --- a/nagios-server-addons.spec.in +++ b/nagios-server-addons.spec.in @@ -200,6 +200,7 @@ fi %{_datadir}/nagios/html/pnp4nagios/templates.dist/check_interfaces.php %{_datadir}/nagios/html/pnp4nagios/templates.dist/check_memory.php %{_datadir}/nagios/html/pnp4nagios/templates.dist/check_swap_usage.php +%{_datadir}/nagios/html/pnp4nagios/templates.dist/check_vol_utilization.php %attr(0755, -, -) %{_libdir}/nagios/plugins/gluster/* %attr(0775, root, nagios) %dir %{_sysconfdir}/nagios/gluster %attr(-, root, nagios) %{_sysconfdir}/nagios/gluster/snmpmanagers.conf 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\" "; +} +?> |