Ask Your Question
1

How can I monitor the Puppet agent run?

asked 2013-04-09 14:51:14 -0500

ramindk gravatar image

We're starting to depend on Puppet in our infrastructure. Is there a simple way to monitor the state of Puppet agent runs?

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
2

answered 2013-04-09 14:59:20 -0500

ramindk gravatar image

updated 2013-04-10 02:08:57 -0500

Each Puppet agent run should generate a /var/lib/puppet/state/last_run_summary.yaml file that looks something like the following.

--- 
  version: 
    puppet: "2.7.21"
    config: 1365531454
  changes: 
    total: 0
  events: 
    success: 0
    total: 0
    failure: 0
  resources: 
    failed_to_restart: 0
    failed: 0
    changed: 0
    out_of_sync: 0
    total: 263
    skipped: 6
    restarted: 0
    scheduled: 0
  time: 
    user: 0.02537
    filebucket: 0.000382
    file: 2.221451
    config_retrieval: 8.83160305023193
    ssh_authorized_key: 0.006314
    total: 14.0908550502319
    service: 1.630493
    group: 0.001
    last_run: 1365532022
    exec: 1.339523
    package: 0.034719

Your best bet to check that this file exists, is it recent, and ... (more)

edit flag offensive delete link more

Comments

Isn't there a problem with this check if puppet crashes and leaves the lockfile in place? Then this check will forever report "OK: Puppet is still running".

stig gravatar imagestig ( 2016-05-26 09:09:43 -0500 )edit
3

answered 2013-04-09 15:31:13 -0500

kdoswald gravatar image

You can also use Puppet-dashboard or foreman to get a visual view of status of all the nodes.

edit flag offensive delete link more

Comments

While you could view the state of your system, I wouldn't call it monitoring unless it had some alerting component.

ramindk gravatar imageramindk ( 2013-04-10 02:53:04 -0500 )edit
2

answered 2013-04-10 10:59:14 -0500

reidmv gravatar image

"Monitor the state of Puppet agent runs" can be interpreted either as "the REAL-TIME state of Puppet agent runs" or as "the last reported state of Puppet agent runs across my environment." The first is harder, and more interesting.

If what you want is to monitor the current runstate of Puppet agents across your infrastructure in real-time, check out https://github.com/hunner/progress_mq. It's not well documented but it may provide the core of what you're looking for. In essence, what this thing does is publish events on a message queue as they happen on Puppet agents ... (more)

edit flag offensive delete link more

Comments

Looks interesting. Would be nice to get some some detail out of monitoring other than ok or broken after the fact. I might need to create a new question around ...(more)

ramindk gravatar imageramindk ( 2013-04-11 12:25:24 -0500 )edit
0

answered 2013-04-13 09:26:59 -0500

updated 2013-04-13 09:28:00 -0500

you can check report section in puppet master, So you can either use puppet-dashboard to check puppet run status or even send puppet agent run reports through mails

edit flag offensive delete link more

Comments

Hello, I'm just starting to learn puppet. I would like to get a report by mail of some details about the agents, like which one is down and maybe more. I don't need it in real time and would like to get an aggregated report once a day on all agents together. Can you explain the steps need to configure in agents and master to get this report ? Thanks, Nadav

Nadav gravatar imageNadav ( 2014-08-27 11:27:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-04-09 14:51:14 -0500

Seen: 10,035 times

Last updated: Apr 13 '13