Skip to content

Instantly share code, notes, and snippets.

@n-johnson
Created January 14, 2016 10:46
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 n-johnson/59cc6da6e19d1b0a8d69 to your computer and use it in GitHub Desktop.
Save n-johnson/59cc6da6e19d1b0a8d69 to your computer and use it in GitHub Desktop.
remote cpu temp monitor
#!/bin/bash
host01_temp() {
local key="host01.cpu.temp"
local temp=$(ssh stats@10.0.0.1 sensors | grep 'Physical id' | awk -F':' '{print $2 }' | awk '{print $1}' | tr -d '+' | tr -d '°C')
echo "$key $temp"
}
statsd `host01_temp`
#!/bin/bash
key="$1"
value="$2"
date=$(date +%s)
echo "$key $value $date" | nc -q0 127.0.0.1 2003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment