From 0a93505b10fd05d52b4804ce85f8c042c981c079 Mon Sep 17 00:00:00 2001 From: zebra Date: Fri, 5 Jul 2024 18:02:30 -0700 Subject: [PATCH] New CPU Temp Script --- poweredge-cputemp.sh | 15 +++++++++++++++ readme.md | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 poweredge-cputemp.sh diff --git a/poweredge-cputemp.sh b/poweredge-cputemp.sh new file mode 100644 index 0000000..e4cafc0 --- /dev/null +++ b/poweredge-cputemp.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Run sensors command and store the output +sensors_output=$(sensors) + +# Extract temperatures for each CPU and find the highest core temp for each CPU +cpu1_temps=$(echo "$sensors_output" | awk '/coretemp-isa-0000/ {p=1} /coretemp-isa-0001/ {p=0} p' | awk '/Core/ {print $3}' | sort -n | tail -n 1) +cpu2_temps=$(echo "$sensors_output" | awk '/coretemp-isa-0001/ {p=1} /i350bb-pci-0103/ {p=0} p' | awk '/Core/ {print $3}' | sort -n | tail -n 1) + +# Strip out the + and degree symbol from temperatures +cpu1_temps_clean=$(echo "$cpu1_temps" | tr -d '+°') +cpu2_temps_clean=$(echo "$cpu2_temps" | tr -d '+°') + +# Format the final output +echo "CPU0: ${cpu1_temps_clean} | CPU1: ${cpu2_temps_clean}" diff --git a/readme.md b/readme.md index f8ddef8..9c386da 100644 --- a/readme.md +++ b/readme.md @@ -11,7 +11,6 @@ Conglomeration of PowerShell scripts to be used in tandem with an RMM
  • nvgpuload.sh - Checks GPU load and returns to stdout, also sends data via CURL
  • nvgputemp.sh - Checks GPU temps and returns to stdout, also sends data via CURL
  • officeversion.ps1 - Returns MS Office version in console
  • +
  • poweredge-cputemp.sh - Gets the CPU temp of a dual processor server (Dell PowerEdge in my use case) and returns the highest core temperature for both CPUs
  • spacesniffer-deploy.ps1 - Downloads SpaceSniffer and generates a SpaceSniffer snapshot file of desired drive.
  • - -