Init checkin of context switch check code
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 fromnode_exporter
running on the local host -
uabrc_hw.nhc
- Bash script written in the NHC checks format. This script adds theuabrc_check_hw_context_switches
check available to use innhc.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)}