sensu-plugins / sensu-plugins-logs

This plugin provides native instrumentation for monitoring log files or system logs via journald for regular expressions, and a Sensu handler for logging Sensu events to log files.
http://sensu-plugins.io
MIT License
8 stars 31 forks source link

Plugin copies the file to /var/cache folder and does its checking #15

Open jsiddharth opened 7 years ago

jsiddharth commented 7 years ago

To get this working, I had to add sensu user to the adm group so that I can address /var/log/auth.log. But for some reason I started to get Permission Denied for /var/cache/check-log/.../var/log/auth.log. I had to give chmod 777 access (without -R) to /var/cache/check-log/.../var/log/auth.log to get it to work. Ideally adding sensu user to root group should have done the trick.

Please help me solve this issue without having to do chmod on /var/cache/check-log/.../var/log/auth.log.

mf69 commented 7 years ago

I fixed this by changing check-log.rb line 36 BASE_DIR = '/var/cache/sensu/check-log'.freeze

This works (on ubuntu) because /var/cache/sensu is created by the sensu package install with r/w/x permissions for the sensu user, which is what the sensu-client daemon runs as.

majormoses commented 7 years ago

We need to remove the constant and make this an option that the user can control. I have commented this on the PR.