-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Description
Using the mysql script to monitor a MariaDB instance that is configured as a slave.
MariaDB doesn't recognise NONBLOCKING
or NOLOCK
in the first two commands here:
librenms-agent/agent-local/mysql
Lines 416 to 422 in def5f83
$result = run_query("SHOW SLAVE STATUS NONBLOCKING", $conn); | |
if ( !$result ) { | |
$result = run_query("SHOW SLAVE STATUS NOLOCK", $conn); | |
if ( !$result ) { | |
$result = run_query("SHOW SLAVE STATUS", $conn); | |
} | |
} |
Resulting in this error:
<<<mysql>>>
PHP Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NONBLOCKING' at line 1 in /usr/lib/check_mk_agent/local/mysql:1307
Stack trace:
#0 /usr/lib/check_mk_agent/local/mysql(1307): mysqli_query()
#1 /usr/lib/check_mk_agent/local/mysql(416): run_query()
#2 /usr/lib/check_mk_agent/local/mysql(135): ss_get_mysql_stats()
#3 {main}
thrown in /usr/lib/check_mk_agent/local/mysql on line 1307
A fix would be to wrap the calls to @mysqli_query($conn, $sql);
in run_query
in a try/catch block, although this is changing a heavily used function, so may need more validation for some versions of php.
MariaDB version: 10.5.27
PHP version: 8.2.28
Metadata
Metadata
Assignees
Labels
No labels