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
import "influxdata/influxdb/secrets"
import "contrib/sranka/sensu"
lastReported =
from(bucket: "example-bucket")
|> range(start: -1m)
|> last()
|> findRecord(fn: (key) => true, idx: 0)
sensu.event(
url: "http://localhost:8080",
apiKey: apiKey,
checkName: "diskUsage",
)
Package author and maintainer
Github: @sranka
InfluxDB Slack: