Skip to content
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_summary.yaml not readable #28

Open
Rocco83 opened this issue Nov 19, 2016 · 4 comments
Open

last_run_summary.yaml not readable #28

Rocco83 opened this issue Nov 19, 2016 · 4 comments

Comments

@Rocco83
Copy link
Contributor

Rocco83 commented Nov 19, 2016

Hi,

running the script in debug mode it fail with

nagios@x:~$ bash -x /usr/local/custom/nagios/nagios-plugins-aswen/check_puppet_agent -w 3600 -c 7200 -s /var/lib/puppet/state/last_run_summary.yaml -d 0
[...]
++ sudo /usr/bin/puppet config print agent_disabled_lockfile
+ agent_disabled_lockfile=/var/lib/puppet/state/agent_disabled.lock
+ '[' -f /var/lib/puppet/state/agent_disabled.lock ']'
+ '[' -z /var/lib/puppet/state/last_run_summary.yaml ']'
+ '[' -s /var/lib/puppet/state/last_run_summary.yaml -a -r /var/lib/puppet/state/last_run_summary.yaml ']'
+ result 1
+ case $1 in
+ echo 'UNKNOWN: last_run_summary.yaml not found, not readable or incomplete'
UNKNOWN: last_run_summary.yaml not found, not readable or incomplete
+ rc=3
+ exit 3
nagios@x:~$ 

The reason why:
https://tickets.puppetlabs.com/browse/PUP-6936

The current stupid resolution:
chmox +x /var/lib/puppet

Feel free to suggest way to close it... I think that this should be closed on puppet side, and suggest a workaround like the one above.

(Updated by @aswen: put console output in code block)

@aswen
Copy link
Owner

aswen commented Nov 24, 2016

@Rocco83 Thanks for your feedback. I agree that bug should be fixed.
In the meanwhile you can use Puppet to change the file to o+x (That's how I solved it). Another approach might be to use sudo to verify if the file exists, but that feels a bit 'heavy' too.

@edrude
Copy link
Contributor

edrude commented Feb 16, 2017

Using puppet agent 4.9.2 and for me the last_run_summary.yaml file is being created as world readable. Maybe they fixed this?

@aswen
Copy link
Owner

aswen commented Feb 17, 2017

@erude1 Thanks for that headsup. https://tickets.puppetlabs.com/browse/PUP-6936 is still open though. So I don't know what's the reason you have a world readable last_run_summary.yaml file.

@edrude
Copy link
Contributor

edrude commented Feb 17, 2017

I think I misunderstood earlier. Looks like this issue is referencing /var/lib/puppet/ and /opt/puppetlabs/puppet/cache/ (my case) directories that are not world readable instead of the last_run_summary.yaml file.

I originally had this issue as well. My fix/workaround was to set "lastrunfile = /var/log/puppetlabs/last_run_summary.yaml" in the [agent] section of puppet.conf. Love the way your plugin automatically detects that by the way.

For me, Puppet 4.9.2 and CentOS7, /var/log/puppetlabs/ is world executable. I took this approach in favor of modifying /opt/puppetlabs/puppet/cache/ permissions because my puppet agent kept setting the permissions back on the cache directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants