It's not a good idea to warn/crit in case of permissions problem because this is an issue with the user permissions with which you call the script, e.g. nagios user, but not with mysql itself or its bad file permissions.
So the proper way is to provide a descriptive error message and UNK code in case of any problem when looking for files not owned by mysql user.
It's not a good idea to warn/crit in case of permissions problem because this is an issue with the user permissions with which you call the script, e.g. nagios user, but not with mysql itself or its bad file permissions.
So the proper way is to provide a descriptive error message and UNK code in case of any problem when looking for files not owned by mysql user.
E.g. bin/pmp- check-mysql- file-privs mysql/cacti' : Permission denied find: `/var/lib/ mysql/mysql' : Permission denied find: `/var/lib/ mysql/performan ce_schema' : Permission denied find: `/var/lib/ mysql/percona' : Permission denied
[root@centos6 ~]# sudo -u nagios ./nagios/
UNK find: `/var/lib/
instead of silent exit.