forked from sensu/sensu-puppet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(sensu#568) Improve rabbitmq clustering robustness
Without this patch, Puppet errors out when both `sensu::rabbitmq_password`, or any of the `sensu::rabbitmq_*` parameters are specified along with `sensu::rabbitmq_cluster`. The error is: Error: /Stage[main]/Sensu::Rabbitmq::Config/Sensu_rabbitmq_config[sensu-server.example.com]: Could not evaluate: no implicit conversion of String into Integer /vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `[]' /vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `password' This patch addresses the problem by changing sensu::rabbitmq::config to ignore sensu::rabbitmq_* class parameters when the cluster configuration is specified via `sensu::rabbitmq_cluster`. Resolves sensu#598
- Loading branch information
1 parent
422a6d2
commit 7f1edd9
Showing
6 changed files
with
151 additions
and
35 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
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,14 @@ | ||
#!/bin/bash | ||
|
||
# setup module dependencies | ||
puppet module install puppetlabs/rabbitmq | ||
|
||
# install dependencies for sensu | ||
yum -y install redis jq nagios-plugins-ntp | ||
systemctl start redis | ||
systemctl enable redis | ||
|
||
# run puppet | ||
puppet apply /vagrant/tests/rabbitmq.pp | ||
puppet apply /vagrant/tests/sensu-server-cluster.pp | ||
puppet apply /vagrant/tests/uchiwa.pp |
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 |
---|---|---|
|
@@ -21,4 +21,33 @@ | |
handlers => 'default', | ||
subscribers => 'sensu-test', | ||
} | ||
|
||
# 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:[email protected]:4567/clients | ||
# | ||
# Then, trigger the check with: | ||
# | ||
# curl -s -i -X POST -H 'Content-Type: application/json' \ | ||
# -d '{"check": "remote_http"}' \ | ||
# http://admin:[email protected]:4567/request | ||
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 => { | ||
'client_attributes' => { | ||
'subscriptions' => 'eval: value.include?("http")', | ||
}, | ||
}, | ||
} | ||
} |