El 17/02/16 a las 17:12, John Gelnaw escribió:
On Wednesday, February 17, 2016 at 10:37:46 AM UTC-5, [email protected]
wrote:

    is there any way we can check the heartbeat of puppet agents?

    and if agent is down can puppet try to bring up the server.


It may be a bit primitive, but I've been using crontab to "manually" run
the puppet agent.

I use the fqdn_rand() function to pick a number between 1-30, then set a
crontab with that minute, and that minute+30, as the times to run.  Does
a nice job of distributing the agent load across my enterprise.

  $r1 = fqdn_rand(30)
  $r2 = $r1 + 30

  cron { 'puppet-agent':
    ensure  => present,
    user    => root,
    minute  => [$r1, $r2],
    environment => 'MAILTO=""',
    command => "/usr/bin/puppet agent --test --environment
$puppetEnvironment",
  }

I have something similar to this, but instead of running the agent in onetime mode, I start the daemon if it is not running. The command I run in the cron is:

/etc/init.d/puppet status > /dev/null 2>&1 || /etc/init.d/puppet start

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868887590
Fax: 868888337

--
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/56C56CE9.7090202%40um.es.
For more options, visit https://groups.google.com/d/optout.

Reply via email to