...
There are a few steps involved , to define a new check.
First. Make sure that the plugin for the new check is installed on the clients.
- If this is a check that all clients should run, add the plugin to the hiera key
profile::sensu::plugins
If this is a service specific check and plugin, add a new manifest
profile::sensu::plugin::<name>
with puppet code to install the plugin. This manifest class should typically be included from another class. Examples:Code Block # MySQL plugin for sensu class profile::sensu::plugin::mysql { require ::profile::sensu::client sensu::plugin { 'sensu-plugins-mysql': type => 'package' } }
Include this class in a mysql-server related class. Example:
Code Block # Configuring galera and maraidb cluster class profile::mysql::cluster { ... $installSensu = hiera('profile::sensu::install', true) if ($installSensu) { include ::profile::sensu::plugin::mysql } ...
The; add a check definition to the profile::sensu::checks
class. All checks are defined in the puppet class profile::sensu::checks
. The check definitions are only installed to the sensu servers.here, because the checks only needs to be configured on the sensu servers. Example
Code Block |
---|
sensu::check { 'mysql-status':
command => 'check-mysql-status.rb -h localhost -d mysql -u clustercheck -p :::mysql.password::: --check status',
interval => 300,
handle => false,
standalone => false,
subscribers => [ 'mysql' ],
} |
The parameter subscribers
defines which servers that should subscribe to/run this check.
Some subscriptions are added do clients by default:
'all'
is added to all sensu clients'physical-servers'
is added to all physical servers'dell-servers'
is added to all physical Dell servers
Service specific subscriptions are added to clients in hiera per server, via the key sensu::subscriptions