forked from evolix/evocheck
fix check_mysqlnrpe
the shell doesn't expand "~nagios", which makes the first test fail. the grep wasn't looking for the nrpe config file :/
This commit is contained in:
parent
8b2d789830
commit
3c92290917
19
evocheck.sh
19
evocheck.sh
|
@ -891,12 +891,19 @@ check_mysqlmunin() {
|
||||||
}
|
}
|
||||||
check_mysqlnrpe() {
|
check_mysqlnrpe() {
|
||||||
if is_debian_stretch && is_installed mariadb-server; then
|
if is_debian_stretch && is_installed mariadb-server; then
|
||||||
nagios_file="~nagios/.my.cnf"
|
nagios_home=$(getent passwd "nagios" | cut -d: -f6)
|
||||||
{ test -f $nagios_file \
|
nagios_file_abs="${nagios_home}/.my.cnf"
|
||||||
&& [ "$(stat -c %U $nagios_file)" = "nagios" ] \
|
nagios_file_sym="~nagios/.my.cnf"
|
||||||
&& [ "$(stat -c %a $nagios_file)" = "600" ] \
|
|
||||||
&& grep -q -F "command[check_mysql]=/usr/lib/nagios/plugins/check_mysql -H localhost -f $nagios_file";
|
if ! test -f $nagios_file_abs; then
|
||||||
} || failed "IS_MYSQLNRPE"
|
failed "IS_MYSQLNRPE" "$nagios_file_abs is missing"
|
||||||
|
elif [ "$(stat -c %U $nagios_file_abs)" != "nagios" ] \
|
||||||
|
|| [ "$(stat -c %a $nagios_file_abs)" != "600" ]; then
|
||||||
|
failed "IS_MYSQLNRPE" "$nagios_file_abs has wrong permissions"
|
||||||
|
else
|
||||||
|
grep -q -F "command[check_mysql]=/usr/lib/nagios/plugins/check_mysql -H localhost -f $nagios_file_sym" /etc/nagios/nrpe.d/evolix.cfg \
|
||||||
|
|| failed "IS_MYSQLNRPE" "check_mysql is missing"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
check_phpevolinuxconf() {
|
check_phpevolinuxconf() {
|
||||||
|
|
Loading…
Reference in a new issue