summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorndarshan <dnarayan@redhat.com>2014-11-21 17:02:40 +0530
committerSahina Bose <sabose@redhat.com>2014-11-26 22:43:33 -0800
commitde2d81b459e8674e49d4993b15b5d383f72c301e (patch)
treeaec68ad2c40c0faca5bd10eb9a883c0b7dab6291
parentbc31d1f4f278dea2f0c0892a412734302c6bf308 (diff)
brick plugin: set rrd configuration to multiple.
By default perfdata is created in single rrd file which causes failure of fetching DS in upgrade scenario. Because earlier brick utilization had only one DS. Now with thin LV monitoring included in brick utilization, It will be having two DS. The graph templates wont be able to read them in single rrd file. So in case of upgrade we run the script rrd_convert as a pre step to migrate the old data to new rrd files.and this patch also sets pnp4nagios rrd configuration to multiple rrd file for each DS. Change-Id: Iadb50250b2e93d73b61e25be90a0770dae0780f3 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1143995 Signed-off-by: ndarshan <dnarayan@redhat.com> Reviewed-on: http://review.gluster.org/9188 Reviewed-by: Sahina Bose <sabose@redhat.com>
-rw-r--r--nagios-server-addons.spec.in9
-rw-r--r--templates/Makefile.am1
-rw-r--r--templates/check_brick_usage.cfg1
-rw-r--r--templates/check_brick_usage.php3
4 files changed, 11 insertions, 3 deletions
diff --git a/nagios-server-addons.spec.in b/nagios-server-addons.spec.in
index d62417a..4b5374a 100644
--- a/nagios-server-addons.spec.in
+++ b/nagios-server-addons.spec.in
@@ -122,6 +122,14 @@ make install DESTDIR=%{buildroot}
%clean
rm -rf %{buildroot}
+%pre
+if [ $1 -gt 1 ] ; then
+ if ! grep -q "RRD_STORAGE_TYPE = MULTIPLE" %{_sysconfdir}/pnp4nagios/check_commands/check_brick_usage.cfg ; then
+ echo "y" | su -c '%{_libexecdir}/pnp4nagios/rrd_convert.pl --cfg_dir=%{_sysconfdir}/pnp4nagios --check_command=check_brick_usage' -s '/bin/bash' nagios 1> /dev/null
+ fi
+fi
+
+
%post
NagiosCFGFile="/etc/nagios/nagios.cfg"
sed -i '/etc\/nagios\/objects\/localhost.cfg/d' $NagiosCFGFile
@@ -240,6 +248,7 @@ fi
%config(noreplace) %attr(-, root, nagios) %{_sysconfdir}/nagios/gluster/snmpmanagers.conf
%config(noreplace) %{_sysconfdir}/nagios/gluster/*
%{_sysconfdir}/sudoers.d/nagios
+%{_sysconfdir}/pnp4nagios/check_commands/check_brick_usage.cfg
%{_sysconfdir}/pnp4nagios/check_commands/check_disk_and_inode.cfg
%{_sysconfdir}/pnp4nagios/check_commands/check_interfaces.cfg
/usr/share/snmp/mibs/*
diff --git a/templates/Makefile.am b/templates/Makefile.am
index 78b81b4..6d93fd7 100644
--- a/templates/Makefile.am
+++ b/templates/Makefile.am
@@ -1,5 +1,6 @@
pnp4nagioscheckcommanddir = $(sysconfdir)/pnp4nagios/check_commands
pnp4nagioscheckcommand_DATA = \
+ check_brick_usage.cfg \
check_disk_and_inode.cfg \
check_interfaces.cfg \
$(NULL)
diff --git a/templates/check_brick_usage.cfg b/templates/check_brick_usage.cfg
new file mode 100644
index 0000000..718dc42
--- /dev/null
+++ b/templates/check_brick_usage.cfg
@@ -0,0 +1 @@
+RRD_STORAGE_TYPE = MULTIPLE
diff --git a/templates/check_brick_usage.php b/templates/check_brick_usage.php
index 5f00b87..9c926b8 100644
--- a/templates/check_brick_usage.php
+++ b/templates/check_brick_usage.php
@@ -24,9 +24,6 @@ foreach ($this->DS as $KEY=>$VAL) {
# $VAL['NAME'] = str_replace("_","/",$VAL['NAME']);
$ds_name[$KEY] = "Brick Utilization ";
$graph_type = $VAL['LABEL'];
- if ($graph_type == "Virtual" ) {
- $ds_name[$KEY] .= "(virtual)";
- }
if ($graph_type == "Thin-pool" ) {
$ds_name[$KEY] .= "(Thin-pool)";
}