我是 incinga2 框架的新手,如何在 incinga2 中运行 sql raw 或自定义查询,如下所示
SELECT
`user`,
COUNT(0) as Total_Count,
MAX(range_count) Max_Range_Count
FROM (
SELECT
a.`user`,
a.change_time,
COUNT(0) range_count
FROM audit_log a
INNER JOIN audit_log b ON a.`user` = b.`user`
WHERE b.change_time BETWEEN a.change_time AND a.change_time + INTERVAL 30 MINUTE
GROUP BY a.`user`, a.change_time
) AS user_range_count
GROUP BY `user`
icinga2 中的这个数据库对象,用于连接数据库和获取数据。他们使用适配器,但 pdo 是空的。A 可以在这里添加我的 pdo 吗?icniga2框架对吗?
ipl\Sql\Connection Object
(
[config:protected] => ipl\Sql\Config Object
(
[db] => mysql
[host] => localhost
[port] => 3306
[dbname] => auditlog
[username] => root
[password] =>
[charset] => utf8
[options] =>
[type] => db
[persistent] => 0
)
[pdo:protected] =>
[queryBuilder:protected] =>
[adapter:protected] => ipl\Sql\Adapter\Mysql Object
(
[quoteCharacter:protected] => Array
(
[0] => `
[1] => `
)
[escapeCharatcer:protected] => ``
[escapeCharacter:protected] => \"
[options:protected] => Array
(
[8] => 0
[20] =>
[3] => 2
[11] => 0
[17] =>
)
)
[pluginLoaders:protected] => Array
(
[adapter] => Array
(
[0] => ipl\Stdlib\Loader\AutoLoadingPluginLoader Object
(
[namespace:protected] => ipl\Sql\Adapter
[postfix:protected] =>
[uppercaseFirst:protected] => 1
)
)
)
)