|
@@ -14,6 +14,20 @@ bulkDashboard() {
|
|
|
ln -s -f -r ./bulk-dashboards/bulk-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
|
|
ln -s -f -r ./bulk-dashboards/bulk-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+bulkAlertingDashboard() {
|
|
|
|
|
+
|
|
|
|
|
+ requiresJsonnet
|
|
|
|
|
+
|
|
|
|
|
+ COUNTER=0
|
|
|
|
|
+ MAX=100
|
|
|
|
|
+ while [ $COUNTER -lt $MAX ]; do
|
|
|
|
|
+ jsonnet -o "bulk_alerting_dashboards/alerting_dashboard${COUNTER}.json" -e "local bulkDash = import 'bulk_alerting_dashboards/bulkdash_alerting.jsonnet'; bulkDash + { uid: 'uid-${COUNTER}', title: 'alerting-title-${COUNTER}' }"
|
|
|
|
|
+ let COUNTER=COUNTER+1
|
|
|
|
|
+ done
|
|
|
|
|
+
|
|
|
|
|
+ ln -s -f -r ./bulk_alerting_dashboards/bulk_alerting_dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
requiresJsonnet() {
|
|
requiresJsonnet() {
|
|
|
if ! type "jsonnet" > /dev/null; then
|
|
if ! type "jsonnet" > /dev/null; then
|
|
|
echo "you need you install jsonnet to run this script"
|
|
echo "you need you install jsonnet to run this script"
|
|
@@ -36,8 +50,9 @@ devDatasources() {
|
|
|
usage() {
|
|
usage() {
|
|
|
echo -e "\n"
|
|
echo -e "\n"
|
|
|
echo "Usage:"
|
|
echo "Usage:"
|
|
|
- echo " bulk-dashboards - create and provisioning 400 dashboards"
|
|
|
|
|
- echo " no args - provisiong core datasources and dev dashboards"
|
|
|
|
|
|
|
+ echo " bulk-dashboards - create and provisioning 400 dashboards"
|
|
|
|
|
+ echo " bulk-alerting-dashboards - create and provisioning 400 dashboards with alerts"
|
|
|
|
|
+ echo " no args - provisiong core datasources and dev dashboards"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
main() {
|
|
@@ -48,7 +63,9 @@ main() {
|
|
|
|
|
|
|
|
local cmd=$1
|
|
local cmd=$1
|
|
|
|
|
|
|
|
- if [[ $cmd == "bulk-dashboards" ]]; then
|
|
|
|
|
|
|
+ if [[ $cmd == "bulk-alerting-dashboards" ]]; then
|
|
|
|
|
+ bulkAlertingDashboard
|
|
|
|
|
+ elif [[ $cmd == "bulk-dashboards" ]]; then
|
|
|
bulkDashboard
|
|
bulkDashboard
|
|
|
else
|
|
else
|
|
|
devDashboards
|
|
devDashboards
|