Ticket #1160 (closed enhancement: fixed)

Opened 8 years ago

Last modified 8 years ago

Enhancement to NagiosGen plugin

Reported by: Owned by: desai
Priority: minor Milestone: Bcfg2 1.4.0 Release
Component: bcfg2-server Version: 1.0
Keywords: NagiosGen Cc:


it would be useful to add bundle support to the NagiosPlugin?, in the sense of using both groups and bundle to build the nagios host groups. We use bundle to handle service like ssh,http ... and we have matching monitoring probes in nagios. I'll comme up with a patch once I get it to work nicely.


NagiosGen.patch (1.4 KB) - added by 8 years ago.
patch file since the web stuff seems scrambled.

Change History

comment:1 Changed 8 years ago by

Patch to add bundle support: --- Downloads/bcfg2-1.3.5/src/lib/Bcfg2/Server/Plugins/ 2014-10-27 14:55:39.000000000 +0100 +++ NagiosGen?.py 2014-10-29 18:22:18.000000000 +0100 @@ -49,9 +49,9 @@

raise Bcfg2.Server.Plugin.PluginExecutionError?

host_groups = [grp for grp in metadata.groups

if os.path.isfile('%s/%s-group.cfg' % (, grp))]

  • host_groups.append([bundle for bundle in metadata.bundles
  • if os.path.isfile('%s/%s-bundle.cfg' % (, bundle))])

- + bundle_groups = [grp for grp in metadata.bundles + if os.path.isfile('%s/%s-bundle.cfg' % (, grp))] + host_groups = bundle_groups + host_groups

host_config = ['define host {',

self.line_fmt % ('host_name', metadata.hostname), self.line_fmt % ('alias', metadata.hostname),

@@ -87,7 +87,8 @@

def createserverconfig(self, entry, _):

"""Build monolithic server configuration file.""" host_configs = glob.glob(os.path.join(, '*-host.cfg'))

  • group_configs = glob.glob(os.path.join(, '*-group.cfg'))

+ group_configs = glob.glob(os.path.join(, '*-group.cfg')) + glob.glob(os.path.join(, '*-bundle.cfg')) +

host_data = [] group_data = [] for host in host_configs:

This allow you to create host groups based on both bcf2's group and bundle

Changed 8 years ago by

patch file since the web stuff seems scrambled.

comment:2 Changed 8 years ago by solj

  • Status changed from new to closed
  • Resolution set to fixed

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.