summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nagios-server-addons.spec.in1
-rw-r--r--templates/Makefile.am1
-rw-r--r--templates/check_cluster_vol_usage.php37
3 files changed, 39 insertions, 0 deletions
diff --git a/nagios-server-addons.spec.in b/nagios-server-addons.spec.in
index 0fe4fea..d62417a 100644
--- a/nagios-server-addons.spec.in
+++ b/nagios-server-addons.spec.in
@@ -234,6 +234,7 @@ fi
%{_datadir}/nagios/html/pnp4nagios/templates.dist/check_swap_usage.php
%{_datadir}/nagios/html/pnp4nagios/templates.dist/check_vol_utilization.php
%{_datadir}/nagios/html/pnp4nagios/templates.dist/check_brick_usage.php
+%{_datadir}/nagios/html/pnp4nagios/templates.dist/check_cluster_vol_usage.php
%attr(0755, -, -) %{_libdir}/nagios/plugins/gluster/*
%attr(0775, root, nagios) %dir %{_sysconfdir}/nagios/gluster
%config(noreplace) %attr(-, root, nagios) %{_sysconfdir}/nagios/gluster/snmpmanagers.conf
diff --git a/templates/Makefile.am b/templates/Makefile.am
index c229efe..78b81b4 100644
--- a/templates/Makefile.am
+++ b/templates/Makefile.am
@@ -6,6 +6,7 @@ pnp4nagioscheckcommand_DATA = \
pnp4nagiostemplatedir = $(datarootdir)/nagios/html/pnp4nagios/templates.dist
pnp4nagiostemplate_DATA = \
+ check_cluster_vol_usage.php \
check_cpu_multicore.php \
check_disk_and_inode.php \
check_interfaces.php \
diff --git a/templates/check_cluster_vol_usage.php b/templates/check_cluster_vol_usage.php
new file mode 100644
index 0000000..1da5860
--- /dev/null
+++ b/templates/check_cluster_vol_usage.php
@@ -0,0 +1,37 @@
+<?php
+#
+# check_cluster_vol_usage -- template to generate RRD graph
+# for cluster 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] = "Cluster 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\" ";
+}
+?>