On Friday, June 21, 2013 7:03:03 AM UTC-5, Rabin Dahal
wrote:>
> Hi,
>
> Is there anyway to track a changed file at client end and notify the admin
> via email.
>
>
The Puppet agent will always notice when a managed property of a managed
file differs from its target value. Unless you are running in --noop mode,
it will change that property to the target value. It is possible to
trigger the agent to run an arbitrary command when that happens. For
example:
file { ''/etc/foo.conf'':
user => ''root'',
group => ''root'',
mode => ''0644'',
content => ''foodir = /opt/foo''
}
exec { ''foo-conf-changed'':
command => ''<any command here>'',
subscribe => File[''/etc/foo.conf''],
refreshonly => true
}
The triggered command could send e-mail, if you wish.
You can also configure the agent to log changes to either managed or
unmanaged properties of a managed resource via the ''audit''
metaparameter
(http://docs.puppetlabs.com/references/3.2.latest/metaparameter.html#audit),
but this does not directly allow you to trigger other actions.
John
--
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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.