- Module Description
- Setup - The basics of getting started with Sensu
- Usage - Configuration options and additional functionality
- Location of Resources
- Basic Sensu backend
- Basic Sensu agent
- Basic Sensu CLI
- API Providers
- Manage Windows Agent
- Advanced agent
- Advanced agent - Subscriptions
- Advanced agent - Annotations and Labels
- Advanced agent - Custom config entries
- Advanced SSL
- Enterprise support
- Contact routing
- PostgreSQL datastore support
- Exported resources
- Hiera resources
- Resource purging
- Sensu backend cluster
- Sensu backend federation
- Large Environment Considerations
- Composite Names for Namespaces
- Installing Plugins
- Installing Extensions
- Installing Bonsai Assets
- Bolt Tasks
- Reference
- Examples
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- License
Installs and manages Sensu Go, the open source monitoring framework.
This is a Partner Supported module. Puppet does not provide support; Sensu does at https://sensu.io/support.
This module supports Sensu Go 6.x (6.1+). Please log an issue if you identify any incompatibilities.
| Sensu Go Version | Recommended Puppet Module Version |
|---|---|
| 6.0 | v5.0.0 |
| 6.1+ | v5.1.0+ |
For older Sensu Go 5.x use module v3/v4. For Sensu Classic use sensu/sensuclassic.
Beginning with Sensu Go 6, changes to agent.yml only bootstrap an agent entity — they do not update it after first registration. To change subscriptions, labels, or annotations after a host is added, the agent must make API calls.
For agents to make API calls, configure the admin password and API host:
class { 'sensu':
api_host => 'sensu-backend.example.com',
agent_entity_config_password => 'supersecret',
}
class { 'sensu::agent':
...
}
See API Providers for Hiera configuration that can share the admin password with agents.
This module continues to write subscriptions and other agent config to agent.yml so that if an agent entity is deleted, restarting sensu-agent recreates it.
Beginning with Sensu Go 6.2.0 you can make agent.yml the authoritative source for an agent's config by setting sensu::agent::agent_managed_entity to true.
This module will install packages, create configuration and start services necessary to manage Sensu agents and backend.
This module supports Puppet 8 with Ruby 3.x:
| Puppet Version | Required Ruby Version | Support Status |
|---|---|---|
| Puppet 8.x | Ruby 3.4.x | ✅ Supported |
| Puppet 7.x | Ruby 3.1.x | ❌ EOL (Feb 2025) |
| Puppet 6.x | Ruby 2.5.x - 2.7.x | ❌ EOL (Removed) |
Note: Perforce stopped publishing Puppet packages at 8.10.0. Migration to OpenVox (community Puppet 8 fork by Vox Pupuli) is a viable future path.
Plugin sync is required if the custom sensu types and providers are used.
For systems using apt:
- puppetlabs/apt module (
>= 5.0.1 < 9.0.0)
For systems using yum and Puppet >= 8.0.0:
- puppetlabs/yumrepo_core module (
>= 1.0.1 < 2.0.0)
For Windows:
- puppetlabs/chocolatey module (
>= 3.0.0 < 7.0.0) - puppet/windows_env module (
>= 3.0.0 < 5.0.0) - puppet/archive module (
>= 3.0.0 < 5.0.0)
This module provides Vagrant definitions that can be used to get started with Sensu.
vagrant up sensu-backend
vagrant ssh sensu-backendMultiple Vagrant boxes are available for testing a sensu-backend cluster.
vagrant up sensu-backend-peer1 sensu-backend-peer2
vagrant provision sensu-backend-peer1 sensu-backend-peer2Multiple Vagrant boxes are available for testing a Sensu Go federated cluster. First build and provision both then provision the first a second time to view that the custom role was replicated.
vagrant up sensu-backend-federated1 sensu-backend-federated2
vagrant provision sensu-backend-federated1
The provision command should output from sensuctl the test Sensu Go Role that was created on the other backend.
The output should look like the following:
sensu-backend-federated1: Name Namespace Rules
sensu-backend-federated1: ────── ─────────── ───────
sensu-backend-federated1: test default 1
Sensu Go is designed to have resources like checks and assets defined on the backend host.
For Puppet this means that the simplest configuration will be one where checks and other resources are defined on the host using sensu::backend class.
Hosts with only the sensu::agent class do not need to have checks defined on them, rather just have to have a subscription assigned that matches a check.
Configures sensu-backend, sensu-agent, and a check. The backend uses Puppet's SSL certificate and CA by default. Do not use the default password.
NOTE When changing the password, run Puppet on the backend first.
class { 'sensu':
password => 'supersecret',
}
include sensu::backend
include sensu::agent
sensu_check { 'check-cpu':
ensure => 'present',
command => 'check-cpu.sh -w 75 -c 90',
interval => 60,
subscriptions => ['linux'],
}Configure a sensu-agent with linux and apache-servers subscriptions:
class { 'sensu':
api_host => 'sensu-backend.example.com',
agent_entity_config_password => 'supersecret',
}
class { 'sensu::agent':
backends => ['sensu-backend.example.com:8081'],
subscriptions => ['linux', 'apache-servers'],
}Configure sensuctl:
class { 'sensu':
api_host => 'sensu-backend.example.com',
password => 'supersecret',
}
include sensu::cliNOTE: The sensu::backend class calls the sensu::cli class so it is only necessary to directly call the sensu::cli class on hosts not using the sensu::backend class.
For Windows the install_source parameter must be provided:
class { 'sensu':
api_host => 'sensu-backend.example.com',
password => 'supersecret',
}
class { 'sensu::cli':
install_source => 'https://s3-us-west-2.amazonaws.com/sensu.io/sensu-go/X.Y.Z/sensu-go_X.Y.Z_windows_amd64.zip',
}All the core resources have a provider that manages resources using the Sensu Go API.
The new provider can be used by setting provider parameter on a resource to sensu_api.
The default provider is sensuctl; set provider => 'sensu_api' on any resource to use the API instead. The check below can be defined on a host that is not the sensu-backend:
include ::sensu::api
sensu_check { "check-cpu-${facts['hostname']}":
ensure => 'present',
command => 'check-cpu.sh -w 75 -c 90',
interval => 60,
subscriptions => ["entity:${facts['hostname']}"],
provider => 'sensu_api',
}
The sensu::api class configures credentials and URL for the Sensu backend API.
Set the API URL, username, and password in the sensu class or via Hiera:
sensu::api_host: sensu-backend.example.com
sensu::api_port: 8080
sensu::username: admin
sensu::password: supersecret
sensu::agent_entity_config_password: supersecretThis module supports Windows Sensu Go agent via chocolatey beginning with version 5.12.0.
class { 'sensu':
api_host => 'sensu-backend.example.com',
agent_entity_config_password => 'supersecret',
}
class { 'sensu::agent':
backends => ['sensu-backend.example.com:8081'],
subscriptions => ['windows'],
}Without chocolatey, set package_source to a URL, Puppet source, or filesystem path.
Install sensu-go-agent on Windows from URL:
class { 'sensu::agent':
package_name => 'Sensu Agent',
package_source => 'https://s3-us-west-2.amazonaws.com/sensu.io/sensu-go/X.Y.Z/sensu-go-agent_X.Y.Z_en-US.x64.msi',
}Install sensu-go-agent on Windows from Puppet source:
class { 'sensu::agent':
package_name => 'Sensu Agent',
package_source => 'puppet:///modules/profile/sensu/sensu-go-agent.msi',
}Install from a local MSI path:
class { 'sensu::agent':
package_name => 'Sensu Agent',
package_source => 'C:\Temp\sensu-go-agent.msi',
}To make agent.yml authoritative for agent entity configs:
class { 'sensu::agent':
agent_managed_entity => true,
}To change the agent password, provide both old and new passwords. Set show_diff => false to avoid exposing the password.
class { 'sensu':
agent_password => 'supersecret',
}
class { 'sensu::agent':
show_diff => false,
}Use config_hash for agent.yml keys not covered by sensu::agent parameters.
class { 'sensu::agent':
config_hash => {
'log-level' => 'debug',
},
}The following parameters in sensu::agent class are used to populate agent.yml:
- entity_name - Passed to
namekey inagent.yml - subscriptions
- annotations
- labels
- namespace
- redact
Agent configurations can also be set via sensu::agent::config_entry. See Advanced agent - Custom config entries.
Subscriptions can be defined in multiple places; they are merged into agent.yml:
class { 'sensu::agent':
subscriptions => ['base'],
}
In an Apache profile class:
sensu::agent::subscription { 'apache': }
The resulting agent.yml would contain subscriptions for both base and apache.
NOTE: Subscriptions defined using the sensu::agent class and sensu::agent::subscription are merged to produce the final subscription array.
Annotations and labels can be defined in multiple places; they are merged into agent.yml:
class { 'sensu::agent':
labels => { 'location' => 'uswest', 'contacts' => 'ops@example.com' },
annotations => { 'cpu.warning' => '90', 'cpu.critical' => '100' },
}In a profile class:
sensu::agent::label { 'contacts': value => 'devs@example.com' }
sensu::agent::label { 'environment': value => 'dev' }
sensu::agent::annotation { 'cpu.warning': value => '75' }
sensu::agent::annotation { 'fatigue_check/occurrences': value => '2' }The resulting agent.yml will contain the following:
labels:
location: uswest
contacts: devs@example.com
environment: dev
annotations:
cpu.warning: '75'
cpu.critical: '100'
fatigue_check/occurrences: '2'NOTE sensu::agent::annotation and sensu::agent::label take precedence over values set by the class sensu::agent
To redact a label or annotation, set redact => true; the key is added to agent.yml's redact list:
sensu::agent::label { 'secret':
value => 'mysecret',
redact => true,
}
sensu::agent::annotation { 'ec2_access_key':
value => 'some-key',
redact => true,
}In some cases it might be desired to disable API and entity validations when agents are managing their own entity.
class { 'sensu':
validate_api => false,
}
class { 'sensu::agent':
agent_managed_entity => true,
validate_entity => false,
}Define agent.yml config entries from multiple locations:
sensu::agent::config_entry { 'keepalive-interval': value => 20 }This would add the following to agent.yml:
keepalive-interval: 20NOTE sensu::agent::config_entry takes precendence over values defined in sensu::agent class.
By default, this module uses Puppet's SSL certificates and CA. To use different certificates, override ssl_ca_source, ssl_cert_source, and ssl_key_source. api_host must match the certificate CN, and agent backends must match the backend's certificate. For already-installed certificates, use filesystem paths.
class { 'sensu':
ssl_ca_source => 'puppet:///modules/profile/sensu/ca.pem',
api_host => 'sensu-backend.example.com',
}
class { 'sensu::backend':
ssl_cert_source => 'puppet:///modules/profile/sensu/cert.pem',
ssl_key_source => 'puppet:///modules/profile/sensu/key.pem',
}class { 'sensu':
ssl_ca_source => 'puppet:///modules/profile/sensu/ca.pem',
}
class { 'sensu::agent':
backends => ['sensu-backend.example.com:8081'],
subscriptions => ['linux', 'apache-servers'],
}To disable SSL support:
class { 'sensu':
use_ssl => false,
}To activate enterprise support, add the license file:
class { 'sensu::backend':
license_source => 'puppet:///modules/profile/sensu/license.json',
}The types sensu_ad_auth and sensu_ldap_auth require a valid enterprise license.
See Sensu Go - Route alerts with event filters for background. Example Puppet configuration:
Add the sensu-go-has-contact-filter bonsai asset:
sensu_bonsai_asset { 'sensu/sensu-go-has-contact-filter':
ensure => 'present',
}Add the filters for the defined contacts
sensu_filter { 'contact_dev':
ensure => 'present',
action => 'allow',
runtime_assets => ['sensu/sensu-go-has-contact-filter'],
expressions => ['has_contact(event, "dev")'],
}
sensu_filter { 'contact_ops':
ensure => 'present',
action => 'allow',
runtime_assets => ['sensu/sensu-go-has-contact-filter'],
expressions => ['has_contact(event, "ops")'],
}Add the handlers asset and handlers for each contact
sensu_bonsai_asset { 'sensu/sensu-email-handler':
ensure => 'present',
}
sensu_handler { 'email_dev':
ensure => 'present',
type => 'pipe',
command => 'sensu-email-handler -f root@localhost -t dev@example.com -s localhost -i',
timeout => 10,
runtime_assets => ['sensu/sensu-email-handler'],
filters => ['is_incident','not_silenced','contact_dev'],
}
sensu_handler { 'email_ops':
ensure => 'present',
type => 'pipe',
command => 'sensu-email-handler -f root@localhost -t ops@example.com -s localhost -i',
timeout => 10,
runtime_assets => ['sensu/sensu-email-handler'],
filters => ['is_incident','not_silenced','contact_ops'],
}Create a handler set to centralize handler management for emails
sensu_handler { 'email':
ensure => 'present',
type => 'set',
handlers => ['email_dev','email_ops'],
}Lastly define a service that use the contact and the email handler:
sensu_check { 'check_cpu':
ensure => 'present',
labels => {
'contacts' => 'dev, ops',
},
command => 'check-cpu-usage --warning 75 --critical 90',
handlers => ['email'],
interval => 30,
publish => true,
subscriptions => ['linux'],
runtime_assets => ['sensu/check-cpu-usage'],
}Agents can also have contacts defined:
class { 'sensu::agent':
labels => {
'contacts' => 'dev, ops',
},
}NOTE: This features require a valid Sensu Go enterprise license.
Add a PostgreSQL server and database to the sensu-backend host:
class { 'postgresql::globals':
manage_package_repo => true,
version => '16',
}
class { 'postgresql::server': }
class { 'sensu::backend':
license_source => 'puppet:///modules/profile/sensu/license.json',
datastore => 'postgresql',
postgresql_password => 'secret',
}Refer to the puppetlabs/postgresql module documentation for details on how to manage PostgreSQL with Puppet.
The following example uses an external PostgreSQL server.
class { 'sensu::backend':
license_source => 'puppet:///modules/profile/sensu/license.json',
datastore => 'postgresql',
postgresql_password => 'secret',
postgresql_host => 'postgresql.example.com',
manage_postgresql_db => false,
}NOTE Set postgresql_password to false if you want the DSN to only contain a username.
One approach: agents export their checks via Exported Resources. Agent-side definition:
@@sensu_check { 'check-cpu':
ensure => 'present',
command => 'check-cpu.sh -w 75 -c 90',
interval => 60,
subscriptions => ['linux'],
}Backend collects them:
Sensu_check <<||>>All the types provided by this module can have their resources defined via Hiera. A type such as sensu_check would be defined via sensu::resources::checks.
The sensu class must be included either directly or via sensu::agent or sensu::backend.
Example Hiera configuration:
sensu::resources::bonsai_assets:
sensu/sensu-email-handler:
ensure: present
version: latest
sensu::resources::filters:
hourly:
ensure: present
action: allow
expressions:
- 'event.check.occurrences == 1 || event.check.occurrences % (3600 / event.check.interval) == 0'
sensu::resources::handlers:
email:
ensure: present
type: pipe
command: "sensu-email-handler -f root@localhost -t user@example.com -s localhost -i"
timeout: 10
runtime_assets:
- sensu/sensu-email-handler
filters:
- is_incident
- not_silenced
- hourly
sensu::resources::checks:
check-cpu:
ensure: present
command: check-cpu-usage --warning 75 --critical 90
interval: 60
subscriptions:
- linux
handlers:
- email
publish: true
runtime_assets:
- sensu/check-cpu-usage
check-disks:
ensure: present
command: "check-disk-usage --warning 85 --critical 95"
subscriptions:
- linux
handlers:
- email
interval: 1800
publish: true
runtime_assets:
- sensu/check-disk-usageAll the types provided by this module support purging except sensu_config:
sensu_resources { 'sensu_check':
purge => true,
}To selectively purge sensu_agent_entity_config entries, specify the config type. The following purges only subscriptions:
sensu_resources { 'sensu_agent_entity_config':
purge => true,
agent_entity_configs => ['subscriptions'],
}NOTE: The Puppet built-in resources can also be used for purging but you must ensure that resources that support namespaces are defined using composite names in the form of $name in $namespace. See Composite Names for Namespaces for details on composite names.
With the built-in resources type:
resources { 'sensu_check':
purge => true,
}A sensu-backend cluster can be defined for fresh installs by defining the necessary config_hash values.
The following examples are using Hiera and assume the sensu::backend class is included.
# data/fqdn/sensu-backend1.example.com.yaml
---
sensu::backend::config_hash:
etcd-advertise-client-urls: "http://%{facts.ipaddress}:2379"
etcd-listen-client-urls: "http://%{facts.ipaddress}:2379"
etcd-listen-peer-urls: 'http://0.0.0.0:2380'
etcd-initial-cluster: 'backend1=http://192.168.0.1:2380,backend2=http://192.168.0.2:2380'
etcd-initial-advertise-peer-urls: "http://%{facts.ipaddress}:2380"
etcd-initial-cluster-state: 'new'
etcd-initial-cluster-token: ''
etcd-name: 'backend1'# data/fqdn/sensu-backend2.example.com.yaml
---
sensu::backend::config_hash:
etcd-advertise-client-urls: "http://%{facts.ipaddress}:2379"
etcd-listen-client-urls: "http://%{facts.ipaddress}:2379"
etcd-listen-peer-urls: 'http://0.0.0.0:2380'
etcd-initial-cluster: 'backend1=http://192.168.0.1:2380,backend2=http://192.168.0.2:2380'
etcd-initial-advertise-peer-urls: "http://%{facts.ipaddress}:2380"
etcd-initial-cluster-state: 'new'
etcd-initial-cluster-token: ''
etcd-name: 'backend2'Adding new members to an existing cluster requires two steps.
First, add the member to the catalog on one of the existing cluster backends with the sensu_cluster_member type.
sensu_cluster_member { 'backend3':
peer_urls => ['http://192.168.0.3:2380'],
}Second, configure and start sensu-backend to interact with the existing cluster.
The output from Puppet when a new sensu_cluster_member is applied will print some of the values needed.
# data/fqdn/sensu-backend3.example.com.yaml
---
sensu::backend::config_hash:
etcd-advertise-client-urls: "http://%{facts.ipaddress}:2379"
etcd-listen-client-urls: "http://%{facts.ipaddress}:2379"
etcd-listen-peer-urls: 'http://0.0.0.0:2380'
etcd-initial-cluster: 'backend1=http://192.168.0.1:2380,backend2=http://192.168.0.2:2380,backend3=http://192.168.0.3:2380'
etcd-initial-advertise-peer-urls: "http://%{facts.ipaddress}:2380"
etcd-initial-cluster-state: 'existing'
etcd-initial-cluster-token: ''
etcd-name: 'backend3'This module supports Etcd replicators for replicating resources between Sensu clusters. Etcd must listen on an interface accessible to other Sensu backends. First configure backend Etcd to listen on a non-localhost interface with SSL:
class { 'sensu::backend':
config_hash => {
'etcd-listen-client-urls' => "https://0.0.0.0:2379",
'etcd-advertise-client-urls' => "https://0.0.0.0:2379",
'etcd-cert-file' => "/etc/sensu/etcd-ssl/${facts['fqdn'].pem",
'etcd-key-file' => "/etc/sensu/etcd-ssl/${facts['fqdn']}-key.pem",
'etcd-trusted-ca-file' => "/etc/sensu/etcd-ssl/ca.pem",
'etcd-client-cert-auth' => true,
},
}Next, configure the Etcd replicator on the source backend. The example below replicates all Role resources to 192.168.52.30:
sensu_etcd_replicator { 'role_replicator':
ensure => 'present',
ca_cert => '/etc/sensu/etcd-ssl/ca.pem',
cert => '/etc/sensu/etcd-ssl/client.pem',
key => '/etc/sensu/etcd-ssl/client-key.pem',
url => 'https://192.168.52.30:2379',
resource_name => 'Role',
}
sensu_role { 'test':
ensure => 'present',
rules => [{'verbs' => ['get','list'], 'resources' => ['checks'], 'resource_names' => ['']}],
}To define a federated cluster:
sensu_cluster_federation { 'us-west-2a':
ensure => 'present',
api_urls => [
'https://sensu-backend-site1.example.com:8080',
'https://sensu-backend-site2.example.com:8080',
],
}To add a backend to an existing federated cluster:
sensu_cluster_federation_member { 'https://sensu-backend-site3.example.com:8080 in us-west-2a':
ensure => 'present',
}Equivalently:
sensu_cluster_federation_member { 'https://sensu-backend-site3.example.com:8080':
ensure => 'present',
cluster => 'us-west-2a',
}For backends with many resources, set a chunk size:
class { 'sensu::backend':
sensuctl_chunk_size => 100,
}
With thousands of resources like sensu_check, each resource triggers a sensuctl namespace list call to validate the namespace (the sensu_api provider does the same). To eliminate this overhead when namespaces are managed outside Puppet, disable namespace validation:
NOTE: With namespace validation disabled, namespaces must be defined in Puppet to assign resources to them.
class { 'sensu':
validate_namespaces => false,
}All resources that support having a namespace also support a composite name to define the namespace.
For example, the sensu_check with name check-cpu in team1 would be named check-cpu and put into the team1 namespace.
Use composite names when the same resource name appears in multiple namespaces.
For example to define the same check in two namespaces using the same check name:
sensu_check { 'check-cpu in default':
ensure => 'present',
command => 'check-cpu.sh -w 75 -c 90',
interval => 60,
subscriptions => ['linux'],
}
sensu_check { 'check-cpu in team1':
ensure => 'present',
command => 'check-cpu.sh -w 75 -c 90',
interval => 60,
subscriptions => ['linux'],
}The example above would add the check-cpu check to both the default and team1 namespaces.
NOTE: If you use composite names for namespaces, the namespace property takes precedence.
Plugin management is handled by the sensu::plugins class.
Example installing plugins on agent:
class { 'sensu::agent':
backends => ['sensu-backend.example.com:8081'],
subscriptions => ['linux', 'apache-servers'],
}
class { 'sensu::plugins':
plugins => ['disk-checks'],
}The plugins parameter can also be a Hash that sets the version:
class { 'sensu::agent':
backends => ['sensu-backend.example.com:8081'],
subscriptions => ['linux', 'apache-servers'],
}
class { 'sensu::plugins':
plugins => {
'disk-checks' => { 'version' => 'latest' },
},
}Set dependencies to an empty Array to disable the sensu::plugins dependency management.
class { 'sensu::plugins':
dependencies => [],
}If gems are required and not pulled in as gem dependencies they can also be installed.
class { 'sensu::plugins':
plugins => ['memory-checks'],
gem_dependencies => ['vmstat'],
}You can uninstall plugins by passing ensure as absent.
class { 'sensu::agent':
backends => ['sensu-backend.example.com:8081'],
subscriptions => ['linux', 'apache-servers'],
}
class { 'sensu::plugins':
plugins => {
'disk-checks' => { 'ensure' => 'absent' },
},
}Extension management is handled by the sensu::plugins class.
Example installing extension on backend:
class { 'sensu':
password => 'supersecret',
}
include sensu::backend
class { 'sensu::plugins':
extensions => ['graphite'],
}The extensions parameter can also be a Hash that sets the version:
class { 'sensu':
password => 'supersecret',
}
include sensu::backend
class { 'sensu::plugins':
extensions => {
'graphite' => { 'version' => 'latest' },
},
}You can uninstall extensions by passing ensure as absent.
class { 'sensu':
password => 'supersecret',
}
include sensu::backend
class { 'sensu::plugins':
extensions => {
'graphite' => { 'ensure' => 'absent' },
},
}Bonsai assets are the modern replacement for the former sensu::plugins class. Where you previously used sensu::plugins { plugins => ['disk-checks'] }, use sensu_bonsai_asset with the corresponding Bonsai namespace/name instead (e.g. sensu/sensu-plugins-disk-checks).
Install a Bonsai asset. The current version at time of the first Puppet run will be installed but not automatically upgraded.
sensu_bonsai_asset { 'sensu/sensu-pagerduty-handler':
ensure => 'present',
}Install a specific version:
sensu_bonsai_asset { 'sensu/sensu-pagerduty-handler':
ensure => 'present',
version => '1.2.0',
}Track the latest version. Puppet will upgrade the asset whenever a new version is released on Bonsai.
sensu_bonsai_asset { 'sensu/sensu-pagerduty-handler':
ensure => 'present',
version => 'latest',
}Register the asset under a custom name using rename. This is useful when existing checks reference a different asset name in their runtime_assets list.
sensu_bonsai_asset { 'sensu/sensu-pagerduty-handler':
ensure => 'present',
rename => 'pagerduty-handler',
}Install into a non-default Sensu RBAC namespace using a composite title (bonsai_namespace/bonsai_name in sensu_namespace):
sensu_bonsai_asset { 'sensu/sensu-pagerduty-handler in ops':
ensure => 'present',
}Use a proxy to reach Bonsai:
sensu_bonsai_asset { 'sensu/sensu-pagerduty-handler':
ensure => 'present',
bonsai_http_proxy => 'http://proxy.example.com:3128',
}Manage multiple Bonsai assets via Hiera using sensu::resources::bonsai_assets:
sensu::resources::bonsai_assets:
'sensu/sensu-pagerduty-handler':
ensure: present
version: '1.2.0'
'sensu/sensu-plugins-disk-checks':
ensure: present
version: latestThe following Bolt tasks are provided by this Module:
sensu::backend_upgrade: Perform backend upgrade via sensu-backend upgrade command.
Example: bolt task run sensu::backend_upgrade --targets sensu_backend
sensu::agent_event: Create a Sensu Go agent event via the agent API
Example: bolt task run sensu::agent_event name=bolttest status=1 output=test --targets sensu_agent
sensu::apikey: Manage Sensu Go API keys
Example: bolt task run sensu::apikey action=create username=foobar --targets sensu_backend
Example: bolt task run sensu::apikey action=list --targets sensu_backend
Example: bolt task run sensu::apikey action=delete key=replace-with-uuid-key --targets sensu_backend
sensu::assets_outdated: Retreive outdated Sensu Go assets
Example: bolt task run sensu::assets_outdated --targets sensu_backend
sensu::check_execute: Execute a Sensu Go check
Example: bolt task run sensu::check_execute check=test subscription=entity:sensu_agent --targets sensu_backend
sensu::event.json: Manage Sensu Go events
Example: bolt task run sensu::event action=resolve entity=sensu_agent check=test --targets sensu_backend
Example: bolt task run sensu::event action=delete entity=sensu_agent check=test --targets sensu_backend
sensu::silenced: Manage Sensu Go silencings
Example: bolt task run sensu::silenced action=create subscription=entity:sensu_agent expire_on_resolve=true --targets sensu_backend
Example: bolt task run sensu::silenced action=delete subscription=entity:sensu_agent --targets sensu_backend
sensu::install_agent: Install Sensu Go agent (Windows and Linux)
Example: bolt task run sensu::install_agent backend=sensu_backend:8081 subscription=linux output=true --targets linux
Example: bolt task run sensu::install_agent backend=sensu_backend:8081 subscription=windows output=true --targets windows
This module provides a plugin to populate Bolt v2 inventory targets.
To use the sensu inventory plugin, the Bolt host must have sensuctl configured (see Basic Sensu CLI).
Two groups — linux (default namespace) and linux-qa (qa namespace):
version: 2
groups:
- name: linux
targets:
- _plugin: sensu
namespace: default
subscription: linux
- name: linux-qa
targets:
- _plugin: sensu
namespace: qa
subscription: linuxFor entities with multiple network interfaces, specify the interface search order:
version: 2
groups:
- name: linux
targets:
- _plugin: sensu
namespace: default
subscription: linux
interface_list:
- eth0
- eth1The following rules for interface matching determine the value used for uri.
- If
interface_listwas defined then find first match - If
interface_listnot defined and only one interface, use that as ipaddress - If
interface_listis not defined and more than one interface, use name
The sensu_agent fact returns the Sensu agent version information by the sensu-agent binary.
facter -p sensu_agent
{
version => "6.11.0",
build => "a3a4e39cb3fe0f7b4ff4e6a19c6e1bb5b3cdfbf2",
built => "2024-03-01T00:00:00+0000"
}The sensu_backend fact returns the Sensu backend version information by the sensu-backend binary.
facter -p sensu_backend
{
version => "6.11.0",
build => "a3a4e39cb3fe0f7b4ff4e6a19c6e1bb5b3cdfbf2",
built => "2024-03-01T00:00:00+0000"
}The sensuctl fact returns the sensuctl version information by the sensuctl binary.
facter -p sensuctl
{
version => "6.11.0",
build => "a3a4e39cb3fe0f7b4ff4e6a19c6e1bb5b3cdfbf2",
built => "2024-03-01T00:00:00+0000"
}Examples can be found in the examples directory.
- Contact Routing - Example of contact routing
- Email Alerts - Example of setting up e-mail alerts
- InfluxDB Handler - Example of setting up InfluxDB handler
- LDAP - Example of setting up LDAP authentication
- Logging - Example of setting up improved logging
- Pagerduty with Secrets Env Vars - Setting up Pagerduty using environment variable secrets
- Pagerduty with Secrets vault - Setting up Pagerduty using secrets vault
- PostgreSQL with Replication - Contains example manifests of setting up Sensu backend and PostgreSQL with PostgreSQL replication.
- PostgreSQL with SSL - Contains example manifests of setting up Sensu backend and PostgreSQL to communicate using SSL.
- Slack Alerts - Example of setting up Slack alerts
- SSL Backend - Example of Sensu backend with SSL/TLS enabled
Changing sensu::etc_dir is only supported on systems using systemd.
The type sensu_user does not at this time support ensure => absent due to a limitation with sensuctl, see sensu-go#2540.
When changing sensu::password, run Puppet on the backend first.
This module targets Puppet 8. See .github/workflows/ for the exact Puppet/Ruby version matrix.
Platform support is removed when a platform is EOL per Puppet, Sensu, or the platform maintainer.
Amazon Linux 2 reached EOL June 2025 and has been removed. Amazon Linux 2023 is the supported Amazon Linux release.
- EL 8 (Rocky 8, AlmaLinux 8)
- EL 9 (Rocky 9, AlmaLinux 9)
- Debian 12
- Ubuntu 22.04 LTS
- Ubuntu 24.04 LTS
- Amazon Linux 2023
- Windows Server 2016, 2019, 2022 (sensu-agent and sensuctl only)
See CONTRIBUTING.md
See LICENSE file.