New Puppet report processors...

1,985 views
Skip to first unread message

James Turnbull

unread,
May 31, 2011, 11:09:51 AM5/31/11
to puppet-users, puppet-dev, Technical Stuff
Hi all

On my TODO list for about a year now has been a tutorial on how easy it
is to write Puppet report processors and how much more you can do with
them than just email/log/store Puppet report data. Rather than write a
whole tutorial I decided to create a whole series of examples of report
processors that should:

a) Provide some immediate solutions that you can deploy right now, and

b) Provide good examples of things you can do with report processing
that you can take, fork and modify.

All of them are released under the Apache 2.0 license.

In that spirit I've created ten new report processors:

1. Reports failed runs to an IRC channel -
https://github.com/jamtur01/puppet-irc

2. Reports failed runs and logs to PagerDuty -
https://github.com/jamtur01/puppet-pagerduty

3. Reports failed runs to Jabber/XMPP -
https://github.com/jamtur01/puppet-xmpp

4. Reports failed runs to Twitter -
https://github.com/jamtur01/puppet-twitter

5. Reports failed runs and logs to Campfire -
https://github.com/jamtur01/puppet-campfire

6. Reports failed runs to Twilio -
https://github.com/jamtur01/puppet-twilio

7. Reports failed runs to Boxcar -
https://github.com/jamtur01/puppet-boxcar

8. Reports failed runs to HipChat -
https://github.com/jamtur01/puppet-hipchat

9. Sends metrics to a Ganglia server via gmetric -
https://github.com/jamtur01/puppet-ganglia

10. Reports failed runs to Growl - https://github.com/jamtur01/puppet-growl

Comments, feedback, testing and ideas for other integrations all welcomed.

Regards

James

--
James Turnbull
Puppet Labs
1-503-734-8571

treydock

unread,
Jun 4, 2011, 3:06:13 AM6/4/11
to Puppet Users
These will be most useful!! Thank you.

How can I test that these are functioning? I have setup the XMPP as
well as modified that to send emails. However when I purposely cause
a puppet run to fail I do not receive either email or jabber message.

Thanks
- Trey

On May 31, 10:09 am, James Turnbull <ja...@puppetlabs.com> wrote:
> Hi all
>
> On my TODO list for about a year now has been a tutorial on how easy it
> is to write Puppet report processors and how much more you can do with
> them than just email/log/store Puppet report data.  Rather than write a
> whole tutorial I decided to create a whole series of examples of report
> processors that should:
>
> a) Provide some immediate solutions that you can deploy right now, and
>
> b) Provide good examples of things you can do with report processing
> that you can take, fork and modify.
>
> All of them are released under the Apache 2.0 license.
>
> In that spirit I've created ten new report processors:
>
> 1. Reports failed runs to an IRC channel -https://github.com/jamtur01/puppet-irc
>
> 2. Reports failed runs and logs to PagerDuty -https://github.com/jamtur01/puppet-pagerduty
>
> 3. Reports failed runs to Jabber/XMPP -https://github.com/jamtur01/puppet-xmpp
>
> 4. Reports failed runs to Twitter -https://github.com/jamtur01/puppet-twitter
>
> 5. Reports failed runs and logs to Campfire -https://github.com/jamtur01/puppet-campfire
>
> 6. Reports failed runs to Twilio -https://github.com/jamtur01/puppet-twilio
>
> 7. Reports failed runs to Boxcar -https://github.com/jamtur01/puppet-boxcar
>
> 8. Reports failed runs to HipChat -https://github.com/jamtur01/puppet-hipchat
>
> 9. Sends metrics to a Ganglia server via gmetric -https://github.com/jamtur01/puppet-ganglia
>
> 10. Reports failed runs to Growl -https://github.com/jamtur01/puppet-growl

James Turnbull

unread,
Jun 5, 2011, 1:02:02 PM6/5/11
to puppet...@googlegroups.com
treydock wrote:
> These will be most useful!! Thank you.
>
> How can I test that these are functioning? I have setup the XMPP as
> well as modified that to send emails. However when I purposely cause
> a puppet run to fail I do not receive either email or jabber message.

Is the report processor xmpp.rb pluginsync'ed on your Puppet master?

Is there any log out on the Puppet master when you run in --debug mode?

Regards

James Turnbull

treydock

unread,
Jun 7, 2011, 12:00:47 AM6/7/11
to Puppet Users
The report processor was synced to /var/lib/puppet/lib/reports/ . I
enabled puppetmaster to run in debug mode but haven't seen anything
mentioning reports when I run test runs. I purposly misspelled a
module for the puppetmaster and run puppetd --test, but no reports
except those in puppet-dashboard. I could be looking in the wrong
place. Here's the debug output of the failed puppet run...(hostname
replaced)

$ puppetd --test --debug -vvv
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/
dscl does not exist
debug: Failed to load library 'ldap' for feature 'ldap'
debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
debug: Puppet::Type::User::ProviderUser_role_add: file rolemod does
not exist
debug: Puppet::Type::User::ProviderPw: file pw does not exist
debug: Puppet::Type::File::ProviderMicrosoft_windows: feature
microsoft_windows is missing
debug: /File[/var/log/puppet/http.log]: Autorequiring File[/var/log/
puppet]
debug: /File[/var/lib/puppet/ssl/public_keys/puppetmaster.domain.pem]:
Autorequiring File[/var/lib/puppet/ssl/public_keys]
debug: /File[/var/lib/puppet/ssl/private_keys/
puppetmaster.domain.pem]: Autorequiring File[/var/lib/puppet/ssl/
private_keys]
debug: /File[/etc/puppet/puppet.conf]: Autorequiring File[/etc/puppet]
debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/
var/lib/puppet/state]
debug: /File[/var/lib/puppet/state/last_run_summary.yaml]:
Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/run/puppet/agent.pid]: Autorequiring File[/var/run/
puppet]
debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/
lib/puppet/ssl]
debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/
puppet]
debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/certs/puppetmaster.domain.pem]:
Autorequiring File[/var/lib/puppet/ssl/certs]
debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/
var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/
puppet]
debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring File[/
var/lib/puppet/ssl/certs]
debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/
puppet/ssl]
debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/
lib/puppet]
debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/
puppet/ssl]
debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/
lib/puppet/state]
debug: /File[/etc/puppet/namespaceauth.conf]: Autorequiring File[/etc/
puppet]
debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring File[/var/lib/
puppet/ssl]
debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/classes.txt]: Autorequiring File[/var/lib/
puppet]
debug: /File[/var/lib/puppet/state/last_run_report.yaml]:
Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/
puppet]
debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/
puppet]
debug: Finishing transaction 23786215705400
debug: /File[/etc/puppet/namespaceauth.conf]: Autorequiring File[/etc/
puppet]
debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring File[/
var/lib/puppet/ssl/certs]
debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring File[/var/lib/
puppet/ssl]
debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/
var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/
puppet]
debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring
File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/public_keys/puppetmaster.domain.pem]:
Autorequiring File[/var/lib/puppet/ssl/public_keys]
debug: /File[/var/log/puppet/http.log]: Autorequiring File[/var/log/
puppet]
debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/
puppet/ssl]
debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/
puppet]
debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/
lib/puppet/ssl]
debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/
puppet/ssl]
debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/private_keys/
puppetmaster.domain.pem]: Autorequiring File[/var/lib/puppet/ssl/
private_keys]
debug: /File[/var/lib/puppet/ssl/certs/puppetmaster.domain.pem]:
Autorequiring File[/var/lib/puppet/ssl/certs]
debug: Finishing transaction 23786215706160
debug: Using cached certificate for ca
debug: Using cached certificate for puppetmaster.domain
notice: Ignoring --listen on onetime run
debug: Finishing transaction 23786215181380
debug: Loaded state in 0.00 seconds
info: Retrieving plugin
debug: Using cached certificate for ca
debug: Using cached certificate for puppetmaster.domain
debug: Using cached certificate_revocation_list for ca
debug: file_metadata supports formats: b64_zlib_yaml marshal pson raw
yaml; using pson
debug: Finishing transaction 23786215024480
info: Loading facts in mysql
info: Loading facts in mysql
info: Loading facts in mysql
info: Loading facts in mysql
debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw
yaml; using pson
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find class backuppc::clien at /etc/puppet/manifests/
nodes.pp:14 on node puppetmaster.domain
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
debug: Using cached certificate for ca
debug: Using cached certificate for puppetmaster.domain
debug: Using cached certificate_revocation_list for ca
debug: Value of 'preferred_serialization_format' (pson) is invalid for
report, using default (b64_zlib_yaml)
debug: report supports formats: b64_zlib_yaml marshal raw yaml; using
b64_zlib_yaml


Thanks
- Trey

James Turnbull

unread,
Jun 7, 2011, 12:12:11 AM6/7/11
to puppet...@googlegroups.com
treydock wrote:
> The report processor was synced to /var/lib/puppet/lib/reports/ . I
> enabled puppetmaster to run in debug mode but haven't seen anything
> mentioning reports when I run test runs. I purposly misspelled a
> module for the puppetmaster and run puppetd --test, but no reports
> except those in puppet-dashboard. I could be looking in the wrong
> place. Here's the debug output of the failed puppet run...(hostname
> replaced)
>

Can I get the master log please. That's where the report is triggered.

Regards

James

treydock

unread,
Jun 7, 2011, 3:29:19 AM6/7/11
to Puppet Users
This is the output from master.log during the failed puppet run.

[2011-06-07 02:24:16] DEBUG accept: 10.1.0.1:39742
[2011-06-07 02:24:16] DEBUG Puppet::Network::HTTP::WEBrickREST is
invoked.
[2011-06-07 02:24:16] puppetmaster.domain - - [07/Jun/2011:02:24:16
CDT] "GET /production/file_metadatas/plugins?ignore=---+%0A++-+.svn%0A+
+-+CVS%0A++-+.git&recurse=true&links=manage&checksum_type=md5& HTTP/
1.1" 200 6336
[2011-06-07 02:24:16] - -> /production/file_metadatas/plugins?
ignore=---+%0A++-+.svn%0A++-+CVS%0A++-
+.git&recurse=true&links=manage&checksum_type=md5&
[2011-06-07 02:24:16] DEBUG close: 10.1.0.1:39742
[2011-06-07 02:24:18] DEBUG accept: 10.1.0.1:39743
[2011-06-07 02:24:18] DEBUG Puppet::Network::HTTP::WEBrickREST is
invoked.
[2011-06-07 02:24:19] puppetmaster.domain - - [07/Jun/2011:02:24:18
CDT] "GET /production/catalog/puppetmaster.domain?facts=eNp9VdmSqkoWfe
%252BvyK6n7vCogMwRN6JxHkDBAYeXihRSRUYzQcCvv4lYdari
%250AVF9HSDL3tNZeu9lsgn
%252Fj7Fi24%252BMVOalqZkmCUlWdxy5S1SF0UvIvAFCReBim
%250AXhypgGNYtsmITUYCDKcKvMrKLYVjWUkATUZQGYbuj2CIVOClxIFR6qUXdEpb
%250AKQyzFnIz%252BvgOgwwRFdBLABIcO4iQGDtxFqUqeGPfnus
%252BwhEKVKB7UVY8Vzzy
%250AfvdwmkG6%252BpbiDNUbCcIeDKIsPCKsAtvIIUZNQQS8CzocYCEQWcDzQGYB02ke
%250AFSC4gOWBKwDpCDgF8DKQpKehT%252BP3sLLxXIsTVCUenUlJUhRiFCBIaG5vQkus
%250A3WeRd8uQ56rA4WRG7DjiczlCaR5j%252Fx2lF0YFLCe3WIWnX7kl8vW5JPVC9E6Q
%250AE0cuLcYbx7EM33llX2FCvBS5Hs2pnRHcDrxj%252B4lUtfz
%252BvGJb8nPzBWK3ijik
%250AoNHwC1l8fzlxAg9F6R1hUmPXEl9HaHghJD5dEoTWx5dVuBqSC
%252FXtwOAPaJg6%250AuJB6wnTLgxaCpxkJMjC6X82%252Bsv7JNslhcsKInmRbIgdG9Tkvga6Lqa
%252FvpVKU
%250A59PTzY3%252BgU6%252F3QZx7ZSp3nUq1GJCQBOd6shLcgveUeGRlHwjUYXFI45oWL3%252B
%250A%252Bgv%252FPgGvSsfKzSoyFAjfyu4R%252BK3obhxCjwb8LcS0TKiVBQ0efzH
%252FDRm2hqai%250AEo7jtA4YRtmJdmGGK3K%252F1ez
%252BBSaR03phAZ1X6V5FZxiV6amcUn14WX1x%252B8W2%250AS5zhKnGR5b9C
%252BQKkw7YY5QNKgoKq8%252BjmEwzIq0wvMy4sn4wVfoqB%252FSMGma0t
%250Akgsm0EelCjT66nbmD9hjS4cbPG8nOf21Blo5ny%252BQvFPc
%252FY3IOhtvT9m6tHQ5%250AcDeJdWbW%252FN3JudVksZqPH3mjXLYZh
%252BQLKd800rHS4Rt4nen2cWDYjaFdrg4T%250AgsTJYGkPDyifFmd
%252FZzRM5POZNszFef%252B0XKYY3x%252BHEnLlAOmn4rbJtKMcaooS
%250Ac7thlI2Lobidi65ly718uTIW7RAiU0FLRXRZbYih1XY1jgvv%252BDrYnJS2oXfF
%250AI9coup0ikJnZ7BY%252FJoouju8X1%252BNng5nDjnU
%252F7zHecrk5bxvEO96JFWVS3uVG
%250ApdXzhgIcMqXPKZPOoXAUzxdjrYHujt3xoTR2873PGnvLs7ultDqa%252Fb45XUSl
%250AmYQz
%252BwiPcteY5atFhuDU0lYbY9KLpdgZKQvrr7%252BeGKCIqlwchajqZ9rfbuZU
%250Asv5FLByE039stnpekDIE7xUZCH2YqGCdITDNIlCPBa4aC9U8YJjnwPjUtE%252FC
%250AU%252B1qCV84VTUuqHj1fShQQk%252BiFAX%252FWf4X7FAcVf89cwN
%252Bv3SBZxkA%252FkdbqNMZ
%250AjR8f56vM6jlUNw2wa3kHZgDTU4zDeuNz3v0gkB71imnnVXPqreqsXxW1fwXx
%250AL6q%252FLx2E2LlQMX525zcFuMQk
%252FWEG1mJGuxnhL3UQWspPo4YqEUVjsarDhOmF%250AzoEjlZU2ef5WI
%252BHzolr6oiohvH7af%252BM%252BBtXHRKpEkuWkLyJZaXKt5mxLkT40%250A
%252BXdX%252Fz9R%252BVTtH6bcS7p%252Fb%252Fnq9lMP3D
%252F1wHc6Br3rdTXDeuCztiX9%252FtxaH6Tw%250AshP6hm0HQ32T9e5Tc9tXdtO7I
%252BfBNCHrxkOKokeA5cP%252BrC3jvrk%252BaWhzRgfM
%250A6numHR2ZwDf1mcnY3KHnN5h
%252BxIx2Xd5kr4tp5zobyl2YzGMOrYceF44aUb47%250AQykNikOxyw
%252FCWRtMCvsyE4qZVVLRGq8kpW3dLX%252B2FMuOUsU
%252FtPojf2d2%252BTl7%250A2pXr
%252FsMOLP52RSMpYVaVtk20kdW4ygiWQzwupe6JK9G4XaxLqAyvRNJ7qCiu%250AYr
%252FtbPSpYKz2rO1cpJ3FXZyekY%252BHWDqT0VyJ7MlIEc2k0btfTHgTvMU
%252BFMb6%250AIdns3dHkEJBcmKbl48iJWec0vuq6gW5Haz
%252Fjb9aRa9uasM1M05r6k6RrMUwy
%250AXzQaJukSg5sV0Ml1z2ynRy2oEpoMND84zfcMlzxmgWCnhj9v77dizoo2KaKd
%250A5k7jK78s8djTFpf5YTUNokUv1S6DIDkd522l0d9aS4aFo51BDuZwnT36Mo70%250Aadze6pNwhKc7MxaWEXtOznrg4%252Bstv4xGflzcZGcQnZLHtEPkxaqUtpO47UTD
%250Asz%252FenVDOG8O%252B620H2x7U0NSl%252FC%252BHcGz89Tdq1Ul%252B
%250A&facts_format=b64_zlib_yaml HTTP/1.1" 400 104
[2011-06-07 02:24:19] - -> /production/catalog/puppetmaster.domain?
facts=eNp9VdmSqkoWfe%252BvyK6n7vCogMwRN6JxHkDBAYeXihRSRUYzQcCvv4lYdari
%250AVF9HSDL3tNZeu9lsgn
%252Fj7Fi24%252BMVOalqZkmCUlWdxy5S1SF0UvIvAFCReBim
%250AXhypgGNYtsmITUYCDKcKvMrKLYVjWUkATUZQGYbuj2CIVOClxIFR6qUXdEpb
%250AKQyzFnIz%252BvgOgwwRFdBLABIcO4iQGDtxFqUqeGPfnus
%252BwhEKVKB7UVY8Vzzy
%250AfvdwmkG6%252BpbiDNUbCcIeDKIsPCKsAtvIIUZNQQS8CzocYCEQWcDzQGYB02ke
%250AFSC4gOWBKwDpCDgF8DKQpKehT%252BP3sLLxXIsTVCUenUlJUhRiFCBIaG5vQkus
%250A3WeRd8uQ56rA4WRG7DjiczlCaR5j%252Fx2lF0YFLCe3WIWnX7kl8vW5JPVC9E6Q
%250AE0cuLcYbx7EM33llX2FCvBS5Hs2pnRHcDrxj%252B4lUtfz
%252BvGJb8nPzBWK3ijik
%250AoNHwC1l8fzlxAg9F6R1hUmPXEl9HaHghJD5dEoTWx5dVuBqSC
%252FXtwOAPaJg6%250AuJB6wnTLgxaCpxkJMjC6X82%252Bsv7JNslhcsKInmRbIgdG9Tkvga6Lqa
%252FvpVKU
%250A59PTzY3%252BgU6%252F3QZx7ZSp3nUq1GJCQBOd6shLcgveUeGRlHwjUYXFI45oWL3%252B
%250A%252Bgv%252FPgGvSsfKzSoyFAjfyu4R%252BK3obhxCjwb8LcS0TKiVBQ0efzH
%252FDRm2hqai%250AEo7jtA4YRtmJdmGGK3K%252F1ez
%252BBSaR03phAZ1X6V5FZxiV6amcUn14WX1x%252B8W2%250AS5zhKnGR5b9C
%252BQKkw7YY5QNKgoKq8%252BjmEwzIq0wvMy4sn4wVfoqB%252FSMGma0t
%250Akgsm0EelCjT66nbmD9hjS4cbPG8nOf21Blo5ny%252BQvFPc
%252FY3IOhtvT9m6tHQ5%250AcDeJdWbW%252FN3JudVksZqPH3mjXLYZh
%252BQLKd800rHS4Rt4nen2cWDYjaFdrg4T%250AgsTJYGkPDyifFmd
%252FZzRM5POZNszFef%252B0XKYY3x%252BHEnLlAOmn4rbJtKMcaooS
%250Ac7thlI2Lobidi65ly718uTIW7RAiU0FLRXRZbYih1XY1jgvv%252BDrYnJS2oXfF
%250AI9coup0ikJnZ7BY%252FJoouju8X1%252BNng5nDjnU
%252F7zHecrk5bxvEO96JFWVS3uVG
%250ApdXzhgIcMqXPKZPOoXAUzxdjrYHujt3xoTR2873PGnvLs7ultDqa%252Fb45XUSl
%250AmYQz
%252BwiPcteY5atFhuDU0lYbY9KLpdgZKQvrr7%252BeGKCIqlwchajqZ9rfbuZU
%250Asv5FLByE039stnpekDIE7xUZCH2YqGCdITDNIlCPBa4aC9U8YJjnwPjUtE%252FC
%250AU%252B1qCV84VTUuqHj1fShQQk%252BiFAX%252FWf4X7FAcVf89cwN
%252Bv3SBZxkA%252FkdbqNMZ
%250AjR8f56vM6jlUNw2wa3kHZgDTU4zDeuNz3v0gkB71imnnVXPqreqsXxW1fwXx
%250AL6q%252FLx2E2LlQMX525zcFuMQk
%252FWEG1mJGuxnhL3UQWspPo4YqEUVjsarDhOmF%250AzoEjlZU2ef5WI
%252BHzolr6oiohvH7af%252BM%252BBtXHRKpEkuWkLyJZaXKt5mxLkT40%250A
%252BXdX%252Fz9R%252BVTtH6bcS7p%252Fb%252Fnq9lMP3D
%252F1wHc6Br3rdTXDeuCztiX9%252FtxaH6Tw%250AshP6hm0HQ32T9e5Tc9tXdtO7I
%252BfBNCHrxkOKokeA5cP%252BrC3jvrk%252BaWhzRgfM
%250A6numHR2ZwDf1mcnY3KHnN5h
%252BxIx2Xd5kr4tp5zobyl2YzGMOrYceF44aUb47%250AQykNikOxyw
%252FCWRtMCvsyE4qZVVLRGq8kpW3dLX%252B2FMuOUsU
%252FtPojf2d2%252BTl7%250A2pXr
%252FsMOLP52RSMpYVaVtk20kdW4ygiWQzwupe6JK9G4XaxLqAyvRNJ7qCiu%250AYr
%252FtbPSpYKz2rO1cpJ3FXZyekY%252BHWDqT0VyJ7MlIEc2k0btfTHgTvMU
%252BFMb6%250AIdns3dHkEJBcmKbl48iJWec0vuq6gW5Haz
%252Fjb9aRa9uasM1M05r6k6RrMUwy
%250AXzQaJukSg5sV0Ml1z2ynRy2oEpoMND84zfcMlzxmgWCnhj9v77dizoo2KaKd
%250A5k7jK78s8djTFpf5YTUNokUv1S6DIDkd522l0d9aS4aFo51BDuZwnT36Mo70%250Aadze6pNwhKc7MxaWEXtOznrg4%252Bstv4xGflzcZGcQnZLHtEPkxaqUtpO47UTD
%250Asz%252FenVDOG8O%252B620H2x7U0NSl%252FC%252BHcGz89Tdq1Ul%252B
%250A&facts_format=b64_zlib_yaml
[2011-06-07 02:24:19] DEBUG close: 10.1.0.1:39742


Thanks
- Trey

James Turnbull

unread,
Jun 7, 2011, 10:29:04 AM6/7/11
to puppet...@googlegroups.com
treydock wrote:
> This is the output from master.log during the failed puppet run.

Sorry I meant the output from the master daemon puppetmasterd or puppet
master.

Thanks

James

treydock

unread,
Jun 7, 2011, 2:52:36 PM6/7/11
to Puppet Users
Excuse the dumb question, but what file is the default location or
what configuration variable defines that location?

I've noticed the bulk of puppetmaster logs go either in /var/log/
puppet/masterhttp.log (previous message) or /var/log/message (syslog
I'm assuming). Or is there a different place I should be looking?

Thanks
- Trey

James Turnbull

unread,
Jun 7, 2011, 4:42:15 PM6/7/11
to puppet...@googlegroups.com
treydock wrote:
> Excuse the dumb question, but what file is the default location or
> what configuration variable defines that location?
>
> I've noticed the bulk of puppetmaster logs go either in /var/log/
> puppet/masterhttp.log (previous message) or /var/log/message (syslog
> I'm assuming). Or is there a different place I should be looking?

On the Puppet master it defaults to syslog - so it'll end up in
/var/log/messages.

Regards

treydock

unread,
Jun 7, 2011, 7:43:19 PM6/7/11
to Puppet Users
Ok I restarted puppetmaster daemon and then broke a module to create a
failed puppet run on the same host as the master...and here's /var/log/
messages from that

Jun 7 18:37:19 puppetmaster puppet-master[27426]: Reopening log files
Jun 7 18:37:19 puppetmaster puppet-master[27426]: Starting Puppet
master version 2.6.8
Jun 7 18:37:19 puppetmaster puppet-master[27426]: (mount[files])
allowing * access
Jun 7 18:37:19 puppetmaster puppet-master[27426]: (mount[modules])
allowing * access
Jun 7 18:37:19 puppetmaster puppet-master[27426]: (mount[plugins])
allowing * access
Jun 7 18:37:32 puppetmaster puppet-agent[27636]: Ignoring --listen on
onetime run
Jun 7 18:37:32 puppetmaster puppet-agent[27636]: Retrieving plugin
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[^/catalog/
([^/]+)$]) allowing 'method' find
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[^/catalog/
([^/]+)$]) allowing $1 access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate_revocation_list/ca]) allowing 'method' find
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate_revocation_list/ca]) allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/report])
allowing 'method' save
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/report])
allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/file])
allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate/ca]) adding authentication no
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate/ca]) allowing 'method' find
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate/ca]) allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate/]) adding authentication no
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate/]) allowing 'method' find
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate/]) allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate_request]) adding authentication no
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate_request]) allowing 'method' find
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate_request]) allowing 'method' save
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
certificate_request]) allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/facts])
adding authentication yes
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/facts])
allowing 'method' find
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/facts])
allowing 'method' search
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/facts])
allowing 'method' save
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/facts])
allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
inventory]) allowing 'method' search
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (access[/
inventory]) allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: Inserting default '/
status'(auth) ACL because none were found in '/etc/puppet/auth.conf'
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (mount[files])
allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (mount[modules])
allowing * access
Jun 7 18:37:33 puppetmaster puppet-master[27426]: (mount[plugins])
allowing * access
Jun 7 18:37:33 puppetmaster puppet-agent[27636]: Loading facts in
mysql
Jun 7 18:37:33 puppetmaster puppet-agent[27636]: Loading facts in
mysql
Jun 7 18:37:33 puppetmaster puppet-agent[27636]: Loading facts in
mysql
Jun 7 18:37:33 puppetmaster puppet-agent[27636]: Loading facts in
mysql
Jun 7 18:37:36 puppetmaster puppet-master[27426]: Expiring the node
cache of puppetmaster.tamu.edu
Jun 7 18:37:36 puppetmaster puppet-master[27426]: Not using expired
node for puppetmaster.tamu.edu from cache; expired at Tue Jun 07
18:36:36 -0500 2011
Jun 7 18:37:36 puppetmaster puppet-master[27426]: Caching node for
puppetmaster.tamu.edu
Jun 7 18:37:39 puppetmaster puppet-master[27426]: Could not find
class backuppc::clien for puppetmaster.tamu.edu
Jun 7 18:37:39 puppetmaster puppet-master[27426]: Could not find
class backuppc::clien at /etc/puppet/manifests/nodes.pp:14 on node
puppetmaster.tamu.edu
Jun 7 18:37:39 puppetmaster puppet-master[27426]: Could not find
class backuppc::clien at /etc/puppet/manifests/nodes.pp:14 on node
puppetmaster.tamu.edu
Jun 7 18:37:39 puppetmaster puppet-agent[27636]: Could not retrieve
catalog from remote server: Error 400 on SERVER: Could not find class
backuppc::clien at /etc/puppet/manifests/nodes.pp:14 on node
puppetmaster.tamu.edu
Jun 7 18:37:39 puppetmaster puppet-agent[27636]: Not using cache on
failed catalog
Jun 7 18:37:39 puppetmaster puppet-agent[27636]: Could not retrieve
catalog; skipping run



Also that doesn't seem like much debug output...incase I'm doing this
incorrectly here is my "/etc/sysconfig/puppetmaster"

PUPPETMASTER_EXTRA_OPTS="--reports puppet_dashboard --debug"


Also I induced a failed puppet run on a remote client and noticed that
it failed to import the xmpp report plugins because the xmpp.yaml file
wasn't readable. I fixed by copying the server's copy to the
client's /etc/puppet directory. Does that file have to be pushed to
all clients? Could that file configuration be sent to all clients
from the puppet-xmpp module or should I create another module for
that , something like "plugins" ?

Thanks!
- Trey

James Turnbull

unread,
Jun 7, 2011, 8:32:21 PM6/7/11
to puppet...@googlegroups.com
treydock wrote:
> Ok I restarted puppetmaster daemon and then broke a module to create a
> failed puppet run on the same host as the master...and here's /var/log/
> messages from that

Can I confirm you have:

[master]
report = true
reports = xmpp

[agent]
report = true

In your puppet.conf on the master and the [agent] block on the client?

You mentioned an issue with the xmpp.yaml file? That should have you
Jabber jid, password, target etc and be located in /etc/puppet on the
master - not sync'ed with the module.

Regards

James Turnbull

treydock

unread,
Jun 7, 2011, 8:54:49 PM6/7/11
to Puppet Users
My [master] has :

report = true
reports = http, store, xmpp
pluginsync = true

The [agent] includes:
report = true
listen = true
pluginsync = true


The second agent I tested with also has the same configuration as the
above [agent]

Correct, the xmpp.yaml has all that information. What I was asking
about the remote client not having mail.yaml is I enabled pluginsync
on the remove client to see if the results would differ and it failed
stating the mail.yaml was missing (locally on the client). But if the
repots = xmpp is only defined for [master] then should I not include
"pluginsync = true" on the clients?


Thanks
- Trey

James Turnbull

unread,
Jun 8, 2011, 11:57:46 AM6/8/11
to puppet...@googlegroups.com
treydock wrote:
> My [master] has :
>
> report = true
> reports = http, store, xmpp
> pluginsync = true
>
> The [agent] includes:
> report = true
> listen = true
> pluginsync = true
>
>
> The second agent I tested with also has the same configuration as the
> above [agent]
>
> Correct, the xmpp.yaml has all that information. What I was asking
> about the remote client not having mail.yaml is I enabled pluginsync
> on the remove client to see if the results would differ and it failed
> stating the mail.yaml was missing (locally on the client). But if the
> repots = xmpp is only defined for [master] then should I not include
> "pluginsync = true" on the clients?
>
>

So you don't have anything like the line:

"Sending status for name.of.host to XMMP user jabber.user"

in your Puppet master syslog.

Regards

James

Craig

unread,
Jun 8, 2011, 1:13:06 PM6/8/11
to Puppet Users
Hi,

These sample reports have been very useful, thanks!

Is there is a way to only send a report once every 24 hours (say)?
For example, I want to know about failed runs, but not every time
someone is hacking around, changing something, re-running etc.

I can think of all sorts of workarounds, just wondering if there's
something built in to help here.

Thanks

Craig.

James Turnbull

unread,
Jun 8, 2011, 1:20:39 PM6/8/11
to puppet...@googlegroups.com

There isn't currently - all of the report processors that trigger on
failed runs trigger on all failed runs.

I would suggest as an aside/workaround that you turn off
notification-style reporting in your test environment (where I presume
people are doing this "hacking around" :) ). My assumption is
production Puppet runs that fail are important but you might not care
about dev/test so much.

treydock

unread,
Jun 8, 2011, 2:06:15 PM6/8/11
to Puppet Users
I don't have any lines like that no.

Could the daemon line for puppetmaster be effecting this? Is the "--
reports" option necessary since my puppet.conf has that specified?

PUPPETMASTER_EXTRA_OPTS="--reports puppet_dashboard --debug"

Other than that and my puppet.conf I haven't found any further
configurations I've implemented effecting use of reports

Thanks
- Trey

Ohad Levy

unread,
Jun 8, 2011, 4:18:43 PM6/8/11
to puppet...@googlegroups.com

Foreman got a summary report support, where you can see / email an overview over time (eg last 24 hours), and can even filter out results (dont shoe dev hosts).

Ohad
> Thanks
>
> Craig.
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>

James Turnbull

unread,
Jun 8, 2011, 4:43:30 PM6/8/11
to puppet...@googlegroups.com
treydock wrote:
> I don't have any lines like that no.
>
> Could the daemon line for puppetmaster be effecting this? Is the "--
> reports" option necessary since my puppet.conf has that specified?
>
> PUPPETMASTER_EXTRA_OPTS="--reports puppet_dashboard --debug"
>
> Other than that and my puppet.conf I haven't found any further
> configurations I've implemented effecting use of reports

Specifying --reports on the command line in PUPPETMASTER_EXTRA_OPTS I am
pretty sure will override the puppet.conf configuration rather than add
to it. I'd take it out of there and put it into puppet.conf on the master.

Regards

James Turnbull

treydock

unread,
Jun 8, 2011, 6:01:37 PM6/8/11
to Puppet Users
That did it! I'm now getting messages over Jabber upon failure!!

Is the debug output you refered to earlier, "Sending status for
name.of.host to XMMP user jabber.user" something I would see from
Puppet or the Jabber server? I have yet to see similar output, but
the IM is now working.

Also now that I have this working I tried switching the settings in
xmpp.yaml, but am still getting messages on the account from old
settings. Is there a cache or location I need to clear for puppet to
use the new xmpp.yaml settings?

Thanks
- Trey

treydock

unread,
Jun 8, 2011, 6:03:08 PM6/8/11
to Puppet Users
Scratch my last question, had to restart puppetmaster.

Thanks again for your help and these plugins

- Trey

Don

unread,
Jun 8, 2011, 7:27:37 PM6/8/11
to puppet...@googlegroups.com
(possible double-post)

James,

This is all wonderfully helpful and I just spent a little while
writing up a Zenoss processor to send an event on failure using
XMLRPC::Client, modeled directly after your puppet-zendesk module,
replacing the HTTParty guts with XMLRPC guts. I've encountered a
problem though (and we can refer to puppet-zendesk code):

When I stuff a fail() into a manifest and run, it fails, sends a
report to the PM, and the PM logs this:

