Skip to content

Instantly share code, notes, and snippets.

@bergerx
Created February 10, 2018 23:04
Show Gist options
  • Save bergerx/3d026a6888006914bc068b01dd6b83d3 to your computer and use it in GitHub Desktop.
Save bergerx/3d026a6888006914bc068b01dd6b83d3 to your computer and use it in GitHub Desktop.
sensu-plugins-sensu use-generic-metrics-classes
# removed some "Broken pipe" error messages for clarity, which are caused by "head; kill"
[dcos-infra]sensu-plugins-sensu: (master *+ u=) $ set -x; for i in json graphite statsd dogstatsd influxdb; do { head; kill "$$"; } < <(bundle exec bin/metrics-aggregate.rb --metric_format $i); done; set +x
+ for i in json graphite statsd dogstatsd influxdb
+ head
++ bundle exec bin/metrics-aggregate.rb --metric_format json
{"metric_name":"clients","value":4,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"checks","value":6,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"ok","value":2,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"warning","value":0,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"critical","value":0,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"unknown","value":0,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"total","value":2,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"stale","value":12,"tags":{"check":"dcos.cluster-management.mesos.master","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"clients","value":3,"tags":{"check":"dcos.networking.spartan","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
{"metric_name":"checks","value":1,"tags":{"check":"dcos.networking.spartan","host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300677}
+ kill 769
+ for i in json graphite statsd dogstatsd influxdb
+ head
++ bundle exec bin/metrics-aggregate.rb --metric_format graphite
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.clients 4 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.checks 6 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.ok 2 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.warning 0 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.critical 0 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.unknown 0 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.total 2 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.stale 12 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.networking.spartan.clients 3 1518300683
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.networking.spartan.checks 1 1518300683
+ kill 769
+ for i in json graphite statsd dogstatsd influxdb
+ head
++ bundle exec bin/metrics-aggregate.rb --metric_format statsd
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.clients:4|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.checks:6|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.ok:13|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.warning:0|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.critical:0|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.unknown:0|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.total:13|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.stale:1|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.networking.spartan.clients:3|kv
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.networking.spartan.checks:1|kv
+ kill 769
+ for i in json graphite statsd dogstatsd influxdb
+ head
++ bundle exec bin/metrics-aggregate.rb --metric_format dogstatsd
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.clients:4|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.checks:6|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.ok:12|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.warning:0|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.critical:0|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.unknown:0|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.total:12|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.cluster-management.mesos.master.stale:2|kv|#check:dcos.cluster-management.mesos.master,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.networking.spartan.clients:3|kv|#check:dcos.networking.spartan,host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.aggregates.dcos.networking.spartan.checks:1|kv|#check:dcos.networking.spartan,host:Bekirs-MacBook-Pro-2.local
+ kill 769
+ for i in json graphite statsd dogstatsd influxdb
+ head
++ bundle exec bin/metrics-aggregate.rb --metric_format influxdb
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local clients=4 1518300718
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local checks=6 1518300718
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local ok=3 1518300718
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local warning=0 1518300718
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local critical=0 1518300718
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local unknown=0 1518300718
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local total=3 1518300718
sensu.aggregates,check=dcos.cluster-management.mesos.master,host=Bekirs-MacBook-Pro-2.local stale=11 1518300718
sensu.aggregates,check=dcos.networking.spartan,host=Bekirs-MacBook-Pro-2.local clients=3 1518300718
sensu.aggregates,check=dcos.networking.spartan,host=Bekirs-MacBook-Pro-2.local checks=1 1518300718
+ kill 769
+ set +x
[dcos-infra]sensu-plugins-sensu: (master *+ u=) $
[dcos-infra]sensu-plugins-sensu: (master *+ u=) $ set -x; for i in json graphite statsd dogstatsd influxdb; do bundle exec bin/metrics-delete-expired-stashes.rb --noop --metric_format $i; done; set +x
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-delete-expired-stashes.rb --noop --metric_format json
{"metric_name":"expired","value":0,"tags":{"host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300259}
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-delete-expired-stashes.rb --noop --metric_format graphite
Bekirs-MacBook-Pro-2.local.sensu.stashes.expired.sensu.stashes.expired 0 1518300260
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-delete-expired-stashes.rb --noop --metric_format statsd
Bekirs-MacBook-Pro-2.local.sensu.stashes.expired.sensu.stashes.expired:0|kv
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-delete-expired-stashes.rb --noop --metric_format dogstatsd
Bekirs-MacBook-Pro-2.local.sensu.stashes.expired.sensu.stashes.expired:0|kv|#host:Bekirs-MacBook-Pro-2.local
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-delete-expired-stashes.rb --noop --metric_format influxdb
sensu.stashes,host=Bekirs-MacBook-Pro-2.local expired=0 1518300265
+ set +x
[dcos-infra]sensu-plugins-sensu: (master *+ u=) $
[dcos-infra]sensu-plugins-sensu: (master *+ u=) $ set -x; for i in json graphite statsd dogstatsd influxdb; do bundle exec bin/metrics-events.rb --metric_format $i; done; set +x
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-events.rb --metric_format json
{"metric_name":"total_events_count","value":156,"tags":{"host":"Bekirs-MacBook-Pro-2.local"},"timestamp":1518300287}
{"metric_name":"event_count","value":6,"tags":{"host":"Bekirs-MacBook-Pro-2.local","event_status":"warning"},"timestamp":1518300287}
{"metric_name":"event_count","value":64,"tags":{"host":"Bekirs-MacBook-Pro-2.local","event_status":"critical"},"timestamp":1518300287}
{"metric_name":"event_count","value":79,"tags":{"host":"Bekirs-MacBook-Pro-2.local","event_status":"status.3"},"timestamp":1518300287}
{"metric_name":"event_count","value":7,"tags":{"host":"Bekirs-MacBook-Pro-2.local","event_status":"status.127"},"timestamp":1518300287}
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-events.rb --metric_format graphite
Bekirs-MacBook-Pro-2.local.sensu.events.total 156 1518300288
Bekirs-MacBook-Pro-2.local.sensu.events.warning 6 1518300288
Bekirs-MacBook-Pro-2.local.sensu.events.critical 64 1518300288
Bekirs-MacBook-Pro-2.local.sensu.events.status.3 79 1518300288
Bekirs-MacBook-Pro-2.local.sensu.events.status.127 7 1518300288
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-events.rb --metric_format statsd
Bekirs-MacBook-Pro-2.local.sensu.events.total:156|kv
Bekirs-MacBook-Pro-2.local.sensu.events.warning:6|kv
Bekirs-MacBook-Pro-2.local.sensu.events.critical:64|kv
Bekirs-MacBook-Pro-2.local.sensu.events.status.3:79|kv
Bekirs-MacBook-Pro-2.local.sensu.events.status.127:7|kv
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-events.rb --metric_format dogstatsd
Bekirs-MacBook-Pro-2.local.sensu.events.total:156|kv|#host:Bekirs-MacBook-Pro-2.local
Bekirs-MacBook-Pro-2.local.sensu.events.warning:6|kv|#host:Bekirs-MacBook-Pro-2.local,event_status:warning
Bekirs-MacBook-Pro-2.local.sensu.events.critical:64|kv|#host:Bekirs-MacBook-Pro-2.local,event_status:critical
Bekirs-MacBook-Pro-2.local.sensu.events.status.3:79|kv|#host:Bekirs-MacBook-Pro-2.local,event_status:status.3
Bekirs-MacBook-Pro-2.local.sensu.events.status.127:7|kv|#host:Bekirs-MacBook-Pro-2.local,event_status:status.127
+ for i in json graphite statsd dogstatsd influxdb
+ bundle exec bin/metrics-events.rb --metric_format influxdb
sensu.events,host=Bekirs-MacBook-Pro-2.local total_events_count=156 1518300300
sensu.events,host=Bekirs-MacBook-Pro-2.local,event_status=warning event_count=6 1518300300
sensu.events,host=Bekirs-MacBook-Pro-2.local,event_status=critical event_count=64 1518300300
sensu.events,host=Bekirs-MacBook-Pro-2.local,event_status=status.3 event_count=79 1518300300
sensu.events,host=Bekirs-MacBook-Pro-2.local,event_status=status.127 event_count=7 1518300300
+ set +x
[dcos-infra]sensu-plugins-sensu: (master *+ u=) $
@bergerx
Copy link
Author

bergerx commented Feb 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment