sensu.event() function

    The sensu.event() function sends a single event to the Sensu Events API.

    *Function type: Output*

    Required Base URL of without a trailing slash. Example: http://localhost:8080.

    *Data type: String*

    apiKey

    Required Sensu .

    *Data type: String*

    checkName

    *Data type: String*

    Required Event text. Mapped to output in the Sensu Events API request.

    *Data type: String*

    handlers

    Sensu handlers to execute. Default is [].

    *Data type: Array of strings*

    status

    Event status code that indicates state. Default is 0.

    Event state. Default is "passing" for and "failing" for other statuses.

    *Data type: string*

    The following values are accepted:

    • "failing"
    • "passing"
    • "flapping"

    namespace

    . Default is "default".

    *Data type: String*

    entityName

    Event source. Use alphanumeric characters, underscores (_), periods (.), and hyphens (-). All other characters are replaced with an underscore. Default is influxdb.

    Examples

    Send the last reported status to Sensu
    1. import "influxdata/influxdb/secrets"
    2. import "contrib/sranka/sensu"
    3. lastReported =
    4. from(bucket: "example-bucket")
    5. |> range(start: -1m)
    6. |> last()
    7. |> findRecord(fn: (key) => true, idx: 0)
    8. sensu.event(
    9. url: "http://localhost:8080",
    10. apiKey: apiKey,
    11. checkName: "diskUsage",
    12. )

    Package author and maintainer

    Github: @sranka
    InfluxDB Slack:

    Related articles