Ask Your Question
0

How can i get the actual state from radiator with api calls ?

asked 2016-07-07 11:12:46 -0600

ingo gravatar image

Hello , how can i get the actual state from radiator with api calls ? For our monitoring i need the same state like the radiator shows.

Best regards Ingo

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-08-06 13:44:07 -0600

This actually reads from the same source as the Puppet radiator.

This solution works for me.

stateOverview=$(sudo curl -G "localhost:8080/pdb/ext/v1/state-overview")
failedCount=$(echo $stateOverview | jq '.failed')
changedCount=$(echo $stateOverview | jq '.changed')

returns:

{ "failed" : 1, "unchanged" : 60, "unresponsive" : 6, "noop" : 0, "changed" : 4, "unreported" : 0 }

https://puppet.com/docs/puppetdb/5.1/...

Happy reporting ;)

edit flag offensive delete link more
0

answered 2016-07-08 09:26:16 -0600

ingo gravatar image

Hello , i found a solution that's work for me.

e.g. curl -G 'http://localhost:8080/pdb/query/v4/aggregate-event-counts' --data-urlencode 'summarize_by=certname' --data-urlencode 'query=[">", "timestamp", "2016-07-08T11:20:00"]'

[{"summarize_by":"certname","successes":1,"failures":0,"noops":0,"skips":0,"total":1}]

edit flag offensive delete link more

Comments

aggregate-event-counts is an experimental endpoint and should be used with caution...

jedi_vapor gravatar imagejedi_vapor ( 2018-08-06 13:43:07 -0600 )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

1 follower

Stats

Asked: 2016-07-07 11:12:46 -0600

Seen: 521 times

Last updated: Aug 06