E-mailing log messages containing specific tags

If, like most sysadmins, you feel like you don't get enough e-mail, you'll be looking for a way to generate more. Another type of Puppet report is called tagmail. This will e-mail the log messages to any address you specify.

How to do it…

  1. Add tagmail to the comma-separated list of reports in puppet.conf:
    [master]
    reports = store,tagmail
  2. Add some tags and associated e-mail addresses in the file /etc/puppet/tagmail.conf. For example, this line will e-mail all log messages to me:
    all: john@example.com
  3. When Puppet runs, you will get an e-mail that looks like the following:
    From: report@cookbook.bitfieldconsulting.com Subject: Puppet Report for cookbook.bitfieldconsulting.com To: john@example.com Mon Jan 17 ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.