Created
April 28, 2014 11:08
-
-
Save fprimex/11368614 to your computer and use it in GitHub Desktop.
Couchbase set_alert_limits.sh
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
#!/bin/sh | |
cbuser=Administrator | |
cbpassword=couchbase | |
cbserver=127.0.0.1 | |
cbport=8091 | |
# default is 50 | |
max_overhead_perc=50 | |
# default is 90 | |
max_disk_used=90 | |
get_settings() { | |
printf "%-30s %s\n" "max_overhead_perc" $(curl -sS --data "{value, Config} = ns_config:search(alert_limits),proplists:get_value(max_overhead_perc, Config)." -u "${cbuser}":"${cbpassword}" http://"$cbserver":"$cbport"/diag/eval) | |
printf "%-30s %s\n" "max_disk_used" $(curl -sS --data "{value, Config} = ns_config:search(alert_limits),proplists:get_value(max_disk_used, Config)." -u "${cbuser}":"${cbpassword}" http://"$cbserver":"$cbport"/diag/eval) | |
} | |
echo "Settings before change:" | |
get_settings | |
echo | |
echo "Setting max_overhead_perc to $max_overhead_perc and max_disk_used to $max_disk_used" | |
curl -sS --data "ns_config:set(alert_limits, [{max_overhead_perc, "${max_overhead_perc}"}, {max_disk_used, "${max_disk_used}"}])." -u "${cbuser}":"${cbpassword}" http://"$cbserver":"$cbport"/diag/eval | |
echo | |
echo | |
echo "Settings after change:" | |
get_settings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment