Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Puppet-reports are using a lot of diskspace in:

/var/lib/puppet/reports
/var/lib/mysql

The assumption is that it stores all reports in the MySQL database, because both paths are about the same size. The resource_statuses table consist of rows that each represent a line in a reports file.

  • Can one safely remove the reports in /var/lib/puppet/reports after Puppet-dashboard or PuppetDB has processed them?
  • What is the best practice for handling reports?
  • Is there a way to make Puppet-dashboard automatically delete the yaml report files after processing them?
share|improve this question

2 Answers 2

up vote 10 down vote accepted

Yes you can delete them and I recommend it as well. The docs for Puppet dashboard aren't very opinionated on the ongoing maintenance of the dashboard, but it does need maintenance. I recommend a cron that delete reports in the database after a few days, a second one to remove any orphaned records, and a third to delete processed reports. Mine looks like this:

cd /path/to dashboard ; RAILS_ENV=production rake reports:prune upto=3 unit=day
cd /path/to dashboard ; RAILS_ENV=production rake reports:prune:orphaned
find /var/lib/puppet/var/reports/ -mmin +300 -type f -print0 | xargs -0 -r rm > /dev/null 2>&1

You can tweak the times to what works best for your system. I don't believe the delayed_job contains any functionality to delete processed reports, but you might be able to add it to code.

share|improve this answer

Another solution is to prevent that the reports are stored on the disk and restrict the storage to the database by removing store from the puppet.conf:

reports = puppetdb

Is is possible to change the number of days that Puppet-reports are stored in PuppetDB:

report-ttl

Automatically delete reports that are older than the specified amount of time. You may specify the time as a string using any of the suffixes described in the node-ttl section above.

Outdated reports will be deleted during the database garbage collection, which runs every gc-interval minutes.

If unset, the default value is 14 days.

puppetdb.conf

[database]
report-ttl=5d
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.