diff options
author | ndarshan <dnarayan@redhat.com> | 2014-06-02 14:40:14 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2014-06-03 22:16:38 -0700 |
commit | bd2def940d9bd241a71d6e5f4c5905555743781d (patch) | |
tree | 87946de8dae6b75d4ae6e656c2117efbbb5375f5 /plugins/discovery.py | |
parent | 86f3b5b718cd332bf0d5dfc5f5efdaa321815562 (diff) |
nagios-server-addons: Fix for dummy config file issue.
This patch replaces the configfile node1.cfg(gluster-host)
by temp_node1.cfg which is of type linux-server having
service PING. And this dummy config file is renamed to
temp_node1.cfg.sample during auto-discovery as it is not
needed after we configure actual hosts. Also this patch
sets the config variable allow_empty_hostgroup_assignment
to 1, which is needed for nagios to allow declaration of
empty host-group with services.
Change-Id: I03cc54975f5ff5857f8d82b66110e049e4195009
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1091236
Signed-off-by: ndarshan <dnarayan@redhat.com>
Reviewed-on: http://review.gluster.org/7952
Reviewed-by: Kanagaraj M <kmayilsa@redhat.com>
Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com>
Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins/discovery.py')
-rwxr-xr-x | plugins/discovery.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/discovery.py b/plugins/discovery.py index 18dc714..825d8d3 100755 --- a/plugins/discovery.py +++ b/plugins/discovery.py @@ -527,6 +527,19 @@ if __name__ == '__main__': args.nagiosServerIP, args.mode, args.timeout) print "Cluster configurations synced successfully from host %s" % \ (args.hostip) + # Rename the configuration file for dummy host from temp_node1.cfg + # to temp_node1.cfg.sample as this host is not needed after other + # hosts are configured through auto-discovery. + dummy_host_config_file = DEFAULT_AUTO_CONFIG_DIR \ + + '/default/temp_node1.cfg' + try: + if os.path.exists(dummy_host_config_file): + os.rename( + dummy_host_config_file, + dummy_host_config_file + '.sample' + ) + except Exception as e: + pass #If Nagios is running then try to restart. Otherwise don't do #anything. if server_utils.isNagiosRunning(): |