Report zenoss failed: undefined method `status' for
#<Puppet::Transaction::Report:0x2b626b5ad7c0>

The line in question is from zendesk.rb:25

if self.status == 'failed'
...
end

So, it's breaking there, but when I replace self.status with "var" and
var = 'failed', bypassing the if, the rest of the code works and the
event appears in zenoss.

I'm running 2.6.4 on the master & client. pluginsync is true on both,
and reports = zenoss only on the master for this test.

Why is self.status not working in this case?

Don Johnson

unread,
Jun 8, 2011, 7:22:06 PM6/8/11
to Puppet Users
James,

This is all wonderfully helpful and I just spent a little time writing
up a Zenoss processor to send an event on failure using
XMLRPC::Client, modeled directly after your puppet-zendesk module,
replacing the HTTParty guts with XMLRPC guts. I've encountered a
problem though (and we can refer to puppet-zendesk code):

When I stuff a fail() into a manifest and run, it fails, sends a
report to the PM, and the PM logs this:

Report zenoss failed: undefined method `status' for
#<Puppet::Transaction::Report:0x2b626b5ad7c0>

The line in question is from zendesk.rb:25

if self.status == 'failed'
...
end

So, it's breaking there, but when I replace self.status with "var" and
var = 'failed', bypassing the if, the rest of the code works and the
event appears in zenoss.

I'm running 2.6.4 on the master & client. pluginsync is true on both,
and reports = zenoss only on the master for this test.

Why is self.status not working for me?

On May 31, 8:09 am, James Turnbull <ja...@puppetlabs.com> wrote:
> Hi all
>
> On my TODO list for about a year now has been a tutorial on how easy it
> is to write Puppet report processors and how much more you can do with
> them than just email/log/store Puppet report data. Rather than write a
> whole tutorial I decided to create a whole series of examples of report
> processors that should:
>
> a) Provide some immediate solutions that you can deploy right now, and
>
> b) Provide good examples of things you can do with report processing
> that you can take, fork and modify.
>
> All of them are released under the Apache 2.0 license.
>
> In that spirit I've created ten new report processors:
>
> 1. Reports failed runs to an IRC channel -https://github.com/jamtur01/puppet-irc
>
> 2. Reports failed runs and logs to PagerDuty -https://github.com/jamtur01/puppet-pagerduty
>
> 3. Reports failed runs to Jabber/XMPP -https://github.com/jamtur01/puppet-xmpp
>
> 4. Reports failed runs to Twitter -https://github.com/jamtur01/puppet-twitter
>
> 5. Reports failed runs and logs to Campfire -https://github.com/jamtur01/puppet-campfire
>
> 6. Reports failed runs to Twilio -https://github.com/jamtur01/puppet-twilio
>
> 7. Reports failed runs to Boxcar -https://github.com/jamtur01/puppet-boxcar
>
> 8. Reports failed runs to HipChat -https://github.com/jamtur01/puppet-hipchat
>
> 9. Sends metrics to a Ganglia server via gmetric -https://github.com/jamtur01/puppet-ganglia
>
> 10. Reports failed runs to Growl -https://github.com/jamtur01/puppet-growl

James Turnbull

unread,
Jun 8, 2011, 7:39:27 PM6/8/11
to puppet...@googlegroups.com

Odd. Can I see the rest of your code?

If private you can email me offlist.

Regards

James

James Turnbull

unread,
Jun 8, 2011, 8:23:43 PM6/8/11
to puppet...@googlegroups.com
Don wrote:
>
> I'm running 2.6.4 on the master & client. pluginsync is true on both,
> and reports = zenoss only on the master for this test.
>
> Why is self.status not working in this case?
>

The issue is that status is only available in the V2 report format in
Puppet 2.6.5 and onwards. Before this you need to check for "err" tags
to find failed runs.

Don

unread,
Jun 8, 2011, 9:09:15 PM6/8/11
to puppet...@googlegroups.com
Thanks for the help off-list, James.

here's the stub I'm using to check if the log is error-ful, inside of process():

  def process

    failure = false

    #iterate through each log object and look for failures
    self.logs.each do |log|
      if log.level.to_s == 'err' || 'alert' || 'emerg' || 'crit'
        failure = true
      end
    end
 
    if failure
      Puppet.debug "Creating Zenoss event for failed run on #{self.host}."
###

This definitely costs a few more cycles than with 2.6.5+.

I'll publish the rest of the Zenoss processor on github tomorrow or Friday.

-Don

Don

unread,
Jun 24, 2011, 1:53:35 PM6/24/11
to puppet...@googlegroups.com
Ok, here's the report processor to send events to Zenoss, based off
James' Zendesk module.

https://github.com/donjohnson/puppet-zenoss

-Don
Release Engineer / Toolsmith, VerticalResponse

Craig White

unread,
Jun 24, 2011, 2:36:37 PM6/24/11
to puppet...@googlegroups.com
I'm psyched... I think I have my boss almost ready to implement Zenoss and still only see small benefits to using Dashboard.

Craig

--
Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ craig...@ttiltd.com
1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com

Need help communicating between generations at work to achieve your desired success? Let us help!

Reply all
Reply to author
Forward
0 new messages