sensu.sensu_go.sensu_go_handler (0.9.0) — module

Manages Sensu handlers

| "added in version" 0.1.0 of sensu.sensu_go"

Authors: Paul Arthur (@flowerysong)

preview | supported by community

Install collection

Install with ansible-galaxy collection install sensu.sensu_go:==0.9.0


Add to requirements.yml

  collections:
    - name: sensu.sensu_go
      version: 0.9.0

Description

For more information, refer to the Sensu documentation: U(https://docs.sensu.io/sensu-go/latest/reference/handlers/)

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Setup InfluxDB handler
  sensu_go_handler:
    name: influx-db
    type: pipe
    command: sensu-influxdb-handler -d sensu
    env_vars:
      INFLUXDB_ADDR: http://influxdb.default.svc.cluster.local:8086
      INFLUXDB_USER: sensu
      INFLUXDB_PASS: password
    runtime_assets:
      - sensu-influxdb-handler

Inputs

    
auth:
    description:
    - Authentication parameters. Can define each of them with ENV as well.
    suboptions:
      namespace:
        default: default
        description:
        - RBAC namespace to operate in. If this is not set the value of the SENSU_NAMESPACE
          environment variable will be checked.
        type: str
      password:
        default: P@ssw0rd!
        description:
        - The Sensu user's password. If this is not set the value of the SENSU_PASSWORD
          environment variable will be checked.
        type: str
      url:
        default: http://localhost:8080
        description:
        - Location of the Sensu backend API. If this is not set the value of the SENSU_URL
          environment variable will be checked.
        type: str
      user:
        default: admin
        description:
        - The username to use for connecting to the Sensu API. If this is not set the
          value of the SENSU_USER environment variable will be checked.
        type: str
    type: dict

name:
    description:
    - The Sensu object's name.
    required: true
    type: str

type:
    choices:
    - pipe
    - tcp
    - udp
    - set
    default: pipe
    description:
    - Handler type.
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Target state of the Sensu object.
    type: str

labels:
    description:
    - Custom metadata fields that can be accessed within Sensu, as key/value pairs.
    type: dict

command:
    description:
    - Command to C(pipe) the check result data into.
    type: str

filters:
    description:
    - List of filters to use when determining whether to pass the check result to this
      handler.
    type: list

mutator:
    description:
    - Mutator to call for transforming the check result before passing it to this handler.
    type: str

timeout:
    default: 60
    description:
    - Timeout for handler execution
    type: int

env_vars:
    description:
    - A mapping of environment variable names and values to use with command execution.
    type: dict

handlers:
    description:
    - List of handlers that comprise this C(set)
    type: list

annotations:
    description:
    - Custom metadata fields with fewer restrictions, as key/value pairs.
    - These are preserved by Sensu but not accessible as tokens or identifiers, and are
      mainly intended for use with external tools.
    type: dict

socket_host:
    description:
    - Hostname to connect to for C(tcp) or C(udp)
    type: str

socket_port:
    description:
    - Port to connect to for C(tcp) or C(udp)
    type: str

runtime_assets:
    default: []
    description:
    - List of runtime assets to required to run the handler C(command)
    type: list