【问题标题】:GCP stackdriver fo OnPremGCP 堆栈驱动程序到 On Prem
【发布时间】:2018-12-20 14:21:41
【问题描述】:

基于 Stackdriver,出于工作流程的原因,我想向我的 Centreon 监控(在 Nagios 后面)发送通知,您知道如何操作吗? 谢谢

【问题讨论】:

    标签: google-cloud-platform nagios stackdriver


    【解决方案1】:

    Stackdriver 警报允许webhook notifications,因此您可以运行服务器将通知转发到您需要的任何地方(包括 Centreon),并将 Stackdriver 警报通知通道指向该服务器。

    【讨论】:

      【解决方案2】:

      在没有传统被动代理模式的情况下,有两种方法可以在 Centreon 队列中发送外部信息。

      首先,您可以使用 Centreon DSM(动态服务管理)插件。 这很有趣,因为您不必在配置中注册专用且已知的服务来匹配通知。 借助 Centreon DSM,Centreon 可以接收事件,例如由于检测到问题而产生的 SNMP 陷阱,并将事件动态分配到 Centreon 中定义的插槽,例如托盘事件。

      资源具有一定数量的“槽”,将在这些“槽”上分配(存储)警报。虽然此事件尚未被人类行为考虑在内,但它将在 Centreon 网络前端中保持可见。确认事件后,该插槽可用于新事件。

      事件必须通过 SNMP Trap 传输到服务器。

      所有配置都是在模块安装后通过Centreon Web界面进行的。 在线文档中描述了完整的解释、屏幕截图和提示:https://documentation.centreon.com/docs/centreon-dsm/en/latest/user.html

      其次,Centreon 开发人员添加了一个 Centreon REST API,您可以使用它向监控引擎提交信息。 此功能比 SNMP Trap 方式更易于使用。 在这种情况下,您必须在使用任何 API 之前创建主机/服务对象。

      要发送状态,请使用以下 URL 使用 POST 方法:

      api.domain.tld/centreon/api/index.php?action=submit&object=centreon_submit_results
      

      标题

      key value
      
      Content-Type    application/json
      
      centreon-auth-token the value of authToken you got on the authentication response
      

      服务正文提交示例: 正文是 JSON 格式,上面提供的参数格式如下:

      {
        "results": [
          {
            "updatetime": "1528884076",
            "host": "Centreon-Central"
            "service": "Memory",
            "status": "2"
            "output": "The service is in CRITICAL state"
            "perfdata": "perf=20"
          },
          {
            "updatetime": "1528884076",
            "host": "Centreon-Central"
            "service": "fake-service",
            "status": "1"
            "output": "The service is in WARNING state"
            "perfdata": "perf=10"
          }
        ]
      }
      

      正文响应示例: :: 响应正文是带有 HTTP 返回码的 JSON,以及每次提交的消息:

      {
        "results": [
          {
            "code": 202,
            "message": "The status send to the engine"
          },
          {
            "code": 404,
            "message": "The service is not present."
          }
        ]
      }
      

      在线文档中提供了更多信息:https://documentation.centreon.com/docs/centreon/en/19.04/api/api_rest/index.html

      Centreon REST API 还允许获取主机、服务的实时状态并进行对象配置。

      【讨论】:

        猜你喜欢
        • 2020-08-13
        • 2017-06-09
        • 2021-11-11
        • 1970-01-01
        • 2019-07-04
        • 2018-03-14
        • 2020-05-13
        • 1970-01-01
        • 2021-05-10
        相关资源
        最近更新 更多