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

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:

/opt/puppetlabs/puppet/cache/state/resources.txt
/opt/puppetlabs/puppet/cache/state/transactionstore.yaml
/opt/puppetlabs/puppet/cache/state/classes.txt
/opt/puppetlabs/puppet/cache/state/state.yaml
/opt/puppetlabs/puppet/cache/state/last_run_report.yaml
/opt/puppetlabs/puppet/cache/state/last_run_summary.yaml
/opt/puppetlabs/puppet/cache/client_data/catalog
/opt/puppetlabs/puppet/cache/client_data/catalog/client.domain.com.json


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 close merge delete

Sort by » oldest newest most voted

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

more