文档文档

ServiceNow 指标输出数据格式

nowmetric 输出数据格式(序列化器)将 Telegraf 指标输出为 ServiceNow Operational Intelligence 格式

它可以通过 File 输出插件用于写入文件,或者用于使用标准 telegraf HTTP 输出将指标发送到启用了 REST 端点的 MID Server。如果您正在使用 HTTP 输出插件,则此序列化器知道如何批量处理指标,因此您不会最终为每个指标都进行 HTTP POST。

事件示例看起来像

[{
    "metric_type": "Disk C: % Free Space",
    "resource": "C:\\",
    "node": "lnux100",
    "value": 50,
    "timestamp": 1473183012000,
    "ci2metric_id": {
        "node": "lnux100"
    },
    "source": Telegraf
}]

与 HTTP 输出插件一起使用

要将此数据发送到启用了 Web Server 扩展的 ServiceNow MID Server,您可以使用 HTTP 输出插件,您需要添加一些自定义标头来管理 MID Web Server 授权,这是一个 HTTP 输出的示例配置

[[outputs.http]]
  ## URL is the address to send metrics to
  url = "http://<mid server fqdn or ip address>:9082/api/mid/sa/metrics"

  ## Timeout for HTTP message
  # timeout = "5s"

  ## HTTP method, one of: "POST" or "PUT"
  method = "POST"

  ## HTTP Basic Auth credentials
  username = 'evt.integration'
  password = 'P@$$w0rd!'

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

  ## Data format to output.
  ## Each data format has it's own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
  data_format = "nowmetric"

  ## Additional HTTP headers
  [outputs.http.headers]
  #   # Should be set manually to "application/json" for json data_format
  Content-Type = "application/json"
  Accept = "application/json"

从 London 版本开始,您还需要显式创建事件规则,以允许将指标事件绑定到主机 CI。

https://docs.servicenow.com/bundle/london-it-operations-management/page/product/event-management/task/event-rule-bind-metrics-to-host.html

与 File 输出插件一起使用

您可以使用 File 输出插件将有效负载输出到文件中。在这种情况下,只需将以下部分添加到您的 telegraf 配置文件中。

[[outputs.file]]
  ## Files to write to, "stdout" is a specially handled file.
  files = ["C:/Telegraf/metrics.out"]

  ## Data format to output.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
  data_format = "nowmetric"

此页内容是否对您有帮助?

感谢您的反馈!


Flux 的未来

Flux 将进入维护模式。您可以继续像当前一样使用它,而无需对您的代码进行任何更改。

阅读更多

现已全面上市

InfluxDB 3 Core 和 Enterprise

快速启动。更快扩展。

获取更新

InfluxDB 3 Core 是一个开源、高速、近实时数据引擎,可实时收集和处理数据,并将其持久化到本地磁盘或对象存储。InfluxDB 3 Enterprise 构建在 Core 的基础上,增加了高可用性、读取副本、增强的安全性以及数据压缩功能,以实现更快的查询和优化的存储。InfluxDB 3 Enterprise 的免费层级可供非商业家庭或业余爱好者使用。

有关更多信息,请查看