Skip to content

Instantly share code, notes, and snippets.

@jaymzcd
Created December 5, 2011 14:06
Show Gist options
  • Select an option

  • Save jaymzcd/1433676 to your computer and use it in GitHub Desktop.

Select an option

Save jaymzcd/1433676 to your computer and use it in GitHub Desktop.
log uptime via bash, plot results via pylab
# Bash command in a loop:
while true; do uptime >> /tmp/uptime.log; sleep 5; done
# Use awk to strip it out and grab 1min figure
awk -F\ '{print $9}' la.txt | tr "," " " > uptime_1min.csv
# In pylab (via:) run:
ipython --pyab
d = numpy.genfromtext('uptime_1min.csv')
plot(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment