Skip to content

Instantly share code, notes, and snippets.

@drsnyder
Created March 23, 2012 16:27
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 drsnyder/2172448 to your computer and use it in GitHub Desktop.
Save drsnyder/2172448 to your computer and use it in GitHub Desktop.
Monitor Committed memory
#!/bin/bash
while true; do
date && cat /proc/meminfo | grep Commit | sed "s/[^0-9]*//g" | tr '\n' ' ' \
| awk '{ x=$2/$1; if (x > 1) { printf("Exceeded! %2.2f\n", $2 / $1) } else { printf("OK %2.2f\n", $2 / $1) }}';
sleep 5;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment