diff options
-rw-r--r-- | nagios-server-addons.spec.in | 9 | ||||
-rw-r--r-- | templates/Makefile.am | 1 | ||||
-rw-r--r-- | templates/check_brick_usage.cfg | 1 | ||||
-rw-r--r-- | templates/check_brick_usage.php | 3 |
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)"; } |