summaryrefslogtreecommitdiffstats
path: root/nagios-server-addons.spec.in
diff options
context:
space:
mode:
authorRamesh Nachimuthu <rnachimu@redhat.com>2014-11-14 10:19:47 +0530
committerSahina Bose <sabose@redhat.com>2014-11-17 21:38:06 -0800
commitc30f0e1ee1193d7585ad7378da4c360421b545b0 (patch)
tree85be1c4907cdf63bf2c6570f000cd01a4960c605 /nagios-server-addons.spec.in
parent1a9d3e25e46db64d66a6ac26b20f831608794da8 (diff)
autoconf: unregister the temp_node1 instead of deleting it.
Unregistering the temp_node1 instead of deleting it while configuring nagios . new field 'register' will be added to temp_node1 and its services with value 0, so that it won't be considered by nagios. If both files, temp_node1.cfg and temp_node1.cfg.sample are present during upgrade then we will remove the file temp_node1.cfg.sample and add the 'register 0' flag to definitions in temp_node1.cfg file. Bug-Url: https://bugzilla.redhat.com/1162446 Bug-Url: https://bugzilla.redhat.com/1162443 Bug-Url: https://bugzilla.redhat.com/1115387 Change-Id: I3c76d6c6a9a9e411315859e07238a7902ddd2380 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/9123 Reviewed-by: Kanagaraj M <kmayilsa@redhat.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'nagios-server-addons.spec.in')
-rw-r--r--nagios-server-addons.spec.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/nagios-server-addons.spec.in b/nagios-server-addons.spec.in
index 23149d3..0fe4fea 100644
--- a/nagios-server-addons.spec.in
+++ b/nagios-server-addons.spec.in
@@ -126,6 +126,13 @@ rm -rf %{buildroot}
NagiosCFGFile="/etc/nagios/nagios.cfg"
sed -i '/etc\/nagios\/objects\/localhost.cfg/d' $NagiosCFGFile
+LocalhostCfgFile="%{_sysconfdir}/nagios/gluster/default/temp_node1.cfg"
+LocalhostCfgFileEdited="%{_sysconfdir}/nagios/gluster/default/temp_node1.cfg.sample"
+if [ -f $LocalhostCfgFileEdited ]; then
+ sed -i '/host_name * temp_node1/a \ register 0' $LocalhostCfgFile
+ rm $LocalhostCfgFileEdited
+fi
+
if grep -q "#process_performance_data=0" $NagiosCFGFile; then
sed -i -e 's/#process_performance_data=0/process_performance_data=1/g' $NagiosCFGFile
elif grep -q "process_performance_data=0" $NagiosCFGFile ; then