Hello, i have a question: how do you guys monitor ...
# puppet
o
Hello, i have a question: how do you guys monitor that Puppet agent is running and doing it's job? From what i know there are two aspects: • service is not running (easy to handle in most monitoring software) • service is running, but agent is disabled via
puppet agent --disable "Reason XYZ"
For case when agent is disabled we've previously used "Monit" (service was running from root) which was checking last modification timestamp of the file
/opt/puppetlabs/puppet/cache/state/last_run_report.yaml
Copy code
/etc/monit$ cat conf-enabled/puppetagent.monit 
### THIS FILE IS MANAGED BY PUPPET. ANY MANUAL CHANGES WILL GET OVERWRITTEN.
check file last_puppet_run with path /opt/puppetlabs/puppet/cache/state/last_run_report.yaml
  if mtime older than 1440 minutes then exec "/etc/monit/conf-enabled/slack_bad.sh"
We tried to try to replicate what Monit was doing in Zabbix and Prometheus node exporter, but because of the permissions of this file Zabbix and Prometheus node exporter are not able to check timestamp of this file
Copy code
ls -l /opt/puppetlabs/puppet/cache/state/last_run_report.yaml
-rw-r----- 1 root root 284420 Jun 23 09:46 /opt/puppetlabs/puppet/cache/state/last_run_report.yaml
What is the proper way to cover use case when agent is disabled? Thanks