Add name and cell to new_app.sh
parent
e9573ad093
commit
a212660084
|
@ -1,31 +1,18 @@
|
||||||
{
|
{
|
||||||
"id": "18aed9a7-dc83-406e-a4dc-40d53049541a",
|
"id": "e72c2eb9-d09b-46ea-b5df-0a82769e314d",
|
||||||
"measurement": "disk",
|
"measurement": "mem",
|
||||||
"app": "User Facing Application Name",
|
"app": "docker",
|
||||||
"cells": [{
|
"cells": [{
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 5,
|
"w": 10,
|
||||||
"h": 5,
|
"h": 10,
|
||||||
"i": "used_percent",
|
"i": "docker_test",
|
||||||
"name": "Used Percent",
|
"name": "test",
|
||||||
"queries": [{
|
"queries": [{
|
||||||
"query": "select used_percent from disk",
|
"query": "select used_percent from disk",
|
||||||
"db": "telegraf",
|
"db": "telegraf",
|
||||||
"rp": "autogen"
|
"rp": "autogen"
|
||||||
}]
|
}]
|
||||||
},
|
|
||||||
{
|
|
||||||
"x": 5,
|
|
||||||
"y": 1,
|
|
||||||
"w": 5,
|
|
||||||
"h": 5,
|
|
||||||
"i": "cpu_usage",
|
|
||||||
"name": "CPU Usage",
|
|
||||||
"queries": [{
|
|
||||||
"query": "select 100 - usage_idle from cpu",
|
|
||||||
"db": "telegraf",
|
|
||||||
"rp": "autogen"
|
|
||||||
}]
|
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ if [ -z "$measurement" ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
CELLID=$(uuidgen)
|
||||||
|
CELLID="$(tr [A-Z] [a-z] <<< "$CELLID")"
|
||||||
|
|
||||||
UUID=$(uuidgen)
|
UUID=$(uuidgen)
|
||||||
UUID="$(tr [A-Z] [a-z] <<< "$UUID")"
|
UUID="$(tr [A-Z] [a-z] <<< "$UUID")"
|
||||||
|
@ -47,6 +49,8 @@ cat > $APP_FILE << EOF
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 10,
|
"w": 10,
|
||||||
"h": 10,
|
"h": 10,
|
||||||
|
"i": "$CELLID",
|
||||||
|
"name": "User facing cell Name",
|
||||||
"queries": [{
|
"queries": [{
|
||||||
"query": "select used_percent from disk",
|
"query": "select used_percent from disk",
|
||||||
"db": "telegraf",
|
"db": "telegraf",
|
||||||
|
|
|
@ -29,7 +29,7 @@ func (h *Service) GetMappings(w http.ResponseWriter, r *http.Request) {
|
||||||
if seen[layout.Measurement+layout.ID] {
|
if seen[layout.Measurement+layout.ID] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
mp.Mappings = append(mp.Mappings, mapping{layout.Measurement, layout.ID})
|
mp.Mappings = append(mp.Mappings, mapping{layout.Measurement, layout.Measurement})
|
||||||
seen[layout.Measurement+layout.ID] = true
|
seen[layout.Measurement+layout.ID] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue