fix check_mysqlnrpe #96
No reviewers
Labels
No labels
bug
bullseye
discussion
duplicate
enhancement
help wanted
invalid
question
suggestion
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: evolix/evocheck#96
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-mysqlnrpe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
the shell doesn't expand "~nagios", which makes the first test fail.
the grep wasn't looking for the nrpe config file :/
@ -891,12 +891,19 @@ check_mysqlmunin() {
}
check_mysqlnrpe() {
if is_debian_stretch && is_installed mariadb-server; then
nagios_file="~nagios/.my.cnf"
It doesn't expands because you have put double quotes.
should works.
I'm not fond of checking
nagios_file_abs
andnagios_file_sym
. We should keep tilde expansion. (With no quotes of course).I understand, but without the quotes the variable holds the expanded value.
The nrpe check currently contains the non-expanded version so it's not easy to check without rewritting all nrpe configurations.
We can loosen the check a bit and only verify that a "check_mysql" is present and not the entire line.
@ -892,4 +892,2 @@
check_mysqlnrpe() {
if is_debian_stretch && is_installed mariadb-server; then
nagios_file="~nagios/.my.cnf"
{ test -f $nagios_file \
Or you could add eval to evaluate the variable even if quoted.
This should works:
I think it's overcomplicated :/
Huh? You take the actual check. You add
eval
and its done.Any news? You don't agree?
@vlaborie what's your point of view?
It's not that I disagree. I think adding an
eval
is technically correct but needlessly complicated.I offered another solution : simplifying the NRPE check by not checking the exact command parameters (which we don't care about).
It verifies that there is an NRPE check for MySQL.
Ok go for it.