Nicola Zanetti
2013-May-07 15:19 UTC
[Puppet Users] Using Puppet to trigger a script when error occurs on log file
Hello everyone, I''m using Puppet on my Ubuntu servers and I would like it to restart a process whenever an error occurs while running an application. The error can be detected looking at the logs of the application of course, but I don''t want to parse the log file to detect it. Is there a way using Puppet, to trigger a script when something happens in a log file without having to parse it ? Many thanks for your support, Best, Nicola -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
joe
2013-May-07 20:31 UTC
[Puppet Users] Re: Using Puppet to trigger a script when error occurs on log file
This is not something puppet is intended to do. For one, puppet makes periodic runs and does not respond to changes on the system in realtime. So best case, your app would get restarted within 30 minutes (or whatever your runinterval is) of an error occuring, but not immediately upon that error occurring. Second, puppet can restart a service because another resource it manages changed (think config files), but it doesn''t have a mechanism in the service provider to restart based on other conditions. Puppet is very good about setting up an environment and maintaining its state, but it''s not an application monitoring/orchestration tool. On Tuesday, May 7, 2013 9:19:04 AM UTC-6, Nicola Zanetti wrote:> > Hello everyone, > I''m using Puppet on my Ubuntu servers and I would like it to restart a > process whenever an error occurs while running an application. The error > can be detected looking at the logs of the application of course, but I > don''t want to parse the log file to detect it. Is there a way using Puppet, > to trigger a script when something happens in a log file without having to > parse it ? > > Many thanks for your support, > > > Best, > > Nicola >-- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Nikola Petrov
2013-May-10 14:56 UTC
Re: [Puppet Users] Using Puppet to trigger a script when error occurs on log file
You shouldn''t search support for this in puppet but in something like monit, upstart or nagios handlers. Puppet isn''t suitable for this task although it might be possible it will be hacky. -- Nikola On Tue, May 07, 2013 at 08:19:04AM -0700, Nicola Zanetti wrote:> Hello everyone, > I''m using Puppet on my Ubuntu servers and I would like it to restart a > process whenever an error occurs while running an application. The error > can be detected looking at the logs of the application of course, but I > don''t want to parse the log file to detect it. Is there a way using Puppet, > to trigger a script when something happens in a log file without having to > parse it ? > > Many thanks for your support, > > > Best, > > Nicola > > -- > 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.