Simple bash system monitor script

Uses nvclock (for nvidia gpu’s) and sensors
and chances are you’re gonna have to edit it some to get it to work :p

#!/bin/bash
heh=(`sensors|egrep "fan[1-3]|temp"|awk '{print $1$2}'&&
nvclock -i|egrep 'temp|RPM|PWM'|sed 's/PWM duty cycle://g; s/Fanspeed/Speed/g; s/ temperature//g; s/RPM\n/RPM/g'|sed ':q;N;s/RPM\n/RPM/g;t q'|sed 's/ /:/g'`)
for i in {0..8}
do
	out[$i]=`echo ${heh[$i]}|sed 's/:/: /g'`
done
echo -e "${out[0]}\t| ${out[3]}\t|${out[6]}\n${out[1]}\t| ${out[4]}\t|${out[7]}\n${out[2]}\t| ${out[5]}\t|${out[8]}"
unset heh out
output

Output

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>