Skip to content

Update Context Switch Check to use Prometheus as Datasource

Mike Hanby requested to merge update-context-switch-check-now-poll-prometheus into main

The previous method of using data returned by node_exporter was invalid, as it returns a total since boot.

The new method queries Prometheus to get a rate change of the same metric:

HW_CONTEXT_SWITCH_RATE=$(curl -fs --data-urlencode "query=irate(node_context_switches_total{job=\"compute-node\",name=\"$NODENAME\"}[$HW_CONTEXT_SWITCH_INTERVAL])" http://nagios.rc.uab.edu:9090/api/v1/query | jq -r '.data.result[] | .value[1]')

Merge request reports