Exported resources won't handle any resource de-duplication. You can get around this by simply not using that to collect data, dalen's puppetdb-query will help with this, and in PDB 4.0 we're introducing a function for this purpose also into core. Once you have the data, then you can do anything with it, using Puppet's latest iterator support this should become easier also, as you can reduce the results.
As you mention, the other option is to put your proxied/external address test, somewhere else, in one place - like on the nagios machine itself or something like that. Then its not a duplicate. Model wise, it probably doesn't belong on _all_ your nodes like you say, but then again it shouldn't belong to one of the cluster nodes either, later on if you remove that node it all stops working. Model wise, in an ideal world, the proxied/virtual address would be a 'node' of sorts, and have that entry, but if no box exists to compile that catalog, well then we're just talking crazy :-). Whatever you're solution, the problem will repeat itself if you have other virtual addresses, I'd make sure you're happy with whatever solution for multiple clusters, at least then you have continuity, people will know where to go to do look into problems etc. ken. On Thu, Mar 3, 2016 at 5:11 PM, Daniel Urist <dur...@ucar.edu> wrote: > I've created a module to configure a caching nginx proxy. I am running > several of these proxies behind a load balancer. They all proxy the same > external address. I'd like to export a nagios host/service for monitoring > the external address, which will then be collected on my nagios server. The > problem is, since I have several instances of the proxy managed by puppet, > and the exported host/service is identical on each, I end up with duplicate > resources. I could give the resources unique names (e.g. by appending the > proxy's hostname to the resource name), but then I end up with multiple > identical hosts/services in nagios, which doesn't work. > > The puppet stdlib module has an "ensure_resource" function, but there > doesn't seem to be a way to use this on an exported resource collector. > > I guess one workaround would be to set a parameter in the proxy module, for > example "export_address" and have that default to "false", and only set it > to "true" for one node, but that's kind of ugly since one node then needs to > be special. > > Surely this isn't an uncommon use case-- what's the best way to work around > this? > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/CAEo6%3DKbwrCYz3ovqo-E0u7EH-Jep%2BwrxEW3FhV1v8-G%3DRr%2B80w%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAE4bNTmjYc-MO4mnUmKGyv9cLSg0hpP%2BtwHOgyWSLqa-i1OpFA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.