AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[icinga2](server)

Martin Hope
TRW
Asked: 2020-11-10 06:36:24 +0800 CST

向 Icinga Master-Satellite-Agent 基础设施中的代理添加服务检查

  • 0

我有这样的环境:

  • 掌握
  • 一些分配给主控的卫星
  • 许多代理分配给卫星,一些代理分配给主(没有卫星)。

所有系统均已准备就绪,PKI 设置已完成。大多数默认检查(apt、disk、cpu)也在运行,我可以在主服务器上看到当前状态。现在我已经开始实施自定义检查(比如 check_eth 来监控网络流量)。我已将脚本发布到所有主机并在所有主机上定义了命令:

object CheckCommand "check_eth" {
  import "plugin-check-command"
  command = [ "/usr/bin/sudo", PluginDir + "/check_eth" ]
 
  arguments       = {
   "-w" = {
      value                     = "$eth_warning$"
      description               = "Percent free/used when to warn"
      required                  = true
    }
    "-c" = {
      value                     = "$eth_critical$"
      description               = "Percent free/used when critical"
      required                  = true
    }
    "-i" = {
      value                     = "$eth_interface$"
      description               = "Given network interface"
      required                  = true
    }
  }

  vars.eth_interface  = "enp0s31f6"
  vars.eth_warning  = "2048G"
  vars.eth_critical = "4096G"
}

我可以在所有主机上运行脚本。在 Master 上,可以看到卫星和所有直接分配给 master 的主机检查的响应。在所有具有 parent=satellite 的主机上,状态为 UNKNOWN。那是我的问题……为什么?

主机对象如下:

# master: /etc/icinga2/zones.conf

object Endpoint "monitor.domain" {
}

object Zone "master" {
  endpoints = [ "monitor.domain" ]
}

object Endpoint "satellite1.domain" {
    host = "<ip>"
    port = "<port>"
}

object Zone "satellite1.domain" {
    parent = "master"
    endpoints = [ "satellite1.domain" ]
}

卫星配置如下所示:

# master: /etc/icinga2/zones.d/satellite1.domain/hosts.conf

object Host "satellite1.domain" {
    import "generic-host"
    check_command = "hostalive"
    zone = "master"

    address = "<ipv4>"
    address6 = "<ipv6>"
    
    vars.agent_endpoint = name
    ...
}

object Host "agent1.domain" {
    import "generic-host"
    check_command = "hostalive"
    zone = "satellite1.domain"

    address = "<ipv4>"
    address6 = "<ipv6>"
    
    vars.agent_endpoint = name
    ...
}
...

该区域包括。卫星内部的端点也在主节点上定义:

# master: /etc/icinga2/zones.d/satellite1.domain/zones.conf
object Zone "agent1.domain" {
    parent = "satellite1.domain"
    endpoints = [ "agent1.domain" ]
}

object Endpoint "agent1.domain" {
    host = "<ip>"
    port = "<port>"
}

现在将命令应用于主机(也在主机上定义)

# master: /etc/icinga2/zones.d/satellite1.domain/services.conf

apply Service "Network Traffic" {
  import "generic-service"

  check_command = "check_eth"
  command_endpoint = host_name

  assign where host.name == "satellite1.domain"
}

apply Service "Network Traffic" {
  import "generic-service"

  check_command = "check_eth"
  command_endpoint = host_name

  assign where host.name == "agent1.domain"
}

我想念什么?

icinga2
  • 1 个回答
  • 350 Views
Martin Hope
ufk
Asked: 2020-08-10 06:00:55 +0800 CST

尝试为任何类型警报的邮件通知配置 icinga2 目录

  • 0

我有用于 icinga2 的 icingaweb2 Web 界面和导演。

我想为我监控的任何主机中的任何类型的警报发送电子邮件通知。

所以我去了 icingaweb2 web 界面,在左侧菜单上我点击Icinga Director->然后Notifications点击Notificationsadd

我实际上添加了两个通知。

一个是我进口mail-host-notification的,另一个是我进口的mail-service-notification。

因此与主机相关的通知是一个脚本,而与服务相关的通知是另一个脚本。

因为我想发送所有类型的通知,所以在Assign where我为服务配置的强制性东西中 -!service.disabled只要它被启用..以及我使用的服务,host.zone == "master"因为我没有任何卫星,所以它们都在相同的区域。

这是正确的方法吗?

我没有找到任何地方来定义将电子邮件发送到哪里。

