-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #835 from alvagante/834
Set a defauly empty array for redact #834
- Loading branch information
Showing
2 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
node 'sensu-server' { | ||
$deregistration = { 'handler' => 'deregister_client' } | ||
|
||
class { '::sensu': | ||
install_repo => true, | ||
server => true, | ||
manage_services => true, | ||
manage_user => true, | ||
rabbitmq_password => 'correct-horse-battery-staple', | ||
rabbitmq_vhost => '/sensu', | ||
spawn_limit => 16, | ||
api => true, | ||
api_user => 'admin', | ||
api_password => 'secret', | ||
client_address => $::ipaddress_eth1, | ||
subscriptions => ['all', 'roundrobin:poller'], | ||
client_deregister => true, | ||
client_deregistration => $deregistration, | ||
redact => ["password", "passwd", "pass", "api_key", "api_token", "access_key", "secret_key", "private_key", "secret", "ec2_access_key", "ec2_secret_key"], | ||
} | ||
|
||
sensu::handler { 'default': | ||
command => 'mail -s \'sensu alert\' ops@example.com', | ||
} | ||
|
||
# Example handler which operates in silenced checks | ||
# | ||
# This should create a file in /etc/sensu/conf.d/handlers/handle_silenced.json, containing the following: | ||
# | ||
# { | ||
# "handlers": { | ||
# "mail_handle_silenced": { | ||
# "command": "mail -s 'sensu alert' ops@example.com", | ||
# "type": "pipe", | ||
# "filters": [ | ||
# | ||
# ], | ||
# "severities": [ | ||
# "ok", | ||
# "warning", | ||
# "critical", | ||
# "unknown" | ||
# ], | ||
# "handle_flapping": false, | ||
# "handle_silenced": true | ||
# } | ||
# } | ||
# } | ||
sensu::handler { 'mail_handle_silenced': | ||
command => 'mail -s \'sensu alert\' ops@example.com', | ||
handle_silenced => true, | ||
} | ||
|
||
sensu::check { 'check_ntp': | ||
command => 'PATH=$PATH:/usr/lib64/nagios/plugins check_ntp_time -H pool.ntp.org -w 30 -c 60', | ||
handlers => 'default', | ||
subscribers => 'sensu-test', | ||
} | ||
|
||
$proxy_requests_ntp = { | ||
'client_attributes' => { | ||
'subscriptions' => 'eval: value.include?("ntp")', | ||
}, | ||
} | ||
|
||
# Example check using the cron schedule. | ||
sensu::check { 'remote_check_ntp': | ||
command => 'PATH=$PATH:/usr/lib64/nagios/plugins check_ntp_time -H :::address::: -w 30 -c 60', | ||
standalone => false, | ||
handlers => 'default', | ||
subscribers => 'roundrobin:poller', | ||
cron => '*/5 * * * *', | ||
proxy_requests => $proxy_requests_ntp, | ||
} | ||
|
||
# A client defined in the Dashboard with a subscription of "http" will | ||
# automatically have this check associated with it. Check Google with the | ||
# following API call to create a proxy client definition: | ||
# | ||
# curl -s -i -X POST -H 'Content-Type: application/json' \ | ||
# -d '{"name":"google.com","address":"google.com","subscriptions":["http"]}' \ | ||
# http://admin:secret@127.0.0.1:4567/clients | ||
# | ||
# Then, trigger the check with: | ||
# | ||
# curl -s -i -X POST -H 'Content-Type: application/json' \ | ||
# -d '{"check": "remote_http"}' \ | ||
# http://admin:secret@127.0.0.1:4567/request | ||
$proxy_requests_http = { | ||
'client_attributes' => { | ||
'subscriptions' => 'eval: value.include?("http")', | ||
}, | ||
} | ||
sensu::check { 'remote_http': | ||
command => '/opt/sensu/embedded/bin/check-http.rb -u http://:::address:::', | ||
occurrences => 2, | ||
interval => 300, | ||
refresh => 600, | ||
low_flap_threshold => 20, | ||
high_flap_threshold => 60, | ||
standalone => false, | ||
subscribers => 'roundrobin:poller', | ||
proxy_requests => $proxy_requests_http, | ||
} | ||
} |