summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRamesh Nachimuthu <rnachimu@redhat.com>2014-04-27 19:03:45 +0530
committerBala.FA <barumuga@redhat.com>2014-04-29 10:21:37 +0530
commit0bb9c00a64b981d4b793f618c5dbda8337b99ce0 (patch)
treea08460e82155dfa2ce9a0b2c66c3aab1d2156780 /config
parent6e01d10fbc862478485168a83f3542bb249e341b (diff)
auto config : Enhance the auto config to preserve user changes
Enhace the auto configuration in nagios to preserve the user changes. pynag apis are used to read/write/update the nagios config files. Change-Id: I6820928fb2b0baff5d6e65c811a48b5ff718f9e3 Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com>
Diffstat (limited to 'config')
-rw-r--r--config/Makefile.am1
-rw-r--r--config/gluster-commands.cfg2
-rw-r--r--config/gluster-host.cfg.template34
3 files changed, 1 insertions, 36 deletions
diff --git a/config/Makefile.am b/config/Makefile.am
index 60da34c..3176aa7 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -12,7 +12,6 @@ glusternagiosconf_DATA = \
glusternagiosdefaultconfdir = $(sysconfdir)/nagios/gluster/default
glusternagiosdefaultconf_DATA = \
glustercluster.cfg.sample \
- gluster-host.cfg.template \
node1.cfg \
$(NULL)
diff --git a/config/gluster-commands.cfg b/config/gluster-commands.cfg
index 57b76ce..8c5594f 100644
--- a/config/gluster-commands.cfg
+++ b/config/gluster-commands.cfg
@@ -73,7 +73,7 @@ define command{
define command{
command_name gluster_auto_discovery
- command_line $USER1$/gluster/discovery.py -H $ARG1$ -c $HOSTNAME$
+ command_line sudo $USER1$/gluster/discovery.py -H $ARG1$ -c $HOSTNAME$ -m auto
}
define command{
diff --git a/config/gluster-host.cfg.template b/config/gluster-host.cfg.template
deleted file mode 100644
index 0b5173d..0000000
--- a/config/gluster-host.cfg.template
+++ /dev/null
@@ -1,34 +0,0 @@
-###@GENERATED@###
-# AUTO-GENERATED FILE. DO NOT MODIFY.
-#
-# This confinguration file was automatically generated by the
-# Gluster Auto Discovery tool. It should not be modified by hand.
-#
-
-{% if host['use'] == 'gluster-cluster' -%}
-define hostgroup{
-hostgroup_name {{host['host_name']}}
-alias {{host['alias']}}
-}
-{%- endif %}
-
-define host{
-use {{host['use']}}
-host_name {{host['host_name']}}
-alias {{host['alias']}}
-address {{host['address']}}
-{% if host['check_command'] is defined -%}
-check_command {{host['check_command']}}
-{% endif -%}
-{% if host['hostgroups'] is defined -%}
-hostgroups {{host['hostgroups']}}
-{% endif -%}
-}
-
-{% for service in host['host_services'] %}
-define service{
-{%- for key, value in service.iteritems() %}
-{{ key.ljust(20) }} {{ value }}
-{%- endfor %}
-}
-{% endfor %}