FAQ
Hi @all,

I got stucked in the configuration of Nagios resources from Puppet. I've
wrote a some classes setting up a Nagios server, collect virtual resources
from the client and push them to the Nagios server. So far so good, it's
working. Now I try to group the hosts and services and the problems start.
I've created a basline class rolled out on all clients with entries like
this:

@@nagios_host { "${::fqdn}":
ensure => present,
alias => $::hostname,
address => $::ipaddress,
use => "linux-server",
hostgroups => ["baseline"]
}

@@nagios_service { "check-host-alive_${::hostname}":
check_command => "check-host-alive!100.0,20%!500.0,60%",
use => "generic-service",
host_name => $::fqdn,
notification_period => "24x7",
service_description => "${::hostname}_check-host-alive",
servicegroups => ["baseline"],
require => Nagios_host["$::fqdn"]
}

And a server class with entries like this:

Nagios_host <<||>> { notify => Service["nagios"] }
Nagios_hostextinfo <<||>> { notify => Service["nagios"] }
Nagios_hostgroup <<||>> { notify => Service["nagios"] }
Nagios_servicegroup <<||>> { notify => Service["nagios"] }
Nagios_service <<||>> { notify => Service["nagios"] }

But instead of creating a file with hostgroup baseline and a file with
servicegroup baseline I got the following error:

$ puppet agent --test
info: Retrieving plugin
info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Another local or imported resource exists with the type and title
Nagios_servicegroup[baseline] on node nagios2.domain.local
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
$

Anyone any idea how to fix this?

Regards, Thomas
--
Linux ... enjoy the ride!

--
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.

Search Discussions

  • Steven C at Sep 8, 2012 at 6:38 am
    Having a similar problem. So far I've tried clearing the nagios.cfg and
    dropping the puppet database from puppetmaster, but this has not helped.
    On Friday, September 7, 2012 6:27:54 AM UTC-6, thbe wrote:

    Hi @all,

    I got stucked in the configuration of Nagios resources from Puppet. I've
    wrote a some classes setting up a Nagios server, collect virtual resources
    from the client and push them to the Nagios server. So far so good, it's
    working. Now I try to group the hosts and services and the problems start.
    I've created a basline class rolled out on all clients with entries like
    this:

    @@nagios_host { "${::fqdn}":
    ensure => present,
    alias => $::hostname,
    address => $::ipaddress,
    use => "linux-server",
    hostgroups => ["baseline"]
    }

    @@nagios_service { "check-host-alive_${::hostname}":
    check_command => "check-host-alive!100.0,20%!500.0,60%",
    use => "generic-service",
    host_name => $::fqdn,
    notification_period => "24x7",
    service_description => "${::hostname}_check-host-alive",
    servicegroups => ["baseline"],
    require => Nagios_host["$::fqdn"]
    }

    And a server class with entries like this:

    Nagios_host <<||>> { notify => Service["nagios"] }
    Nagios_hostextinfo <<||>> { notify => Service["nagios"] }
    Nagios_hostgroup <<||>> { notify => Service["nagios"] }
    Nagios_servicegroup <<||>> { notify => Service["nagios"] }
    Nagios_service <<||>> { notify => Service["nagios"] }

    But instead of creating a file with hostgroup baseline and a file with
    servicegroup baseline I got the following error:

    $ puppet agent --test
    info: Retrieving plugin
    info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
    info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
    info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
    err: Could not retrieve catalog from remote server: Error 400 on SERVER:
    Another local or imported resource exists with the type and title
    Nagios_servicegroup[baseline] on node nagios2.domain.local
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run
    $

    Anyone any idea how to fix this?

    Regards, Thomas
    --
    Linux ... enjoy the ride!
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/A01lvndFRoYJ.
    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.
  • Thomas Bendler at Sep 8, 2012 at 11:09 am
    Hi Steven,

    2012/9/8 Steven C <stevenc@qualtrics.com>
    Having a similar problem. So far I've tried clearing the nagios.cfg and
    dropping the puppet database from puppetmaster, but this has not helped.
    [...]
    currently I've defined the groups manually as a template file in puppet but
    this is only a workaround. The goal is to automate this completely, so any
    hints how to solve this are welcome.

    Regards, Thomas
    --
    Linux ... enjoy the ride!

    --
    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.
  • Stevenc at Feb 26, 2013 at 8:46 pm
    Check your store config database for duplicate entries in the resources
    table.
    On Saturday, September 8, 2012 5:09:03 AM UTC-6, thbe wrote:

    Hi Steven,

    2012/9/8 Steven C <ste...@qualtrics.com <javascript:>>
    Having a similar problem. So far I've tried clearing the nagios.cfg and
    dropping the puppet database from puppetmaster, but this has not helped.
    [...]
    currently I've defined the groups manually as a template file in puppet
    but this is only a workaround. The goal is to automate this completely, so
    any hints how to solve this are welcome.

    Regards, Thomas
    --
    Linux ... enjoy the ride!
    --
    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+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 7, '12 at 12:27p
activeFeb 26, '13 at 8:46p
posts4
users2
websitepuppetlabs.com

2 users in discussion

Stevenc: 2 posts Thomas Bendler: 2 posts

People

Translate

site design / logo © 2022 Grokbase