FreeBSD: collectd temperature Dell R210 II CPU & BMC
This file contains 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
#!/bin/sh | |
HOSTNAME="${COLLECTD_HOSTNAME:-`hostname -f`}" | |
INTERVAL="${COLLECTD_INTERVAL:-30}" | |
while sleep "$INTERVAL"; do | |
/sbin/sysctl -a | awk -F'[. ]' '/dev\.cpu\.[0-9]\.temperature/ {printf "%s %s\n",$3,$5}'|while read c t | |
do | |
echo "PUTVAL \"$HOSTNAME/temperature/temperature-cpu${c}\" interval=$INTERVAL N:${t%%.*}" | |
done | |
ipmi_output=$(/usr/local/bin/ipmitool sensor) | |
echo "$ipmi_output" | awk -F"|" '/Ambient Temp/ {printf "%d\n",$2}'|while read c | |
do | |
echo "PUTVAL \"$HOSTNAME/temperature/temperature-ambient\" interval=$INTERVAL N:${c%%.*}" | |
done | |
# this works to collectd but not to influxdb for some reason... | |
echo "$ipmi_output" | awk -F"[| ]" '/FAN [1-3] RPM/ {printf "%s %d\n",$2,$13}'|while read c t | |
do | |
echo "PUTVAL \"$HOSTNAME/rpm/count-fan${c}\" interval=$INTERVAL N:${t%%.*}" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment