- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
上下文
我正在使用Icinga2
和Web2
设置IDO PostgreSQL
IDO MySQL
。
我的工作是以伟大的角色为基础的。我已经将项目(mickael ange/icinga2 ansible)扩展为添加更多的自动化和支持,如IDO PostgreSQL。我正在使用PostgreSQL server 9.4。
好吧,我最终得到了一个Ansible
role版本,它在没有向导的情况下自动安装带有IDO PostgreSQL或IDO MySQL的Icinga2 Web2。
我的问题
服务器似乎工作正常,但出现了一个例外,即我无法找出如何在Icinga2 Web2接口中获取数据,例如:CentOS 7
和icinga2-ansible-web2-ui
从Comments
菜单Downtimes
,Overview
,Event Grid
,Event Overview
菜单
我可以创建Notifications
和Timeline
,但它们不会在UI中列出。停机时间处理正确。
我可以发送History
,但它们也不会在UI中列出。当SELinux处于许可模式时,会发出通知。
我的问题是:是否有IDO或Icinga2 Web2配置来让数据库填充注释、停机时间等。。?
我的Comments
library "db_ido_pgsql"
object IdoPgsqlConnection "ido-pgsql" {
user = "icinga"
password = "icinga"
host = "localhost"
database = "icinga"
table_prefix = "icinga_"
instance_name = "icinga2"
instance_description = "icinga2 instance"
cleanup = {
downtimehistory_age = 48h
logentries_age = 31d
}
categories = DbCatConfig | DbCatState
}
Schedule Downtimes
权限设置为
Notifications
,
/etc/icinga2/features-enabled/ido-pgsql.conf
,
TABLE
,
SELECT
INSERT
权限设置为
UPDATE
DELETE
配置为用户来访问后端(
SEQUENCE
和
USAGE
资源),但仍然没有在UI中列出任何
postgres
(在创建注释之后)。
icinga_ido
命令列出的PosgreSQL权限:
icinga=> \dp
Access privileges
Schema | Name | Type | Access privileges | Column access privileges
--------+-----------------------------------------------------------------+----------+---------------------------+--------------------------
public | icinga_acknowledgements | table | postgres=arwdDxt/postgres+|
| | | icinga=arwd/postgres |
public | icinga_acknowledgements_acknowledgement_id_seq | sequence | postgres=rwU/postgres +|
| | | icinga=U/postgres |
public | icinga_commands | table | postgres=arwdDxt/postgres+|
| | | icinga=arwd/postgres |
public | icinga_commands_command_id_seq | sequence | postgres=rwU/postgres +|
| | | icinga=U/postgres |
public | icinga_commenthistory | table | postgres=arwdDxt/postgres+|
| | | icinga=arwd/postgres |
public | icinga_commenthistory_commenthistory_id_seq | sequence | postgres=rwU/postgres +|
| | | icinga=U/postgres |
<truncated>
icingaweb_ido
时,PostgreSQL日志(例如/var/lib/pgsql/9.4/data/pg_log/PostgreSQL Thu.log)中没有错误。
Comments
用户从
\dp
UI浏览
Comment
时存在错误(对于
SEQUENCE
用户没有错误):
< 2016-01-21 03:55:52.436 GMT >STATEMENT: SELECT last_value, min_value, max_value, cache_value, is_cycled, increment_by, is_called
FROM icinga_acknowledgements_acknowledgement_id_seq
pgAdmin
用户对
icinga
只有
postgres
权限。
icinga
、
USAGE
和
SEQUENCE
表中插入数据。
icinga_externalcommands
:
[2016-01-21 04:14:00 +0000] information/ExternalCommandListener: Executing external command: [1453349640] ADD_HOST_COMMENT;icinga2-web2-postgres;1;icingaadmin;dededewdwwewdew
[2016-01-21 04:14:00 +0000] debug/DbEvents: add external command history
[2016-01-21 04:14:00 +0000] notice/ExternalCommandProcessor: Creating comment for host icinga2-web2-postgres
[2016-01-21 04:14:00 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/api/packages/_api/icinga2-web2-postgres-1453347670-1/conf.d/comments/icinga2-web2-postgres!icinga2-web2-postgres-1453349640-1.conf
[2016-01-21 04:14:00 +0000] information/ConfigItem: Committing config items
[2016-01-21 04:14:00 +0000] warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
[2016-01-21 04:14:00 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 57:1-57:65) for type 'Service' does not match anywhere!
[2016-01-21 04:14:00 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 65:1-65:53) for type 'Service' does not match anywhere!
[2016-01-21 04:14:00 +0000] information/ConfigItem: Instantiated 1 Comment.
[2016-01-21 04:14:00 +0000] information/ConfigItem: Triggering Start signal for config items
[2016-01-21 04:14:00 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 04:14:00 +0000] notice/Comment: Added comment 'icinga2-web2-postgres!icinga2-web2-postgres-1453349640-1'.
[2016-01-21 04:14:01 +0000] debug/IdoPgsqlConnection: Query: COMMIT
[2016-01-21 04:14:01 +0000] debug/IdoPgsqlConnection: Query: BEGIN
icinga_comments
:
[2016-01-21 04:12:49 +0000] information/ExternalCommandListener: Executing external command: [1453349569] ADD_HOST_COMMENT;icinga2-web2-mysql;1;icingaadmin;yggygyyj
[2016-01-21 04:12:49 +0000] debug/DbEvents: add external command history
[2016-01-21 04:12:49 +0000] notice/ExternalCommandProcessor: Creating comment for host icinga2-web2-mysql
[2016-01-21 04:12:49 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/api/packages/_api/icinga2-web2-mysql-1453347256-1/conf.d/comments/icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0.conf
[2016-01-21 04:12:49 +0000] information/ConfigItem: Committing config items
[2016-01-21 04:12:49 +0000] warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
[2016-01-21 04:12:49 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 57:1-57:65) for type 'Service' does not match anywhere!
[2016-01-21 04:12:49 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 65:1-65:53) for type 'Service' does not match anywhere!
[2016-01-21 04:12:49 +0000] information/ConfigItem: Instantiated 1 Comment.
[2016-01-21 04:12:49 +0000] information/ConfigItem: Triggering Start signal for config items
[2016-01-21 04:12:49 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 04:12:49 +0000] notice/Comment: Added comment 'icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0'.
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: INSERT INTO icinga_externalcommands (command_args, command_name, command_type, endpoint_object_id, entry_time, instance_id) VALUES ('icinga2-web2-mysql;1;icingaadmin;yggygyyj', 'ADD_HOST_COMMENT', '1', 1, FROM_UNIXTIME(1453349569), 1)
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: INSERT INTO icinga_comments (author_name, comment_data, comment_source, comment_time, comment_type, endpoint_object_id, entry_time, entry_time_usec, entry_type, expires, instance_id, internal_comment_id, is_persistent, name, object_id) VALUES ('icingaadmin', 'yggygyyj', '1', FROM_UNIXTIME(1453349569), '2', 1, FROM_UNIXTIME(1453349569), '947563', '1', '0', 1, '1', '1', 'icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0', 68)
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: INSERT INTO icinga_commenthistory (author_name, comment_data, comment_source, comment_time, comment_type, endpoint_object_id, entry_time, entry_time_usec, entry_type, expires, instance_id, internal_comment_id, is_persistent, name, object_id) VALUES ('icingaadmin', 'yggygyyj', '1', FROM_UNIXTIME(1453349569), '2', 1, FROM_UNIXTIME(1453349569), '947563', '1', '0', 1, '1', '1', 'icinga2-web2-mysql!icinga2-web2-mysql-1453349569-0', 68)
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: COMMIT
[2016-01-21 04:12:50 +0000] debug/IdoMysqlConnection: Query: BEGIN
# Icinga2 restart with PostgreSQL
[2016-01-21 05:02:11 +0000] information/Application: Received request to shut down.
[2016-01-21 05:02:11 +0000] information/Application: Shutting down...
[2016-01-21 05:02:11 +0000] information/CheckerComponent: Checker stopped.
[2016-01-21 05:02:11 +0000] information/DbConnection: Resuming IDO connection: ido-pgsql
[2016-01-21 05:02:11 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 05:02:11 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/modified-attributes.conf
[2016-01-21 05:02:11 +0000] information/IdoPgsqlConnection: pgSQL IDO instance id: 1 (schema version: '1.14.0')
# Icinga2 restart with MySQL
[2016-01-21 05:03:20 +0000] information/Application: Received request to shut down.
[2016-01-21 05:03:20 +0000] information/Application: Shutting down...
[2016-01-21 05:03:20 +0000] information/CheckerComponent: Checker stopped.
[2016-01-21 05:03:20 +0000] information/DbConnection: Resuming IDO connection: ido-mysql
[2016-01-21 05:03:20 +0000] information/ConfigItem: Activated all objects.
[2016-01-21 05:03:20 +0000] information/ConfigCompiler: Compiling config file: /var/lib/icinga2/modified-attributes.conf
[2016-01-21 05:03:20 +0000] information/IdoMysqlConnection: MySQL IDO instance id: 1 (schema version: '1.14.0')
icinga_commenthistory
Github repo(branch:Issue-No-Historical-Data-in-Icinga2-Web2-and-DB),并按照
https://github.com/Icinga/icinga2-ansible中的说明进行操作。如果还没有安装所需的工具,则需要安装。然后与图书管理员ansible安装角色依赖关系。最后,我写了一个部分(#ido-no-historical-data-in-icinga2-web2-and-db)来重现这个问题。
最佳答案
最后,我找到了为什么历史数据没有被插入数据库,所以我在这里回应自己。
如documentation中所述:
类别可选。应写入数据库的信息类型。
所以当我从ido-pgsql.conf
配置中删除类别时。我重新启动Icinga2,然后按预期将数据写入数据库。Comments
,Downtimes
,好了,我想要的一切都列在用户界面上了。
我还删除了cleanup
部分,因为它可能不是我想要的。
最终的ido-pgsql.conf
配置:
library "db_ido_pgsql"
object IdoPgsqlConnection "ido-pgsql" {
user = "icinga"
password = "icinga"
host = "localhost"
database = "icinga"
table_prefix = "icinga_"
instance_name = "icinga2"
instance_description = "icinga2 instance"
}
关于mysql - 使用Icinga2 Web2的IDO DB中没有历史数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34875214/
我在 Icinga 工作,负责性能数据收集, 我必须清除超过 30 天的所有插件数据,我该怎么做。我有一些谷歌搜索没有帮助。 一些引用: External Commands List Database
我在 Debian 上安装 icinga2 来自: deb http://debmon.org/debmon debmon-jessie main deb http://httpredir.debia
我已经安装了 Icinga 版本 Icinga Classic UI 1.11.5(后端 1.11.5)- 但我想在我的 CentOS 6 上安装 Icinga 2。 你能告诉我我要备份哪个文件,这样
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我有一个需要解析的文件,我正在尝试列出 ICINGA2 的停机时间列表。 ICINGA 的 API 未按预期工作,并且未显示服务和主机文件的停机时间列表的完整列表。 文件名 - status.dat
我想使用 chef 自动化 redis perl 库。我正在使用 Nagios-check对于安装,但问题是在安装时系统会提示您回答各种问题。我怎样才能使这个过程自动化。我在安装时手动使用的命令是:
我在运行 CentOS 8 的服务器上安装了 Icinga2。但是,当我尝试安装 Icinga Web 2 时遇到了问题。 当我尝试运行命令 yum -y install icingaweb2 ici
我有一台用于备份存储的服务器。它在 Linux 上运行 ZFS,配置了 RAID z2 数据池并通过 Samba 共享。我需要监视 ZFS 文件系统,至少能够看到有多少可用空间。 我认为一个简单的 c
我想用 VB.NET 创建一个文件,我想将这个文件用于 Icinga 或 Nagios 配置。 如何使用编码创建正确的 Unix 格式的文件? 最佳答案 已解释:here .只需检测您最终要接收的编码
您好,我已经为 Icinga 2 安装了 logstash 插件。我通过发出 icinga2 api setup 设置了 API,然后重新启动了 Icinga 2 服务。 我正在使用/etc/icin
我是一名优秀的程序员,十分优秀!