适用于OnPrem的GCP堆栈驱动程序

时间:2018-12-20 14:21:41

标签: google-cloud-platform nagios stackdriver

基于Stackdriver,出于工作流程的原因,我想向我的Centreon监控器(位于Nagios后面)发送通知,您对此有任何想法吗? 谢谢

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:1)

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

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

资源具有一定数量的“插槽”,将在这些插槽上分配(存储)警报。尽管没有人为因素考虑到此事件,但该事件仍将在Centreon Web前端中可见。确认事件后,该插槽将可用于新事件。

该事件必须通过SNMP陷阱传输到服务器。

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

第二,Centreon开发人员添加了Centreon REST API ,您可以使用该API向监视引擎提交信息。 此功能比SNMP陷阱方法更易于使用。 在这种情况下,您必须在使用任何API之前先创建主机/服务对象。

要发送状态,请通过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还允许获取主机,服务的实时状态并进行对象配置。

相关问题