example yml changes to reflect README

This commit is contained in:
sqshq 2019-07-25 23:36:34 -04:00
parent 60b325eabf
commit 0ad8caf579
1 changed files with 39 additions and 51 deletions

View File

@ -1,8 +1,7 @@
variables:
mongoconnection: mongo --quiet --host=localhost blog
runcharts: runcharts:
- title: SEARCH ENGINE RESPONSE TIME (sec) - title: Search engine response time
position: [[0, 0], [52, 16]] position: [[0, 0], [45, 19]]
rate-ms: 500
triggers: triggers:
- title: Latency threshold exceeded - title: Latency threshold exceeded
condition: echo "$prev < 0.8 && $cur > 0.8" |bc -l condition: echo "$prev < 0.8 && $cur > 0.8" |bc -l
@ -11,51 +10,35 @@ runcharts:
sound: true sound: true
visual: true visual: true
script: 'say alert: ${label} latency exceeded ${cur} second' script: 'say alert: ${label} latency exceeded ${cur} second'
scale: 3 legend:
enabled: true
details: false
scale: 2
items: items:
- label: GOOGLE - label: GOOGLE
color: 178
sample: curl -o /dev/null -s -w '%{time_total}' https://www.google.com sample: curl -o /dev/null -s -w '%{time_total}' https://www.google.com
- label: YAHOO - label: YAHOO
sample: curl -o /dev/null -s -w '%{time_total}' https://search.yahoo.com sample: curl -o /dev/null -s -w '%{time_total}' https://search.yahoo.com
- label: BING - label: BING
sample: curl -o /dev/null -s -w '%{time_total}' https://www.bing.com sample: curl -o /dev/null -s -w '%{time_total}' https://www.bing.com
- title: MONGO COLLECTIONS COUNT
position: [[53, 0], [27, 8]]
legend:
enabled: true
details: false
scale: 0
items:
- label: ACTIVE
init: $mongoconnection
sample: db.getCollection('posts').find({status:'ACTIVE'}).itcount()
- label: INACTIVE
init: $mongoconnection
sample: db.getCollection('posts').find({status:'INACTIVE'}).itcount()
barcharts: barcharts:
- title: EVENTS BY STATUS - title: Local network activity
position: [[0, 17], [28, 12]] position: [[45, 20], [35, 8]]
rate-ms: 300 rate-ms: 500
scale: 0 scale: 0
items: items:
- label: NEW - label: UDP bytes in
init: $mongoconnection sample: nettop -J bytes_in -l 1 -m udp | awk '{sum += $4} END {print sum}'
sample: db.getCollection('posts').find({status:'ACTIVE'}).itcount() - label: UDP bytes out
- label: TRIGGERED sample: nettop -J bytes_out -l 1 -m udp | awk '{sum += $4} END {print sum}'
init: $mongoconnection - label: TCP bytes in
sample: db.getCollection('posts').find({status:'INACTIVE'}).itcount() sample: nettop -J bytes_in -l 1 -m tcp | awk '{sum += $4} END {print sum}'
- label: IN_PROCESS - label: TCP bytes out
init: $mongoconnection sample: nettop -J bytes_out -l 1 -m tcp | awk '{sum += $4} END {print sum}'
sample: db.getCollection('posts').find({status:'UNKNOWN'}).itcount()
- label: FAILED
init: $mongoconnection
sample: db.getCollection('posts').find({status:'ACTIVE'}).itcount()
- label: FINISHED
init: $mongoconnection
sample: db.getCollection('posts').find({status:'INACTIVE'}).itcount()
gauges: gauges:
- title: YEAR PROGRESS - title: YEAR PROGRESS
position: [[53, 8], [27, 2]] position: [[45, 0], [35, 2]]
cur: cur:
sample: date +%j sample: date +%j
max: max:
@ -63,7 +46,7 @@ gauges:
min: min:
sample: echo 0 sample: echo 0
- title: DAY PROGRESS - title: DAY PROGRESS
position: [[53, 10], [27, 2]] position: [[45, 3], [35, 2]]
cur: cur:
sample: date +%H sample: date +%H
max: max:
@ -71,7 +54,7 @@ gauges:
min: min:
sample: echo 0 sample: echo 0
- title: HOUR PROGRESS - title: HOUR PROGRESS
position: [[53, 12], [27, 2]] position: [[45, 6], [35, 2]]
cur: cur:
sample: date +%M sample: date +%M
max: max:
@ -79,7 +62,7 @@ gauges:
min: min:
sample: echo 0 sample: echo 0
- title: MINUTE PROGRESS - title: MINUTE PROGRESS
position: [[53, 14], [27, 2]] position: [[45, 9], [35, 2]]
triggers: triggers:
- title: CLOCK BELL EVERY MINUTE - title: CLOCK BELL EVERY MINUTE
condition: '[ $label == "cur" ] && [ $cur -eq 0 ] && echo 1 || echo 0' condition: '[ $label == "cur" ] && [ $cur -eq 0 ] && echo 1 || echo 0'
@ -94,35 +77,40 @@ gauges:
sample: echo 0 sample: echo 0
sparklines: sparklines:
- title: CPU usage - title: CPU usage
position: [[28, 22], [24, 7]] position: [[0, 20], [22, 8]]
rate-ms: 200
scale: 0 scale: 0
sample: ps -A -o %cpu | awk '{s+=$1} END {print s}' sample: ps -A -o %cpu | awk '{s+=$1} END {print s}'
- title: Memory pages free - title: Free memory pages
position: [[28, 17], [24, 5]] position: [[22, 20], [23, 8]]
rate-ms: 200
scale: 0 scale: 0
sample: memory_pressure | grep 'Pages free' | awk '{print $3}' sample: memory_pressure | grep 'Pages free' | awk '{print $3}'
textboxes: 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 - title: Local weather
position: [[0, 30], [13, 7]] position: [[69, 31], [13, 7]]
rate-ms: 10000 rate-ms: 10000
sample: curl wttr.in?0ATQF sample: curl wttr.in?0ATQF
border: false border: false
- title: New York weather - title: New York weather
position: [[8, 30], [13, 7]] position: [[45, 31], [13, 7]]
rate-ms: 10000 rate-ms: 10000
sample: curl wttr.in/newyork?0ATQF sample: curl wttr.in/newyork?0ATQF
transform: echo 1 transform: echo 1
border: false border: false
- title: San Francisco weather - title: San Francisco weather
position: [[17, 30], [13, 7]] position: [[56, 31], [13, 7]]
rate-ms: 10000 rate-ms: 10000
sample: curl wttr.in/sanfrancisco?0ATQF sample: curl wttr.in/sanfrancisco?0ATQF
border: false border: false
asciiboxes: asciiboxes:
- title: LOCAL TIME - title: UTC time
position: [[53, 17], [27, 5]] position: [[45, 12], [35, 7]]
sample: date +%r rate-ms: 500
- title: UTC TIME
position: [[53, 22], [27, 7]]
sample: env TZ=UTC date +%r sample: env TZ=UTC date +%r
border: false
font: 3d font: 3d