Initial commit
This commit is contained in:
commit
33882d5455
13 files changed
+543
No files matched your search
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Loop through all hard drives and read their temperatures
|
||||
for DEVICE in /dev/sd[a-z]; do
|
||||
# Check if the device is a disk (not a partition)
|
||||
if [ -b "$DEVICE" ]; then
|
||||
# Get the temperature from smartctl
|
||||
TEMPERATURE=$(/usr/sbin/smartctl -A $DEVICE | grep "Temperature_Celsius" | awk '{print $10}')
|
||||
|
||||
# If the temperature is not empty, push it to Ganglia using gmetric
|
||||
if [ -n "$TEMPERATURE" ]; then
|
||||
gmetric --name ${DEVICE##*/}_temp --value $TEMPERATURE --type float --units C --group=sensors
|
||||
fi
|
||||
fi
|
||||
done
|
||||
Reference in new issue
Block a user