Hi all,
I figured it out.
class javalinks {
file {
"/usr/java/latest":
ensure => link,
noop => true,
tag => send_me_email,
selinux_ignore_defaults => true,
}
}
Thanks,
Zaiwen
On Tuesday, September 1, 2015 at 1:21:14 PM UTC-4, [email protected]
wrote:
>
> Hi,
>
> I made some progress.
>
> 1. Add the metaparameter tag => send_me_email (or any arbitrary set of tag
> values) to the resource you want to monitor via email.
> 2. Enable reports = tagmail in puppet.conf [master] section,
> 3. In tag.conf set tag and email address: send_me_email: [email protected]
>
> class javalinks {
>
> file {
> "/usr/java/latest":
> ensure => link,
> noop => true,
> tag => send_me_email,
> }
> }
>
> Now I get email for this class even if my overall tag log level is set to
> err and above, while this class is giving Notice log.
>
> However, there is another Notice for this class which I don't want to get
> email notification:
>
> Notice: /File[/usr/java/latest]/seluser: current_value unconfined_u,
> should be system_u (noop)
>
> I only want to get email for this message in this class:
>
>
> *Notice: /Stage[main]/Javalinks/File[/usr/java/latest]/ensure:
> current_value absent, should be link (noop)*So here is the quesetion:
> How to tag a specify notice in a class?
>
> Thanks,
> Stacey
>
> On Monday, August 31, 2015 at 2:59:21 PM UTC-4, [email protected]
> wrote:
>>
>> Hi all,
>>
>> I am using Puppet 3.7.3 and have a question about tagmail.
>>
>> My tagmail.conf is setup to send email only when there is err and above:
>> *err, alert, emerg, crit: [email protected] <[email protected]>*
>>
>> I have a module to check javalinks:
>>
>> class javalinks {
>>
>> file {
>> "/usr/java/latest":
>> ensure => link,
>> noop => true,
>> }
>> }
>>
>> I want the module to ensure /usr/java/latest is a link, but don't do
>> anything (noop => true).
>> I want to get an email notifcation if the link is missing.
>>
>> If I don't have such a link, run "puppet agent -t" on the machine will
>> display this on console:
>>
>> * Notice: /Stage[main]/Javalinks/File[/usr/java/latest]/ensure:
>> current_value absent, should be link (noop)*
>>
>> Since it is "Notice" level log, I don't get any email notification.
>>
>> So here is my question:
>>
>> *How could I get email notification for this specific Notice message,
>> without changing my tagmail.conf log level?*
>>
>> Thanks,
>> Stacey
>>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/3a30a950-9020-4c89-b870-3560426ac361%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.