Resource Type: sensu_handler
Summary
Manages Sensu handlersOverview
Autorequires:
Package[sensu-go-cli]
Service[sensu-backend]
Sensuctl_configure[puppet]
Sensu_api_validator[sensu]
Sensu_user[admin]
sensu_namespace
- Puppet will autorequiresensu_namespace
resource defined innamespace
property.sensu_filter
- Puppet will autorequiresensu_filter
resources defined infilters
property.sensu_mutator
- Puppet will autorequiresensu_mutator
resource defined formutator
property.sensu_handler
- Puppet will autorequiresensu_handler
resources defined forhandlers
property.sensu_asset
- Puppet will autorequiresensu_asset
resources defined inruntime_assets
property.
Examples:
Create a handler
sensu_handler { 'test':
ensure => 'present',
type => 'pipe',
command => 'notify.rb'
}
Create a handler with namespace dev
in the name
sensu_handler { 'test in dev':
ensure => 'present',
type => 'pipe',
command => 'notify.rb'
}
Properties
-
annotations
Arbitrary, non-identifying metadata to include with event data.
-
command
The handler command to be executed.
Supported values:- /.*/
- absent
-
ensure
(defaults to: present)
The basic property that the resource should be in.
Supported values:- present
- absent
-
env_vars
An array of environment variables to use with command execution.
Supported values:- /.*/
- absent
-
filters
An array of Sensu event filters (names) to use when filtering events for the handler.
Supported values:- /.*/
- absent
-
handlers
An array of Sensu event handlers (names) to use for events using the handler set.
Supported values:- /.*/
- absent
-
labels
Custom attributes to include with event data, which can be queried like regular attributes.
-
mutator
The Sensu event mutator (name) to use to mutate event data for the handler.
Supported values:- /.*/
- absent
-
namespace
(defaults to: default)
The Sensu RBAC namespace that this handler belongs to.
-
runtime_assets
An array of Sensu assets (names), required at runtime for the execution of the command
Supported values:- /.*/
- absent
-
secrets
Array of the name/secret pairs to use with command execution. Example: [{'name' => 'ANSIBLE_HOST', 'secret' => 'sensu-ansible-host' }]
-
socket
The socket definition scope, used to configure the TCP/UDP handler socket.
Valid keys:
- host - Required - The socket host address (IP or hostname) to connect to.
- port - Required - The socket port to connect to.
-
timeout
The handler execution duration timeout in seconds (hard stop)
Supported values:- /^[0-9]+$/
- absent
-
type
The handler type.
Supported values:- pipe
- tcp
- udp
- set
Parameters
-
name (namevar)
The name of the handler. The name supports composite names that can define the namespace. An example composite name to define resource named
test
in namespacedev
:test in dev
-
provider
The specific backend to use for this
sensu_handler
resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform. -
resource_name
The name of the handler.