Skip to content
Snippets Groups Projects
Commit b7b596de authored by Mike Hanby's avatar Mike Hanby
Browse files

Update Context Switch Check to use Prometheus as Datasource

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:

```shell
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]')
```
parent 9d411ec3
No related branches found
No related tags found
1 merge request!6Update Context Switch Check to use Prometheus as Datasource
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment