-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
last_run_report.yaml is not readable by the check_puppet_agent script #38
Comments
Yeah, we ran into this too. We worked around it by running the check using sudo, but that doesn't feel very good.... I haven't found time to dive into this and come up with a real good solution though. Anyone has suggestions? |
A workaround for this is to tell puppet to change permissions. See Puppet Docs (not tested in older versions) puppet.conf (on all nodes):
This changes readability for the cache directory from 750 to 751 and makes the yaml file in its subdirectory readable. It is also possible to specify owner, not just mode (or instead of mode):
|
@akomakom this is a good workaround, but nevertheless not possible to enforce in the plugin itself. My 2 cents go over the following approach:
Sudo is already required, therefore i see no reason in avoiding the usage. @aswen i think that you should keep only one bug open among this one, as they share really the same root cause. Maybe one opened by you with all of the details, including the upstream bug. Comments are welcome! |
Don't try to add { group = nagios }, as mentioned above, in Puppet 4/5 (and especially don't push it out to all your puppet clients... oy) - only 'root' and 'service' are valid group values at this point and puppet will fail to run with an invalid group. I added some sudo tests as suggested instead - see above patch. It's working at least for my puppet 4/5 machines mostly on Debian/Fedora/CentOS. |
We did not like opening up our permissions on the report and cache files so we came up with a slightly awkward solution by creating a cron job that sends results to temp and simply "cat"ing the result.
|
To add to the list of stopgaps until this is resolved, my solution was to use the puppet configuration variable
addendum: it turns out that postrun commands come before the summary file is written , so the copy will always be one run behind with this method |
This is tested on version 3.6.2 In addition to allowing everyone readable permission to the file, I symlinked the file over to the lastrunreport of the sudo user. In my case nrpe is the sudo user which results in
I solved this by simply creating a symlink: sudo -u nrpe ln -s /var/lib/puppet/state/last_run_report.yaml /var/run/nrpe/.puppet/var/state/last_run_report.yaml That can be handled in puppet: nrpe.pp
/etc/sudoers.d/nrpeWe also need to add nrpe to sudoers
|
There is apparently "secure" info in last_run_report so puppetlabs have made the file not world readable. That means that it is not possible for the script to read that file.
The text was updated successfully, but these errors were encountered: