It has been brought to my attention that we do have some charms with nrpe checks for root owned resources and they are implemented using a cron job that runs as root and performs the check itself while the nrpe check checks the output of the cron check e.g. rabbitmq-server:
Another option is to use the update-status hook, which runs by default every 5 minutes, to perform the check then store the output in a location that the nrpe check can read.
It has been brought to my attention that we do have some charms with nrpe checks for root owned resources and they are implemented using a cron job that runs as root and performs the check itself while the nrpe check checks the output of the cron check e.g. rabbitmq-server:
https:/ /github. com/openstack/ charm-rabbitmq- server/ blob/3c155e2bda eaec5090111749a 2cf366b55875575 /hooks/ rabbit_ utils.py# L1630
Another option is to use the update-status hook, which runs by default every 5 minutes, to perform the check then store the output in a location that the nrpe check can read.