Exporting resource to a particular host

20 views
Skip to first unread message

mohammad kashif

unread,
Feb 4, 2015, 6:41:50 AM2/4/15
to puppet-users
Hi

I am using  puppetdb and exported resource  to manage autmatic nagios setup. It works very well. Now I want to setup another nagios server for another set of machines using same puppetdb and puppet master.
As for I understand,  a client exports @@nagios_host and nagios server  collect it by Nagios_host <<|  |>>

I want some Nagios_host to be collected by different nagios server. Is it possible ? I was thinking about 'tag' but  am not sure how to use with exported resources.

Thanks
Kashif

 

Ken Barber

unread,
Feb 4, 2015, 6:49:48 AM2/4/15
to Puppet Users
It's pretty easy:

Nagios_host <<| tag == 'nagios1' |>>

See:

https://docs.puppetlabs.com/puppet/latest/reference/lang_collectors.html

ken.

jcbollinger

unread,
Feb 5, 2015, 10:06:51 AM2/5/15
to puppet...@googlegroups.com
Ken already gave a practical answer.  I want to add that the idea of "exporting to a particular host" his wrong thinking.  You cannot do that -- it is inherent in the nature of exported resources that each is available for import by any node.  What you can do, as Ken demonstrated, is associate data with your exported resources that allows collectors to be appropriately selective about which to collect.

More generally, it is valuable for maintenance and flexibility of your site configuration for your declarations to be descriptive rather than prescriptive.  That is, you should declare the characteristics of your resources (such as that they are members of certain groups) rather than their intended use (such as that they be collected by a specific Nagios server).  The use follows from the characteristics; it is not the primary consideration.


John

Reply all
Reply to author
Forward
0 new messages