On 09/22/2010 09:10 AM, Baker, Luke wrote:>
> I''ve been looking at this example in the puppetdocs.pdf
>
> class nagios-target {
>
> @@nagios_host { $fqdn:
>
> ensure => present,
>
> alias => $hostname,
>
> address => $ipaddress,
>
> use => "generic-host",
>
> }
>
> @@nagios_service { "check_ping_${hostname}":
>
> check_command => "check_ping!100.0,20%!500.0,60%",
>
> use => "generic-service",
>
> host_name => "$fqdn",
>
> notification_period => "24x7",
>
> service_description => "${hostname}_check_ping"
>
> }
>
> }
>
> class nagios-monitor {
>
> package { [ nagios, nagios-plugins ]: ensure => installed, }
>
> service { nagios:
>
> ensure => running,
>
> enable => true,
>
> #subscribe => File[$nagios_cfgdir],
>
> require => Package[nagios],
>
> }
>
> # collect resources and populate /etc/nagios/nagios_*.cfg
>
> Nagios_host <<||>>
>
> Nagios_service <<||>>
>
> How is /etc/nagios/nagios_*.cfg populated using these two exported
> resources?
>
That''s the syntax for collecting resources. This is the classic
example-
every node gets the exported resource (the one with @@ in front of it),
which means it is marked in the database as exported. Then on your
nagios server you use the collection syntax to collect all the exported
resources of that type. This means you can auto configure daemons like
nagios that require node information for the
configuration.>
> A more general question is that I''m confused on the purpose of
> exported resources.
>
>
The purpose is to distribute information between nodes. The second
example you gave is pretty useless, but another common scenario is a
command and control server that needs the proper host keys for your
nodes. In each node''s config you would export the ssh key and then
collect it on the C&C server, that way none of your scripts are failing
because of the wrong host keys.
--
Joe McDonagh
Operations Engineer
AIM: YoosingYoonickz
IRC: joe-mac on freenode
"When the going gets weird, the weird turn pro."
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.