Obtaining a list of systems with failed puppet runs

Hi,

Is there a way to obtain a list of systems where the puppet run has failed
due to certificate errors etc? Ideally a csv or excel output would be
great. Please advise. Thank you. Regards,

Kartik Vashishta

You should be able to build a search for that. Play around in the search
box on the reports page - something like

failed > 0 and log ~ certificate and reported >"1 hour ago"

seems to work for me. Then you can use that to drive the API and get json
results back, which you can parse into CSV fairly easily I would expect.

Greg

··· On 22 February 2016 at 16:43, Kartik Vashishta wrote:

Hi,

Is there a way to obtain a list of systems where the puppet run has failed
due to certificate errors etc? Ideally a csv or excel output would be
great. Please advise. Thank you. Regards,

Hi,

I am using hammer and getting errors, the rpms for:
1)rubygem-hammer_cli_foreman
2)rubygem-hammer_cli
are the most recent, environment is Centos 6.

This is what is happening:

hammer --output csv host list --search 'last_report < "60 minutes ago" and
status.enabled = true'

[Foreman] username:

[Foreman] password for <username>:

Could not load the API description from the server

  • is the server down?

  • was 'foreman-rake apipie:cache' run on the server when using apipie
    cache? (typical production settings)

Warning: An error occured while loading module hammer_cli_foreman

Error: No such sub-command 'host'

See: 'hammer --help'

Config file:

cat /etc/hammer/cli_config.yml

:ui:

:interactive: true

:per_page: 20

:history_file: '~/.hammer/history'

enable/disable color output of logger in Clamp commands

:watch_plain: false

:log_dir: '~/.hammer/log'

:log_level: 'error'

:log_api_calls: false

#:log_owner: 'foreman'

#:log_group: 'foreman'

#:log_size: 5 #MB

Do i specifically need to login as "admin", I am able to provision new
hosts, add classes etc in foreman, so i am assuming that I have admin
rights…

··· On Tuesday, February 23, 2016 at 6:36:01 AM UTC-6, Greg Sutcliffe wrote: > > On 22 February 2016 at 16:43, Kartik Vashishta > wrote: > >> Hi, >> >> Is there a way to obtain a list of systems where the puppet run has >> failed due to certificate errors etc? Ideally a csv or excel output would >> be great. Please advise. Thank you. Regards, >> > > You should be able to build a search for that. Play around in the search > box on the reports page - something like > > failed > 0 and log ~ certificate and reported >"1 hour ago" > > seems to work for me. Then you can use that to drive the API and get json > results back, which you can parse into CSV fairly easily I would expect. > > Greg >

Here is a command to list all the nodes in error state:

hammer host list --search “status.failed > 0”