summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/NagiosGen.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/NagiosGen.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/NagiosGen.py b/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
index 045e46350..d3c38ef19 100644
--- a/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
+++ b/src/lib/Bcfg2/Server/Plugins/NagiosGen.py
@@ -45,7 +45,11 @@ class NagiosGen(Plugin, Generator):
raise PluginExecutionError("Failed to find IP address for %s" %
metadata.hostname)
host_groups = [grp for grp in metadata.groups
- if os.path.isfile('%s/%s-group.cfg' % (self.data, grp))]
+ if os.path.isfile('%s/%s-group.cfg' %
+ (self.data, grp))] + \
+ [bundle for bundle in metadata.bundles
+ if os.path.isfile('%s/%s-bundle.cfg' %
+ (self.data, bundle))]
host_config = ['define host {',
self.line_fmt % ('host_name', metadata.hostname),
self.line_fmt % ('alias', metadata.hostname),
@@ -81,7 +85,8 @@ class NagiosGen(Plugin, Generator):
def createserverconfig(self, entry, _):
"""Build monolithic server configuration file."""
host_configs = glob.glob(os.path.join(self.data, '*-host.cfg'))
- group_configs = glob.glob(os.path.join(self.data, '*-group.cfg'))
+ group_configs = glob.glob(os.path.join(self.data, '*-group.cfg')) + \
+ glob.glob(os.path.join(self.data, '*-bundle.cfg'))
host_data = []
group_data = []
for host in host_configs: