Skip to content

check_puppet.rb doesn't complain when it doesn't have read permissions #11

Open

Description

@Dieterbe

check_puppet.rb gives a false sense of security if it doesn't have the correct read permissions, claiming no failed resources or events:

[dieter.plaetinck@dfvimeopweb1 ~]$ /usr/local/bin/check_puppet.rb -w 1200 -c 3600
OK: last run 8 minutes ago with 0 failed resources 0 failed events and currently enabled|time_since_last_run=522s;1200;3600;0 failed_resources=0;;;0 failed_events=0;;;0
[dieter.plaetinck@dfvimeopweb1 ~]$ sudo /usr/local/bin/check_puppet.rb -w 1200 -c 3600
OK: last run 8 minutes ago with 4 failed resources 4 failed events and currently enabled|time_since_last_run=526s;1200;3600;0 failed_resources=4;;;0 failed_events=4;;;0

Activity

  1. ripienaar commented on Jan 13, 2014

    @ripienaar
    Owner

    should be an easy check, wanna give it a try fixing it?

  2. kstalledo commented on Jan 13, 2017

    @kstalledo

    For some reason, I'm getting this error even if the file is present and permission is correct:
    UNKNOWN: Summary file not found or not readable. Check /var/lib/puppet/state/last_run_summary.yaml

    Any idea?

  3. ripienaar commented on Jan 13, 2017

    @ripienaar
    Owner

    @kstakledo so where is your file called that? There is a CLI flag to configure the path.

  4. kstalledo commented on Jan 13, 2017

    @kstalledo

    drwxr-xr-t 3 puppet puppet 4096 Jan 13 16:20 .
    drwxr-x--- 12 puppet puppet 4096 Apr 9 2016 ..
    -rw-r----- 1 root root 1024 Jan 13 16:20 classes.txt
    drwxr-xr-x 2 root root 4096 Sep 29 2015 graphs
    -rw-r----- 1 root root 160267 Jan 13 16:20 last_run_report.yaml
    -rw-r--r-- 1 root root 874 Jan 13 16:20 last_run_summary.yaml
    -rw-r----- 1 root root 6096 Jan 13 16:20 resources.txt
    -rw-rw---- 1 root root 82239 Jan 13 16:20 state.yaml
    root@dc1-aie-fms-01:/var/lib/puppet/state#

    I already configured the flag. Same thing.

  5. ripienaar commented on Jan 13, 2017

    @ripienaar
    Owner

    And you ran the check as root?

  6. kstalledo commented on Jan 13, 2017

    @kstalledo

    it's being ran as a different user, but as you can see the file is readable by everyone based on its permission.

  7. ripienaar commented on Jan 13, 2017

    @ripienaar
    Owner

    The parent dir is not.

  8. kstalledo commented on Jan 13, 2017

    @kstalledo

    Good spot! Let me try and check.

  9. kstalledo commented on Jan 13, 2017

    @kstalledo

    Nope, didn't work. Even with 777 permission on both the directory and the file.

  10. ripienaar commented on Jan 13, 2017

    @ripienaar
    Owner

    As the user you are running the the check as. Can you cat the file?

  11. kstalledo commented on Jan 13, 2017

    @kstalledo

    just added the user that does the check to the puppet group. all working now. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions