sensu.sensu_go.socket_handler (0.7.2) — module

Manages Sensu TCP/UDP handler

Authors: Aljaz Kosir (@aljazkosir), Miha Plesko (@miha-plesko), Tadej Borovsak (@tadeboro)

preview | supported by XLAB Steampunk

Install collection

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


Add to requirements.yml

  collections:
    - name: sensu.sensu_go
      version: 0.7.2

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: TCP handler
  socket_handler:
    name: tcp_handler
    type: tcp
    host: 10.0.1.99
    port: 4444
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: UDP handler
  socket_handler:
    name: udp_handler
    type: udp
    host: 10.0.1.99
    port: 4444

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

host:
    description:
    - The socket host address (IP or hostname) to connect to.
    required: true
    type: str

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

port:
    description:
    - The socket port to connect to.
    required: true
    type: int

type:
    choices:
    - tcp
    - udp
    description:
    - The handler type.
    required: true
    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

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:
    description:
    - Timeout for handler execution
    type: int

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

Outputs

object:
  description: object representing Sensu socket handler
  returned: success
  type: dict