CMK version: 2.2.0p4
OS version: Debian 11
Error message: Error while executing SQL command: ORA-00911: Ungültiges Zeichen
Hi,
I’m new to checkmk and I wanted to try the “Check SQL Database” service. So I created a new rule ( Setup → Services → HTTP, TCP, Email,… → Check SQL Database) and entered the connection data for our Oracle database. When I use a simple select statement like
SELECT max(user_num) FROM users
it works fine and the new service shows the correct result.
But when I now try
SELECT count(1) FROM gv$session
I get the error
Error while executing SQL command: ORA-00911: Ungültiges Zeichen
The weird thing is, when I go to Host → Service discovery I can see this service on the bottom and it can actually execute this select statement. There I get the result
<134> is not a state, and no levels given
which is OK because 134 is the current number of sessions and I didn’t specify any levels/metrics.
I am assuming it has to do with the dollar sign ($) in the table_name “gv$session” but I don’t understand why it can be executed on one page and not on the other. I also don’t know how I could parenthesize or escape this statement.
(I can execute it just fine in sqlplus on the command line)
Any ideas?