Skip to content

Instantly share code, notes, and snippets.

@milkpirate
Created March 16, 2017 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milkpirate/395312cf8d59e34c9362ac5e4c9e6482 to your computer and use it in GitHub Desktop.
Save milkpirate/395312cf8d59e34c9362ac5e4c9e6482 to your computer and use it in GitHub Desktop.
Icinga plugin - core frequencies
#!/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