Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
a1e6c31e
Commit
a1e6c31e
authored
May 29, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenv: script for setting up default datasources
parent
6a82098d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
153 additions
and
15 deletions
+153
-15
devenv/dashboards/bulk-testing/bulk-dashboards.yaml
+9
-0
devenv/dashboards/generate-bulk-dashboards.sh
+0
-15
devenv/datasources/default/default.yaml
+82
-0
devenv/setup.sh
+62
-0
No files found.
devenv/dashboards/bulk-testing/bulk-dashboards.yaml
0 → 100644
View file @
a1e6c31e
apiVersion
:
1
providers
:
-
name
:
'
Bulk
dashboards'
folder
:
'
Bulk
dashboards'
type
:
file
options
:
path
:
/home/carl/go/src/github.com/grafana/grafana/devenv/dashboards/bulk-testing
devenv/dashboards/generate-bulk-dashboards.sh
deleted
100755 → 0
View file @
6a82098d
#/bin/bash
if
!
type
"jsonnet"
>
/dev/null
;
then
echo
"you need you install jsonnet to run this script"
echo
"follow the instructions on https://github.com/google/jsonnet"
exit
1
fi
COUNTER
=
0
MAX
=
400
while
[
$COUNTER
-lt
$MAX
]
;
do
jsonnet
-o
"bulk-testing/dashboard
${
COUNTER
}
.json"
-e
"local bulkDash = import 'bulk-testing/bulkdash.jsonnet'; bulkDash + { uid: 'uid-
${
COUNTER
}
', title: 'title-
${
COUNTER
}
' }"
let
COUNTER
=
COUNTER+1
done
devenv/datasources/default/default.yaml
0 → 100644
View file @
a1e6c31e
apiVersion
:
1
datasources
:
-
name
:
Graphite
type
:
graphite
access
:
proxy
url
:
http://localhost:8080
jsonData
:
graphiteVersion
:
"
1.1"
-
name
:
Prometheus
type
:
prometheus
access
:
proxy
isDefault
:
true
url
:
http://localhost:9090
-
name
:
InfluxDB
type
:
influxdb
access
:
proxy
database
:
site
user
:
grafana
password
:
grafana
url
:
http://localhost:8086
jsonData
:
timeInterval
:
"
15s"
-
name
:
OpenTsdb
type
:
opentsdb
access
:
proxy
url
:
http://localhost:4242
jsonData
:
tsdbResolution
:
1
tsdbVersion
:
1
-
name
:
Elastic
type
:
elasticsearch
access
:
proxy
database
:
"
[metrics-]YYYY.MM.DD"
url
:
http://localhost:9200
jsonData
:
interval
:
Daily
timeField
:
"
@timestamp"
-
name
:
MySQL
type
:
mysql
url
:
localhost:3306
database
:
grafana
user
:
grafana
password
:
password
-
name
:
MSSQL
type
:
mssql
url
:
localhost:1433
database
:
grafana
user
:
grafana
password
:
"
Password!"
-
name
:
Postgres
type
:
postgres
url
:
localhost:5432
database
:
grafana
user
:
grafana
password
:
password
jsonData
:
sslmode
:
"
disable"
-
name
:
Cloudwatch
type
:
cloudwatch
editable
:
true
jsonData
:
authType
:
credentials
defaultRegion
:
eu-west-2
-
name
:
Cloudwatch keys
type
:
cloudwatch
editable
:
true
jsonData
:
authType
:
keys
defaultRegion
:
eu-west-2
secureJsonData
:
accessKey
:
AKIAJL347VWN6MK63N2A
secretKey
:
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
devenv/setup.sh
0 → 100755
View file @
a1e6c31e
#/bin/bash
bulkDashboard
()
{
requiresJsonnet
COUNTER
=
0
MAX
=
400
while
[
$COUNTER
-lt
$MAX
]
;
do
jsonnet
-o
"dashboards/bulk-testing/dashboard
${
COUNTER
}
.json"
-e
"local bulkDash = import 'dashboards/bulk-testing/bulkdash.jsonnet'; bulkDash + { uid: 'uid-
${
COUNTER
}
', title: 'title-
${
COUNTER
}
' }"
let
COUNTER
=
COUNTER+1
done
ln
-s
-f
-r
./dashboards/bulk-testing/bulk-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
}
requiresJsonnet
()
{
if
!
type
"jsonnet"
>
/dev/null
;
then
echo
"you need you install jsonnet to run this script"
echo
"follow the instructions on https://github.com/google/jsonnet"
exit
1
fi
}
defaultDashboards
()
{
echo
"not implemented yet"
}
defaultDatasources
()
{
echo
"setting up all default datasources using provisioning"
ln
-s
-f
-r
./datasources/default/default.yaml ../conf/provisioning/datasources/custom.yaml
}
usage
()
{
echo
-e
"install.sh
\n\t
This script installs my basic setup for a debian laptop
\n
"
echo
"Usage:"
echo
" bulk-dashboards - create and provisioning 400 dashboards"
echo
" default-datasources - provisiong all core datasources"
}
main
()
{
local
cmd
=
$1
if
[[
-z
"
$cmd
"
]]
;
then
usage
exit
1
fi
if
[[
$cmd
==
"bulk-dashboards"
]]
;
then
bulkDashboard
elif
[[
$cmd
==
"default-datasources"
]]
;
then
defaultDatasources
elif
[[
$cmd
==
"default-dashboards"
]]
;
then
bulkDashboard
else
usage
fi
}
main
"
$@
"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment