Created
March 16, 2017 19:49
-
-
Save milkpirate/395312cf8d59e34c9362ac5e4c9e6482 to your computer and use it in GitHub Desktop.
Icinga plugin - core frequencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Read core number from /proc/cpuinfo and display frequency of each | |
# count the processor fields and display the number | |
awk '/processor/ {core_count++} END{print "CPU OK:", core_count, "CPUs;"}' \ | |
/proc/cpuinfo | |
# get the frequency for each core and keep track of core id via counter | |
awk 'BEGIN{printf "| "} /cpu MHz/ {print core_id++ "=" $4}' \ | |
/proc/cpuinfo | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment