Mikael
Mikael

Reputation: 29

Puppet: Nagios_host + Puppetdb + Nagios = Cannot collect exported resources

we are currently trying to create a Vagrant+Puppet+Nagios configuration on an Ubuntu Precise 64-box. Things have worked fairly smoothly but we have apparently hit a roadblock trying to get Puppet to setup the Nagios configuration using 'Nagios_host'. Currently we have everything running on the same instance: PuppetDB, the Puppetmaster service and Nagios.

It seems puppet master is correctly hooked up to Puppetdb. Issuing "puppet agent --test" and looking in the Puppetdb logs shows facts where actually updated as suggested in this link: http://docs.puppetlabs.com/puppetdb/latest/connect_puppet_master.html (step 3). Also, looking in /etc/puppet/puppet.conf shows storeconfigs = true and backend = puppetdb.

Our next step is to collect and export resources to monitor in Nagios. We've tried to follow a few of the tutorials online such as Puppetlab's own guide on exported resources. They all take us down the same path though. Puppet shows a bunch of warnings and no Nagios configurations are generated:

"Warning: You cannot collect exported resources without storeconfigs being set; the collection will be ignored on line XX" "Warning: Not collecting exported resources without storeconfigs"

As far as we can understand these warnings suggest Puppet does not pick up the fact that we have configured Puppetdb which we think we have verified.

Some relevant parts of our manifests:

class companyname::puppetmaster {
    package { 'puppetmaster':
      ensure => 'installed',
    }
    service { 'puppetmaster':
      ensure => 'running'
    }
    class {
        'puppetdb':
        ssl_listen_address => "0.0.0.0",
        notify => Service['puppetmaster'],
    }

    class {
        'puppetdb::master::config':
    }
}

class companyname::monitoring_server {
  package { 'nagios3':
           ensure  => installed,
           alias   => 'nagios',
   }

   service {
      'nagios3':
         ensure  => running,
         enable => true,
         alias   => 'nagios',
         hasstatus       => true,
         hasrestart      => true,
         require => Package['nagios'],
   }
  Nagios_host <<||>>    # This line triggers the warning
}

}

What have we overlooked?

We tried a few other Vagrant boxes including one of Puppetlabs' CentOS boxes. Same result. Software versions: puppetmaster 3.5.1, puppet 3.5.1, puppetdb 1.6.3, hiera 1.3.2, facter 2.0.1, nagios3 3.3.1, nagios-plugins 1.4.16, Vagrant 1.5.1.

Thanks, Mikael

Upvotes: 0

Views: 1942

Answers (2)

Mikael
Mikael

Reputation: 29

I ended up moving storeconfigs=true and storeconfigs_backend=puppetdb to the [main] section in /etc/puppet/puppet.conf. That fixes the issue, but I have no idea why. I will try to spend some more time trying to find out why this is.

Upvotes: 2

rojs
rojs

Reputation: 648

Warning: You cannot collect exported resources without storeconfigs being set; the collection will be ignored on line XX" "Warning: Not collecting exported resources without storeconfigs"

Puppet is trying to tell you what is wrong. You don't have storeconfigs enabled.

On your puppet master, ensure the puppet.conf file has the following:

storeconfigs = true

In the [master] section.

Verify by running the following on your puppet master:

puppet config print | grep storeconfigs

Upvotes: 0

Related Questions