From 05278f31d54d89ef0a68e94af389d66a3c3b6f74 Mon Sep 17 00:00:00 2001 From: Ramesh Nachimuthu Date: Fri, 28 Mar 2014 17:48:54 +0530 Subject: AutoDiscovery: Auto discovery for gluster entities Basic plugin which will discover all the basic gluster entities and creates nagios configuration. Change-Id: I71f05dec9bcce74969db300393f7f7c178161dba Signed-off-by: Ramesh Nachimuthu Reviewed-on: https://code.engineering.redhat.com/gerrit/22100 Reviewed-by: Sahina Bose --- config/gluster-host.cfg.template | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 config/gluster-host.cfg.template (limited to 'config/gluster-host.cfg.template') diff --git a/config/gluster-host.cfg.template b/config/gluster-host.cfg.template new file mode 100644 index 0000000..bd1b2af --- /dev/null +++ b/config/gluster-host.cfg.template @@ -0,0 +1,34 @@ +###@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'] != "" -%} +check_command {{host['check_command']}} +{% endif -%} +{% if host['hostgroups'] != "" -%} +hostgroups {{host['hostgroups']}} +{% endif -%} +} + +{% for service in host['host_services'] %} +define service{ +{%- for key, value in service.iteritems() %} +{{ key.ljust(20) }} {{ value }} +{%- endfor %} +} +{% endfor %} -- cgit