[collectd] Queries with `sum(something) as this' don't work on dbi plugin (SQLServer)

Daniel Hilst Selli danielhilst at gmail.com
Tue Apr 2 17:19:08 CEST 2013


I'm facing this error

[2013-04-02 12:13:21] [error] dbi plugin: Column `log_reads': Don't know 
how to handle source type 4.
[2013-04-02 12:13:21] [error] dbi plugin: cdbi_read_database_query 
(MSSQLServer, teste_query): cdbi_result_get_field (1) failed.

While using this dbi block
<Plugin dbi>
         <Query "teste_query">
                 Statement "select sum(total_logical_reads) as log_reads 
from sys.dm_exec_query_stats"
                 <Result>
                         Type "gauge"
                         ValuesFrom "log_reads"
                 </Result>
         </Query>

         <Database "MSSQLServer">
                 Driver "freetds"
                 Hostname "orisnet.verzani.com.br"
                 DriverOption "host" "192.168.5.18"
                 DriverOption "username" "SA"
                 DriverOption "password" "Paxazx01"
                 Query "teste_query"
         </Database>
</Plugin>

The problem is with things like this `sum(something) as this' I just 
can't get it working.. The query works fine on SSMS and retruns only one 
line and one column,  Any idea?

PS: I'm trying to monitor the reads/writes and worker time on MS 
SQLServer..

Regards,




More information about the collectd mailing list