Skip to content

Instantly share code, notes, and snippets.

@skarllot
Forked from jwilkins/heroku_entropy.sh
Created March 3, 2016 21:39
Show Gist options
  • Save skarllot/145ae3603ef10367e5fe to your computer and use it in GitHub Desktop.
Save skarllot/145ae3603ef10367e5fe to your computer and use it in GitHub Desktop.
monitor entropy on heroku dynos
#!/bin/bash
DATE="date +%Y%m%d%H%M%S"
RDATE="date +%Y%m%d%H%M%S"
IP='curl icanhazip.com'
ENTROPY='cat /proc/sys/kernel/random/entropy_avail'
LOG='heroku-entropy.log'
touch $LOG
while true; do
heroku run "echo \"$($DATE),\$($RDATE),\$($IP),\$DYNO,\$($ENTROPY)\"" 2>&1 | egrep "^20" >> $LOG;
done
# sample output:
#20130714201810,20130715031814,54.226.243.205,run.1274,146
#20130714201815,20130715031818,174.129.96.9,run.1940,130
#20130714201824,20130715031828,174.129.77.73,run.6384,171
#20130714201829,20130715031832,54.226.38.96,run.9209,273
#20130714201833,20130715031837,23.20.242.136,run.2136,159
#20130714201842,20130715031846,174.129.163.47,run.9930,131
#20130714201848,20130715031851,107.21.90.147,run.7665,134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment