- Puppet 2.7 Cookbook
- John Arundel
- 383字
- 2021-04-02 18:19:58
Generating reports
"What the world really needs is more love and less paperwork."—Pearl Bailey
Truth is often the first casualty of large infrastructures. If you're managing a lot of machines, Puppet's reporting facility can give you some valuable information on what's actually happening out there.
How to do it…
To enable reports, just add the following to a client's puppet.conf
:
report = true
How it works…
With reporting enabled, Puppet will generate a report file on the Puppetmaster, containing data such as the following:
- Time required to fetch configuration from the Puppetmaster
- Total time of the run
- Log messages output during the run
- List of all resources in the client's manifest
- Whether Puppet changed each resource
- Whether a resource was out of sync with the manifest
By default, these reports are stored in /var/lib/puppet/reports
, but you can specify a different destination using the reportdir
option. You can either create your own scripts to process these reports (which are in the standard YAML format), or use a tool such as Puppet Dashboard to get a graphical overview of your network.
There's more…
A few tips for getting the best from Puppet's reports are explained in the following text.
Enabling reports on the command line
If you just want one report, or you don't want to enable reporting for all clients, you can add the --report
switch to the command line when you run Puppet manually:
# puppet agent --test --report
You can also see some statistics about a Puppet run by supplying the --summarize
switch as follows:
# puppet agent --test --summarize info: Retrieving plugin info: Caching catalog for cookbook.bitfieldconsulting.com info: Applying configuration version '1306169315' notice: Finished catalog run in 0.58 seconds Changes: Events: Resources: Total: 7 Time: Config retrieval: 3.65 Filebucket: 0.00 Schedule: 0.00
Logging Puppet messages to syslog
Puppet can also send its log messages to the Puppetmaster's syslog, so that you can analyze them with standard syslog tools. To enable this, set the following option in the Puppetmaster's puppet.conf
:
[master] reports = store,log
The default report type is store
(it writes the reports to /var/lib/puppet/reports
), and log
tells Puppet to also send messages to the syslog.
See also
- Creating graphical reports in this chapter
- Logging debug messages in this chapter
- Using Puppet Dashboard in Chapter 9
- Adobe創(chuàng)意大學Illustrator產(chǎn)品專家認證標準教材(CS6修訂版)
- Python數(shù)據(jù)分析實戰(zhàn):從Excel輕松入門Pandas
- Mastering phpMyAdmin 3.1 for Effective MySQL Management
- 中文版Photoshop CC平面設(shè)計實用教程
- 中文版After Effects 2022基礎(chǔ)教程
- 高等院校電腦美術(shù)教材:CorelDRAW X7中文版基礎(chǔ)教程
- 三維建模與3D打印從入門到精通
- Spark Cookbook 中文版
- Photoshop CC入門與提高(超值版)
- Building Websites with VB.NET and DotNetNuke 4
- PHP and MongoDB Web Development Beginner's Guide
- Photoshop+CorelDRAW 字體設(shè)計與創(chuàng)意:草圖/實現(xiàn)/包裝(微課版)
- 中文版Maya 2014基礎(chǔ)培訓教程
- TopSolid Wood軟件設(shè)計技術(shù)與應(yīng)用
- Transformer自然語言處理實戰(zhàn):使用Hugging Face Transformers庫構(gòu)建NLP應(yīng)用