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