Ask Your Question

distinguish between manual run and timed daemon runs (pe-puppet agent)

asked 2017-03-10 00:53:57 -0600

FranzCC gravatar image

updated 2017-03-10 00:54:40 -0600

Hi, how can i distiguish between time based runs by the agent, and manual run either via puppet agent -t or mco ?
Using the PE-Console i also cannot distiguish between runs !
On every run the agent changes these files:


I checked these files but didn't see any difference in the way i started the agent run.

There are some security considertations to which has driven me to raise that particular question.

If not, it should be no problem to write a state file where the timer writes the time until next run in epoch format ?

Checking the file /opt/puppetlabs/puppet/lib/ruby/vendorruby/puppet/scheduler/job.rb it seems to be quite easy to write @lastrun to the puppet cache file which would solve my problem immediately.

Rgds. Franz

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-10 07:20:40 -0600

FranzCC gravatar image

updated 2017-03-13 06:40:38 -0600

It would be great to have such a feature due to security considerations !!!
Right now i developed a workaround which collects runs of a whole day (via api) and finds out server agent runs via an algo
which only takes diffs into account that exaclty matches the runinterval.
Then i do a little math to estimate the next run.
Sideeffect is, that i can, using negative match, distinguish manual runs which i then diff against logged in users.
Unfortuntely i cannot query MCO for mco runs, but i'm sure some features will be implemented in the future.
Counting on it !

Output of my solution: (Forgot)

Next Run will be: 2017-03-13T12:38:46+0100
End Run will be: 2017-03-13T12:39:02+0100
Agent raw run time: 16 seconds

Rgds. Franz

edit flag offensive delete link more

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


Asked: 2017-03-10 00:53:57 -0600

Seen: 68 times

Last updated: Mar 13 '17