On 10/2/13 9:09 AM, jcbollinger wrote:


On Tuesday, October 1, 2013 10:50:42 AM UTC-5, David Thompson wrote:


    I continue to be unable to get puppetdb to create nagios resources.



Nitpick: puppetdb does not create resources of any type, in any sense.
That leaves me uncertain whether you are saying that the exported
nagios_host resources you describe next fail to be recorded in the DB,
or whether you are saying that despite being recorded, they are not
subsequently collected.

Yes, it would be better to say that the generated nagios_host.cfg file contains far fewer entries than are indicated by the number of hosts containing the nagios_host resource shown below.


      I
    have a very standard nagios host definition:

            notify {"Nagios Base: $fqdn $hostname $ipaddress": }
            @@nagios_host { $fqdn:
              ensure => present,
              alias => $hostname,
              address => $ipaddress,
              use => "linux-server",
            }

    ...and the notify shows up on subsequent agent runs, so I know the
    statement is being activated.  I also know that the facts and catalogs
    are winding up in the postgres database.



Do you know whether the exported nagios_host resources in particular are
ending up in the DB?

If I turn on postgres statement logging, I can see e.g.:

LOG: execute S_2: INSERT INTO catalog_resources (catalog,resource,type,title,tags,exported,file,line) VALUES ($1,$2,$3,$4,$5,$6,$7,$8) DETAIL: parameters: $1 = 'b0ddc055494f58babc8f0085245517d3424e1e63', $2 = '5b5706ff5fe112b04f3722b5ce65d699c80a0e04', $3 = 'Nagios_host', $4 = 'c101.keck.waisman.wisc.edu', $5 = '{node,nagios_host,x86_64_sci6,class,nagios,c101.keck.waisman.wisc.edu}', $6 = 't', $7 = '/systypes/noarch/puppet/production/modules/nagios/manifests/init.pp', $8 = '125'


(...and then c101 shows up in neither the generated nagios config nor in the REST query...)



    Despite all this, both the nagios collector and the puppetdb rest API
    only show the Nagios_host resources generated on the nagios server
    itself.



Could you be more specific?  What are the forms of the collector and
query URIs you are using?

The puppet nagios collector:

    if $nagios_server {
      Nagios_host <<||>>
    }


The query I'm using:

curl -G 'http://localhost:8080/v3/resources' --data-urlencode 'query=["=", "type", "Nagios_host"]'

(I tried updating to the latest-and-greatest puppetdb yesteday. No change. I get the same from the v2 URI.)

Do you actually have PuppetDB configured as your storeconfigs back end?
Following the docs
(http://docs.puppetlabs.com/puppetdb/latest/connect_puppet_master.html),
you should have

|   storeconfigs = true
   storeconfigs_backend = puppetdb

in the [master] section of the master's puppet.conf,/and/  thin_storeconfigs  
andasync_storeconfigs  should be disabled (the default).

Yes, this is the configuration I have on all the hosts. In addition, I have the following routes.yaml on the puppet server/puppetdb server (1 host does both):

---
master:
  facts:
    terminus: puppetdb
    cache: yaml


--
David Thompson
Waisman Center Brain Imaging and Behavior Lab
1500 Highland Ave. Room T133
Madison, WI  53705-2280
(608) 265-6608
dthompson (at) waisman (dot) wisc (dot) edu

--
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+unsubscr...@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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to