-
Notifications
You must be signed in to change notification settings - Fork 63
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
check-disk.rb docker issue with permissions #77
Comments
We can do a rescue and unknown but this is certainly a permission thing. |
Actually taking a look at the code that is exactly what it is doing: https://github.com/sensu-plugins/sensu-plugins-disk-checks/blob/2.4.0/bin/check-disk-usage.rb#L149
Running the same command:
Verifying that that it is a permissions issue:
I think what we need is a flag to ignore not just mount points but also dirs inside them. Does that sound good? |
I have the same issue. Solved by adding -d flag: |
To get around this problem we added these flags: |
It sounds like we should also write up something in the README with common gotchas and how to solve them. |
Anyone want to attempt a PR to ignore the dirs inside of them and not just the mount points? |
@majormoses I would like to help on this if still applicable, As I understand the issue could be solved by ignoring the file system itself, Could you explain more this statement "ignore the dirs inside of them and not just the mount points". Do you mean that the chek disk script should be have the ability to ignore these directory or something else ? |
After re-reading my comment and playing around with the the options again it seems like you might be able to do it without modification. This probably should work for most use cases with some minor tweaking: Single capture group matching multiple paths (best for simple situations):
Multiple capture groups that are optional (can accommodate more complex scenarios):
Also like others pointed out many of the errors/warnings can be avoided by not checking certain file systems other times it just makes sense to have sensu discard the output. At least in the case of ignoring the appropriate stuff with docker is very doable from what I see and the existing options:
I am not sure if there are other use cases that are eluding me but I think just some simple readme updates might be in order. |
One thing to point out that looking at the option: https://github.com/sensu-plugins/sensu-plugins-disk-checks/blob/2.5.1/bin/check-disk-usage.rb#L56-L59 is that this is a regex so |
sorry about the accidental close. |
Hi,
I'm running the check-disk.rb plugin on a docker host. If i run
/opt/sensu/embedded/bin/check-disk-usage.rb -x cgroup -p /var/lib/docker -c95 -w90
I have the expected output "OK"However when its running via Sensu
{"timestamp":"2017-08-04T23:42:04.965151+0200","level":"info","message":"publishing check result","payload":{"client":"docker","check":{"command":"/opt/sensu/embedded/bin/check-disk-usage.rb -x cgroup,proc,shm,none,nsfs -p /run/lxcfs,/var/lib/docker -c95 -w90","subscribers":["docker"],"standalone":true,"handlers":["slack","pagerduty"],"interval":30,"occurrences":2,"refresh":1800,"name":"check_disk","issued":1501882924,"executed":1501882924,"duration":0.067,"output":"CheckDisk WARNING: /var/lib/docker/aufs/mnt/0c545df7098b189bf1b11c6efb0c2c0677f12db9636e8b19a726a5775d861f68 Unable to read., /var/lib/docker/containers/ccea5f270de5ac5274314e21b05e87077742ccccf05d6765cf0a10c54830996b/shm Unable to read., /var/lib/docker/aufs/mnt/b87f8b0b649c482c430285f73bfc1a4245bb967b3143c131ee9a0d8bc4aebd37 Unable to read., /var/lib/docker/containers/d130b3529c2e500ec607424c7c26ca6c4371beabd4154c0796e04c6d0d689127/shm Unable to read., /var/lib/docker/aufs/mnt/1115a010f5184a6163414428776e5fec80f90aadeb0c589907cdb8bdeb94185d Unable to read., /var/lib/docker/containers/822aa8148f35280d3463ff11c870c42ff89e312b80cb04362edfdb7c9d2c3204/shm Unable to read., /var/lib/docker/aufs/mnt/d7f1a80ae7293d680a5cf7dd7eae6812d0fc02138a32f85a5d5dadb5352b6c44 Unable to read., /var/lib/docker/containers/cfb46d35c2dfa815c9214b0795359f6c7c8350947cc79751d0cb94e21e06b069/shm Unable to read.\n","status":1}}}
OS: Ubuntu 16.04 LTS
Sensu: 1.0.2
Check-Disk: 2.4.0
The text was updated successfully, but these errors were encountered: