Skip to content

Init checkin of context switch check code

Mike Hanby requested to merge init-checkin-context-switch-code into main

Initial checkin of of code to collect total context switches from Prometheus Node Exporter, running locally on each compute node.

Two scripts are being added:

  • node_context_switches.py - Python script that retrieves the current total context switch value from node_exporter running on the local host
  • uabrc_hw.nhc - Bash script written in the NHC checks format. This script adds the uabrc_check_hw_context_switches check available to use in nhc.conf

My initial thought was to write the collector in Python to make it easier to convert the result from scientific notation.

After further thought, I decided it would be simpler to put all of the code into the NHC check file. Thanks to Google Bard, it provided a simple awk statement that performs the scientific notation conversion awk '{printf("%d\n", $1*1e$2)}

Merge request reports