我检查了脚本,应该调用一个环境变量(我认为)USEREMAIL来定义发送这封电子邮件的位置。我找不到放置它的地方!

所以总结一下..几个问题:

  1. 为了提醒来自所有主机的所有类型的通知,我应用了哪些Assign where规则有意义
  2. 这是正确配置电子邮件通知的方法吗?
  3. 如何设置所需的变量,例如将电子邮件发送到哪里?

非常感谢您

icinga2
  • 1 个回答
  • 861 Views
Martin Hope
msana
Asked: 2020-06-16 10:03:23 +0800 CST

check_snmp 插件超时 icinga2

  • 0

我是 icinga 的新手,目前我正在尝试监视运行 paOS 9.0 且 OID 为 1.3.6.1.2.1.25.3.3.1.2.1 (hrProcessorLoad.1) 的 paloalto 防火墙,但我遇到了 check_snmp 插件问题昂贵的超时,我不知道为什么;我尝试了一切。系统正在运行:

  • 所以:centos 7
  • Icinga2 版本 2.11.3-1
  • IcingaWeb2 版本 2.7.3
  • Icinga 控制器模块版本 1.7.2

check_snmp 插件的版本是 2.3.3

由 icinga 运行的命令和相关错误是

[root@icinga-test plugins]# /usr/lib64/nagios/plugins/check_snmp -C <community> -H 10.200.145.77 -c 50 -m HOST-RESOURCES-MIB -o hrProcessorLoad.1 -t 10 -w 40
CRITICAL - Plugin timed out while executing system call

即使使用数字 OID 代替名称,结果也不会改变

我知道这不是网络问题,因为 snmpget 显示:

[root@icinga-test plugins]# snmpget -v2c -c <comunity> 10.200.145.77 hrProcessorLoad.1
HOST-RESOURCES-MIB::hrProcessorLoad.1 = INTEGER: 7

它与它一起工作的事实也应该说明 MIB 已正确安装,此外,我尝试将超时参数增加到 120 秒,但没有任何改变

非常奇怪的是,同一个插件正确地监控其他具有 OID .1.3.6.1.4.1.2021.2.1.5.1 的 centos 7 系统,并且它从未超时。

nagios icinga2 check-snmp
  • 1 个回答
  • 828 Views
Martin Hope
ufk
Asked: 2020-05-04 10:09:08 +0800 CST

使用 icinga 远程代理运行远程检查命令

  • 0

我在 4 台服务器上安装了 icinga v2.11.3-1,其中一台作为主服务器,其余的是代理节点,它们配置正确,因为它们在主机下的 icingaweb2 中可见。

我想要做的是能够在远程代理上运行检查命令。

假设我想监视名为my-server.

所以在主节点中我添加了以下配置:

首先定义主机和区域:

object Host "my-server" {
  import "generic-host"
        address = "my-server-host"
        vars.os = "Linux"
  vars.disks["disk /mnt/data"] = {
    disk_partitions =  "/mnt/data"
  }
  vars.agent_endpoint = name

}

object Endpoint "my-server" {
 host = "my-server"
}

object Zone "my-server" {
 endpoints = ["my-server"]
parent = "master"
}

请注意,我添加了vars.agent_endpoint.

在服务上应用了以下内容disk:

apply Service "disk" {
  check_command = "disk"

  // Check is executed on the remote command endpoint
  command_endpoint = host.vars.agent_endpoint
  zone = host.vars.agent_endpoint
  assign where host.vars.agent_endpoint
}

host.vars.disks这是在 services.conf 配置文件中检查的定义:

apply Service for (disk => config in host.vars.disks) {
  import "generic-service" 
  check_command = "disk"
  vars += config
}

但它仍会检查父节点中的可用空间并显示该结果。

我可能错过了配置中的某些内容,我不知道是什么

关于这个问题的任何想法将不胜感激。

谢谢!

system-monitoring icinga2 icinga
  • 1 个回答
  • 809 Views
Martin Hope
ufk
Asked: 2020-04-23 00:16:52 +0800 CST

让代理节点显示在 icingaweb2 的主节点上

  • 0

我在主节点上安装了 icinga2 和 icingaweb2 我在另外 3 个服务器上安装了 icinga2 作为代理节点。我使用icinga2 node wizard,将它们配置为代理并允许它们连接到主节点。我没有看到任何错误消息,看起来它们已成功连接。

为了让它们在主节点中可见,还需要做些什么吗?

icingaweb2 界面只显示了主节点,其余的都没有显示。

我按照此处的说明配置了代理:https ://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/#agentsatellite-setup

我打开了从主机到代理以及从代理到主机的端口 5665。

在 master 中签署证书后,我将在所有节点的 master 日志中收到以下内容

information/ApiListener: New client connection for identity 'NODE_NAME' from [145.239.141.102]:47518 (no Endpoint object found for identity)

我假设我不需要在父节点中手动添加配置.. 但由于我收到此错误,我为每个代理节点添加了以下内容:

object Zone "<HOST-NAME>" {
        endpoints = ["<HOST-NAME>"]
    parent = "master"
}

object Endpoint "<HOST-NAME>" {
        host = "<HOST-NAME>"
}

所以我为所有 3 台带有代理的服务器添加了这个,现在我没有看到任何错误,但它们仍然没有出现在 icingaweb2 界面中。

这是我在 master 上重新启动 icinga2 时的 icinga2 日志:

[2020-04-22 08:12:39 +0000] information/FileLogger: 'main-log' started.
[2020-04-22 08:12:39 +0000] information/ApiListener: 'api' started.
[2020-04-22 08:12:39 +0000] information/ApiListener: Started new listener on '[0.0.0.0]:5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: Reconnecting to endpoint 'AGENT-HOST-03' via host 'AGENT-HOST-03' and port '5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: Reconnecting to endpoint 'AGENT-HOST-02' via host 'AGENT-HOST-02' and port '5665'
[2020-04-22 08:12:39 +0000] information/DbConnection: 'ido-pgsql' started.
[2020-04-22 08:12:39 +0000] information/ApiListener: Reconnecting to endpoint 'AGENT-HOST-01' via host 'AGENT-HOST-01' and port '5665'
[2020-04-22 08:12:39 +0000] information/NotificationComponent: 'notification' started.
[2020-04-22 08:12:39 +0000] information/CheckerComponent: 'checker' started.
[2020-04-22 08:12:39 +0000] information/ConfigItem: Activated all objects.
[2020-04-22 08:12:39 +0000] information/IdoPgsqlConnection: 'ido-pgsql' resumed.
[2020-04-22 08:12:39 +0000] information/DbConnection: Resuming IDO connection: ido-pgsql
[2020-04-22 08:12:39 +0000] information/IdoPgsqlConnection: PGSQL IDO instance id: 1 (schema version: '1.14.3')
[2020-04-22 08:12:39 +0000] information/ApiListener: New client connection for identity 'AGENT-HOST-02' to [51.178.76.91]:5665
[2020-04-22 08:12:39 +0000] information/ApiListener: New client connection for identity 'AGENT-HOST-01' to [51.178.91.176]:5665
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending config updates for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending config updates for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending config file updates for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending config file updates for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Syncing runtime objects to endpoint 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Syncing runtime objects to endpoint 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing runtime objects to endpoint 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending runtime config updates for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending replay log for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing runtime objects to endpoint 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending runtime config updates for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending replay log for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending replay log for endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing endpoint 'AGENT-HOST-01' in zone 'AGENT-HOST-01'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished reconnecting to endpoint 'AGENT-HOST-01' via host 'AGENT-HOST-01' and port '5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending replay log for endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing endpoint 'AGENT-HOST-02' in zone 'AGENT-HOST-02'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished reconnecting to endpoint 'AGENT-HOST-02' via host 'AGENT-HOST-02' and port '5665'
[2020-04-22 08:12:39 +0000] information/ApiListener: New client connection for identity 'AGENT-HOST-03' to [145.239.141.102]:5665
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending config updates for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending config file updates for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Syncing runtime objects to endpoint 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing runtime objects to endpoint 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending runtime config updates for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Sending replay log for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished sending replay log for endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished syncing endpoint 'AGENT-HOST-03' in zone 'AGENT-HOST-03'.
[2020-04-22 08:12:39 +0000] information/ApiListener: Finished reconnecting to endpoint 'AGENT-HOST-03' via host 'AGENT-HOST-03' and port '5665'
[2020-04-22 08:12:39 +0000] information/IdoPgsqlConnection: Finished reconnecting to 'ido-pgsql' database 'icinga2' in 0.0555351 second(s).
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: Received certificate request for CN 'AGENT-HOST-01' signed by our CA.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: The certificate for CN 'AGENT-HOST-01' is valid and uptodate. Skipping automated renewal.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: Received certificate request for CN 'AGENT-HOST-02' signed by our CA.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: The certificate for CN 'AGENT-HOST-02' is valid and uptodate. Skipping automated renewal.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: Received certificate request for CN 'AGENT-HOST-03' signed by our CA.
[2020-04-22 08:12:39 +0000] information/JsonRpcConnection: The certificate for CN 'AGENT-HOST-03' is valid and uptodate. Skipping automated renewal.
[2020-04-22 08:12:49 +0000] information/WorkQueue: #5 (ApiListener, RelayQueue) items: 0, rate: 0.233333/s (14/min 14/5min 14/15min);
[2020-04-22 08:12:49 +0000] information/WorkQueue: #6 (ApiListener, SyncQueue) items: 0, rate:  0/s (0/min 0/5min 0/15min);
[2020-04-22 08:12:49 +0000] information/WorkQueue: #7 (IdoPgsqlConnection, ido-pgsql) items: 0, rate: 0.25/s (15/min 15/5min 15/15min);

