diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/reports/tagmail.rb | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb index e17143e2f..c37341e11 100644 --- a/lib/puppet/reports/tagmail.rb +++ b/lib/puppet/reports/tagmail.rb @@ -8,21 +8,24 @@ Puppet::Reports.register_report(:tagmail) do desc "This report sends specific log messages to specific email addresses based on the tags in the log messages. - See the [UsingTags tag documentation](http://projects.puppetlabs.com/projects/puppet/wiki/Using_Tags) for more information on tags. + See the [documentation on tags](http://projects.puppetlabs.com/projects/puppet/wiki/Using_Tags) for more information. - To use this report, you must create a `tagmail.conf` (in the location - specified by `tagmap`). This is a simple file that maps tags to + To use this report, you must create a `tagmail.conf` file in the location + specified by the `tagmap` setting. This is a simple file that maps tags to email addresses: Any log messages in the report that match the specified tags will be sent to the specified email addresses. - Tags must be comma-separated, and they can be negated so that messages - only match when they do not have that tag. The tags are separated from - the email addresses by a colon, and the email addresses should also - be comma-separated. + Lines in the `tagmail.conf` file consist of a comma-separated list + of tags, a colon, and a comma-separated list of email addresses. + Tags can be !negated with a leading exclamation mark, which will + subtract any messages with that tag from the set of events handled + by that line. - Lastly, there is an `all` tag that will always match all log messages. + Puppet's log levels (`debug`, `info`, `notice`, `warning`, `err`, + `alert`, `emerg`, `crit`, and `verbose`) can also be used as tags, + and there is an `all` tag that will always match all log messages. - Here is an example `tagmail.conf`: + An example `tagmail.conf`: all: me@domain.com webserver, !mailserver: httpadmins@domain.com @@ -30,8 +33,9 @@ Puppet::Reports.register_report(:tagmail) do This will send all messages to `me@domain.com`, and all messages from webservers that are not also from mailservers to `httpadmins@domain.com`. - If you are using anti-spam controls, such as grey-listing, on your mail - server you should whitelist the sending email (controlled by `reportform` configuration option) to ensure your email is not discarded as spam. + If you are using anti-spam controls such as grey-listing on your mail + server, you should whitelist the sending email address (controlled by + `reportform` configuration option) to ensure your email is not discarded as spam. " # Find all matching messages. |
