Documentation

zenoss.event() function

Flux 0.108.0+

The zenoss.event() function is a user-contributed function maintained by the package author and can be updated or removed at any time.

The zenoss.event() function sends an event to Zenoss.

import "contrib/bonitoo-io/zenoss"

zenoss.event(
  url: "https://example.zenoss.io:8080/zport/dmd/evconsole_router",
  username: "example-user",
  password: "example-password",
  action: "EventsRouter",
  method: "add_event",
  type: "rpc",
  tid: 1,
  summary: "",
  device: "",
  component: "",
  severity: "Critical",
  eventClass: "",
  eventClassKey: "",
  collector: "",
  message: ""
)

Parameters

url

(Required) Zenoss router endpoint URL.

username

(Required) Zenoss username to use for HTTP BASIC authentication. Default is "" (no authentication).

password

(Required) Zenoss password to use for HTTP BASIC authentication. Default is "" (no authentication).

action

Zenoss router name. Default is "EventsRouter".

method

EventsRouter method. Default is "add_event".

type

Event type. Default is "rpc".

tid

Temporary request transaction ID. Default is 1.

summary

Event summary. Default is "".

device

Related device. Default is "".

component

Related component. Default is "".

severity

(Required) Event severity level.

Supported values:

  • Critical
  • Warning
  • Info
  • Clear

eventClass

Event class. Default is "".

eventClassKey

Event class key. Default is "".

collector

Zenoss collector. Default is "".

message

Related message. Default is "".

Examples

Send the last reported value and severity to Zenoss
import "contrib/bonitoo-io/zenoss"
import "influxdata/influxdb/secrets"

username = secrets.get(key: "ZENOSS_USERNAME")
password = secrets.get(key: "ZENOSS_PASSWORD")

lastReported =
  from(bucket: "example-bucket")
    |> range(start: -1m)
    |> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_idle")
    |> last()
    |> findRecord(fn: (key) => true, idx: 0)

zenoss.event(
    url: "https://tenant.zenoss.io:8080/zport/dmd/evconsole_router",
    username: username,
    username: password,
    device: lastReported.host,
    component: "CPU",
    eventClass: "/App",
    severity:
      if lastReported._value < 1.0 then "Critical"
      else if lastReported._value < 5.0 then "Warning"
      else if lastReported._value < 20.0 then "Info"
      else "Clear"
)

Package author and maintainer

Github: @alespour, @bonitoo-io
InfluxDB Slack: @Ales Pour


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.