-
Notifications
You must be signed in to change notification settings - Fork 0
/
desense-dashboard.yml
101 lines (98 loc) · 4.04 KB
/
desense-dashboard.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
runcharts:
- title: Sensors Observations
position: [[0, 0], [45, 19]]
rate-ms: 3000
triggers:
- title: Latency threshold exceeded
condition: echo " (${label} == "Voltage" && $cur > 220) || (${label} == "Temprature" && $cur > 24) || (${label} == "Current" && $cur > 1100) " |bc -l
actions:
terminal-bell: true
sound: true
visual: true
script: 'say alert: ${label} Treshhold exceeded ${cur} '
legend:
enabled: true
details: false
scale: 2
items:
- label: Voltage
color: 178
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty&tx-type=axfer") | jq '[.transactions[].note] | last' | python -c "import sys,base64,json; x=sys.stdin.read().decode('base64'); sys.stdout.write(x[2:])" | jq '.voltage' | sed -e 's/^"//' -e 's/"$//'
- label: Temprature
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty&tx-type=axfer") | jq '[.transactions[].note] | last' | python -c "import sys,base64,json; x=sys.stdin.read().decode('base64'); sys.stdout.write(x[2:])" | jq '.temprature' | sed -e 's/^"//' -e 's/"$//'
- label: Current
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty&tx-type=axfer") | jq '[.transactions[].note] | last' | python -c "import sys,base64,json; x=sys.stdin.read().decode('base64'); sys.stdout.write(x[2:])" | jq '.current' | sed -e 's/^"//' -e 's/"$//'
barcharts:
- title: Sensor network blockchain activity
position: [[45, 20], [35, 8]]
rate-ms: 5000
scale: 0
items:
- label: SENSE TRANSFER TXN
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty&tx-type=axfer") | jq '[.transactions[]] | length'
- label: SENSE APP CALL TXN
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty&tx-type=appl") | jq '[.transactions[]] | length' | awk '{print $1}'
- label: SENSE TOTAL TXN
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty") | jq '[.transactions[]] | length' | awk '{print $1}'
gauges:
- title: Voltage
position: [[45, 0], [35, 2]]
cur:
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty&tx-type=axfer") | jq '[.transactions[].note] | last' | python -c "import sys,base64,json; x=sys.stdin.read().decode('base64'); sys.stdout.write(x[2:])" | jq '.voltage' | sed -e 's/^"//' -e 's/"$//'
max:
sample: echo 280
min:
sample: echo 110
- title: Current
position: [[45, 3], [35, 2]]
cur:
sample: echo -n $(curl -s "localhost:8980/v2/transactions?pretty&tx-type=axfer") | jq '[.transactions[].note] | last' | python -c "import sys,base64,json; x=sys.stdin.read().decode('base64'); sys.stdout.write(x[2:])" | jq '.current' | sed -e 's/^"//' -e 's/"$//'
max:
sample: echo 1500
min:
sample: echo 900
sparklines:
- title: CPU usage
position: [[0, 20], [22, 8]]
rate-ms: 200
scale: 0
sample: ps -A -o %cpu | awk '{s+=$1} END {print s}'
- title: Free memory pages
position: [[22, 20], [23, 8]]
rate-ms: 200
scale: 0
sample: memory_pressure | grep 'Pages free' | awk '{print $3}'
textboxes:
- title: Docker containers stats
position: [[0, 29], [45, 10]]
rate-ms: 500
sample: docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.PIDs}}"
- title: Local weather
position: [[69, 31], [13, 7]]
rate-ms: 10000
sample: curl wttr.in?0ATQF
border: false
- title: Melbourne weather
position: [[45, 31], [13, 7]]
rate-ms: 10000
sample: curl wttr.in/melbourne?0ATQF
transform: echo 1
border: false
- title: Boston weather
position: [[56, 31], [13, 7]]
rate-ms: 10000
sample: curl wttr.in/boston?0ATQF
border: false
asciiboxes:
- title: deSense
position: [[45, 6], [35, 9]]
rate-ms: 10000
sample: echo "deSense"
border: true
font: 2d
- title: UTC time
position: [[45, 12], [35, 9]]
rate-ms: 500
sample: env TZ=UTC date +%r
border: true
font: 2d