Skip to content

Instantly share code, notes, and snippets.

@himynamesdave
Last active August 29, 2015 14:01
Show Gist options
  • Save himynamesdave/a7a8c42d678cf5dd2fa9 to your computer and use it in GitHub Desktop.
Save himynamesdave/a7a8c42d678cf5dd2fa9 to your computer and use it in GitHub Desktop.
Splunk Raspberry Pi CPU Monitor
#! /bin/sh
for c in $(seq 1 60)
do
TIME=$(date +"%D %T.%3N %Z")
TEMP=$(vcgencmd measure_temp)
VOLTS=$(vcgencmd measure_volts)
CPU_TEMP=`echo $TEMP | cut -d \' -f 1`
VOLTS=`echo $VOLTS | cut -d V -f 1`
echo "time=$TIME|$VOLTS|$CPU_TEMP"
sleep 1
done
[default]
host = raspberrypi
[script:///opt/piforwarder/bin/scripts/cpu.sh]
index = raspberrypi
interval = 60
source = cpu_details
sourcetype = pi_system_scripts
[tcpout]
defaultGroup=my_indexers
[tcpout:my_indexers]
server=XX.XXX.XX.XXX:9997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment