[Check_mk (english)] check_sql does not accept any query

Gianluca Stella gianluca.stella at gmail.com
Mon Jul 4 11:18:49 CEST 2016


Mario Garcia <mariog at ...> writes:

> 
> I am trying to query an oracle database but what kind of query do they 
want? it says it must return at least a number and a string so I try 
with this: 
> 
> select INSTANCE_NUMBER,INSTANCE_NAME from v$instance
> 
> it does not work.. 
> 
> 
> SQL Statement: select INSTANCE_NUMBER,INSTANCE_NAME from v$instance
> Traceback (most recent call last):
>   File "./check_sql", line 247, in <module>
>     sys.stderr.write("\nSQL Result:\n %s\n\n" % result)
> TypeError: not all arguments converted during string formatting
> OMD[snba]:~/lib/nagios/plugins$
> 
> this also does not work: 
> 
> 
> 'select INSTANCE_NUMBER  from v$instance'
> SQL Statement: select INSTANCE_NUMBER  from v$instance
> 
> SQL Result:
>  1
> 
> UNKNOWN - Error while processing result of SQL statement: tuple index 
out of range
> 
> 
> 
> SQL Statement: select INSTANCE_NAME  from v$instance
> 
> SQL Result:
>  orcl
> 
> UNKNOWN - Error while processing result of SQL statement: could not 
convert string to float: orcl
> 
> 
> 
> what is exactly the check expecting? 
> 
> 
> -- Mario Garcia ABSI NV | System EngineerHumaniteitslaan 224 - Bld de 
l'Humanité - 1190 Bruxellesmariog-hTDmKBYT6Sw at public.gmane.org / 
http://www.absi.be / Tel: +32(0)2 333 40 00 Fax: +32(0)2 333 40 60 
> 
> 
> 
> _______________________________________________
> checkmk-en mailing list
> checkmk-en at ...
> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

As stated in the check's help:
"[it] checks that the result has a defined format containing three 
columns, a number, a text, and performance data. Upper or lower levels 
may be defined here."

So, your query should return 3 columns.

Gianluca




More information about the checkmk-en mailing list