任何有关此问题的信息将不胜感激。

monitoring icinga2 icinga
  • 1 个回答
  • 339 Views
Martin Hope
JustAGuy
Asked: 2020-03-13 07:11:31 +0800 CST

远程 Icinga 实例“xxx”未连接到“zzzz”

  • 0

我安装了 Icinga2,包括 Director。我已经添加了一个模板、服务和一个 Windows,在主机上安装了一个代理,但是我必须缺少一些东西。

我不断得到

“远程 Icinga 实例 'xxx' 未连接到 'zzz'”

,尽管通信非常好(相同的子网,没有防火墙,通过端口 5665 上的 telnet 验证了通信)。

这是 WEB GUI 的屏幕截图:

在此处输入图像描述

icinga2 icinga
  • 1 个回答
  • 1736 Views
Martin Hope
marxin
Asked: 2018-11-11 06:33:19 +0800 CST

无法通过网络向导完成 icinga2 设置

  • 0

我一直在我的 openSUSE Tumbleweed 系统上安装 Icinga2 并使用以下软件包版本:

  • icinga2-2.10.1-2.1.x86_64
  • php7-7.2.11-1.3.src

我被困在设置向导的以下网站上: 在此处输入图像描述

当我单击下一步按钮时,没有任何动作。我检查了浏览器的网络和控制台,没有错误。同样在不同的浏览器中。

icinga2
  • 2 个回答
  • 58 Views
Martin Hope
MUY Belgium
Asked: 2017-11-18 06:39:25 +0800 CST

如何让 icinga 计划成为每晚的主动检查?

  • 1

我要在服务器上进行测试,这需要一些时间。我希望在每天晚上 3 点到 5 点之间安排测试。

此外,用户可以在白天启动测试。

Icinga2可以吗?

icinga2
  • 1 个回答
  • 1451 Views
Martin Hope
pyansharp
Asked: 2017-09-04 08:43:27 +0800 CST

Icingaweb2 mysql-ido 设置警告:可以安全进行吗?

  • 1

我正在测试运行 Icinga2 作为我商店的 Nagios 系统的替代品,但像许多其他人一样,我在设置 web ui 时遇到了一些麻烦。

它在数据库设置中,如果您正在运行 Debian Stretch,这似乎特别麻烦,因为 Stretch 会阻止 ui 为您构建数据库。这意味着有必要预先配置数据库,然后将该数据库的信息提供给 web ui。按照 Icinga 自己的说明,我这样做了(当然,一定要导入架构),然后单击“验证”,我得到了可怕的

There is currently no icinga instance writing to the IDO. Make sure that a icinga instance is configured and able to write to the IDO.

它是橙色的,而不是红色的,所以我想这不是致命错误。但是,由于这是针对生产环境的,所以我需要知道跳过验证和继续是否会成为以后的问题。Icinga 自己关于 ido-mysql 的文档不是很及时。

我发现目前没有写入 IDO 的 icinga 实例并重复了这些步骤,但它对错误没有影响。这发生在 Debian Stretch 的两个不同的全新安装(这让我想为这个项目切换到 CentOS7)没有任何区别。

icinga2
  • 1 个回答
  • 917 Views
Martin Hope
mr.zog
Asked: 2017-08-04 14:12:36 +0800 CST

在 Icingaweb2 的“当前事件”仪表板中隐藏“最近恢复的服务”

  • 0

我们只想看到默认仪表板中的关键问题和警告。我们不在乎看到最近恢复了什么。我需要为这种事情安装 Dashing 吗?

icinga2
  • 1 个回答
  • 166 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve