我正在尝试从calibre库中收集一些统计数据,该库将元数据存储在 sqlite 数据库中。我正在尝试使用 collectd 的dbi 插件,但我无法找到正确的选项来让它打开数据库。
我尝试过的所有选项都给出了以下错误:
collectd[1214]: dbi plugin: cdbi_connect_database (calibre): dbi_conn_connect failed: dbi_conn_error failed with status -3
这是 collectd 配置的相关部分:
LoadPlugin dbi
<Plugin dbi>
<Query "books">
Statement "SELECT COUNT(*) AS value FROM books"
<Result>
Type "gauge"
InstancePrefix "calibre_books"
ValuesFrom "value"
</Result>
</Query>
<Query "languages">
Statement "SELECT COUNT(*) AS value FROM languages"
<Result>
Type "gauge"
InstancePrefix "calibre_languages"
ValuesFrom "value"
</Result>
</Query>
<Query "series">
Statement "SELECT COUNT(*) AS value FROM series"
<Result>
Type "gauge"
InstancePrefix "calibre_series"
ValuesFrom "value"
</Result>
</Query>
<Query "tags">
Statement "SELECT COUNT(*) AS value FROM tags"
<Result>
Type "gauge"
InstancePrefix "calibre_tags"
ValuesFrom "value"
</Result>
</Query>
<Database "calibre">
Driver "sqlite3"
# DriverOption "path" "/books/metadata.db"
DriverOption "dbname" "/books/metadata.db"
# SelectDB "calibre"
Query "books"
Query "languages"
Query "series"
Query "tags"
</Database>
</Plugin>