2016-12-21 84 views

回答

3

的報告顯示,.yaml格式從文檔:

當作爲服務運行,木偶代理將消息記錄到系統日誌。你 syslog配置決定了這些郵件將被保存,但 默認位置是/ var /日誌/ Linux上的消息, /var/log/system.log在Mac OS X,和/ var/Solaris上adm/messages中。

當與--logdest FILE選項啓動,木偶代理記錄到由文件指定的文件。

https://docs.puppet.com/puppet/4.8/services_agent_unix.html#running-puppet-agent-as-a-service

勞爾提到,上次運行報告保存爲statedir目錄下的YAML文件。

根據您的使用您的操作系統和木偶的版本,這可能是在不同的位置。

例如,我的木偶4服務器上安裝:

$ tree $(puppet agent --configprint statedir) 
/opt/puppetlabs/puppet/cache/state 
├── classes.txt 
├── graphs 
│ ├── expanded_relationships.dot 
│ ├── relationships.dot 
│ └── resources.dot 
├── last_run_report.yaml 
├── last_run_summary.yaml 
├── resources.txt 
├── state.yaml 
└── transactionstore.yaml 

1 directory, 9 files 

閱讀本上次報告文件一個偉大的工具爲report-print。如果在上一次報告中需要一些特定的信息,則可以調整一些報告打印代碼來製作自己的報告打印機。

您也可以使用所謂的報告處理器,即編寫自定義代碼來控制格式並處理該格式,例如發佈到Splunk服務器,Slack,Hipchat等。一個簡單的示例是store_json,其中將報告存儲爲JSON而不是Yaml。

1

在Linux中,看看系統日誌(/var/log/messagesjournalctl)。 你應該有每個執行的內部/var/lib/puppet