Skip to content
Snippets Groups Projects
Mike Hanby's avatar
Mike Hanby authored
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]')
```
b7b596de
History
Name Last commit Last update