Skip to content

Instantly share code, notes, and snippets.

@pitluga
Created October 21, 2010 16:01
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 pitluga/638755 to your computer and use it in GitHub Desktop.
Save pitluga/638755 to your computer and use it in GitHub Desktop.
monitors memory usage of passenger rails processes and stuff monitored by monit. useful with watch
#!/bin/sh
passenger-status 10614 | grep global
echo
passenger-memory-stats 10614 | grep Rails
echo
/usr/local/bin/monit -c /srv/apps/ruby-app/current/config/monitrc -p /srv/apps/ruby-app/shared/pids/monit.pid -s /srv/apps/ruby-app/shared/system/monit.state status | awk '/Process/ { process=$2} /memory kilobytes tot/ { printf "%50s %7s\n", process, $4} ' | sed -e '$!N;s/\n//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment