I want Munin to graph nginx error codes, so I tried a couple of plugins I found:
- A Bash script: https://github.com/munin-monitoring/contrib/blob/master/plugins/nginx/nginx_error
- A Python script: https://gist.github.com/eykd/1107061
Both of them work fine if I run them manually as root, but not if they are run by Munin. The problem seems to be that they try to access /var/log/nginx/access.log
, and the user under which the plugins run does not have permission to do so.
I don't want to change permissions on /var/log/nginx
or any of the log files. I tried to give the scripts the setuid bit, and they both are owned by root, but that still does not make a difference.
How can I solve this problem?