I also use some other stuff in my nagios.pp to get puppet facts into
mcollective.
file { "/usr/lib/nagios/.mcollective/etc/facts.yaml":
mode => "0644",
owner => "104",
group => "106",
loglevel => debug,
content => inline_template("<%= scope.to_hash.reject { |k,v| k.to_s =~
/(uptime_seconds|timestamp|free)/ }.to_yaml %>")
}
On Wed, Jun 20, 2012 at 4:30 PM, [email protected] <
[email protected]> wrote:
> With in the class I used something like this to get the facts into my
> nagios templates:
>
>
> define host($ip = $::fqdn, $short_alias = $::fqdn, $hostgroup =
> $::product_info, $product_domain = $::product_domain) {
> case $product_info {
> /OneProduct/: {
> $nagios_cfgdir = "/usr/local/nagios/etc/objects/OneProduct/hosts"
> @@file {
> "$nagios_cfgdir/${name}.cfg":
> ignore => ".svn",
> ensure => present,
> content => template( "nagios/OneProduct_host.cfg" ),
> mode => 644,
> owner => nagios,
> group => nagios,
> tag => 'nagios',
> notify => Service[nagios],
> }
> }
> /YetAnotherProduct/: {
> $nagios_cfgdir =
> "/usr/local/nagios/etc/objects/YetAnotherProduct/hosts"
> @@file {
> "$nagios_cfgdir/${name}.cfg":
> ignore => ".svn",
> ensure => present,
> content => template( "nagios/YetAnotherProduct_host.cfg" ),
> mode => 644,
> owner => nagios,
> group => nagios,
> tag => 'nagios',
> notify => Service[nagios],
> recurse => true,
> replace => true,
> }
>
>
> I hope this helps;)
>
> On Wed, Jun 20, 2012 at 1:57 PM, Jeff McCune <[email protected]> wrote:
>
>> On Wed, Jun 20, 2012 at 1:22 PM, Jakov Sosic <[email protected]> wrote:
>>
>>> > I'm puzzled as to why can't I just use $operatingsystemrelease, and
>>> what
>>> > do these two semicolons mean?
>>>
>>>
>>> Any ideas?! :) Anyone?!?!
>>
>>
>> http://docs.puppetlabs.com/guides/scope_and_puppet.html
>>
>> -Jeff
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/puppet-users?hl=en.
>>
>
>
>
> --
> David Garvey
>
--
David Garvey
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.