#!/usr/bin/env bash # #(c) 2004-present, Facebook, all rights reserved. # See the LICENSE file for usage and distribution rights. # trap 'echo "Caught exception, dying"; exit' 1 2 3 15 ME=`basename $0` SERVER=`hostname` #parameters used # Dump_Config=0 DEBUG= OS=`/bin/uname -s` VMEM= RSS= CPU= VERBOSE= VAR= LIMIT= ACTION= N= WAIT= # #supported OS: Linux only for now. Easy to add # oscheck() { case ${OS} in Linux) VMEM=vsz RSS=rss CPU=bsdtime ;; *) die "Unsupported OS ${OS}. Send a bug report with OS you need supported. Thanks." ;; esac } verbose() { if [ "x$DEBUG" != "x" ]; then echo "$@" >&2 fi } warn() { echo "$@" >&2 } die() { echo "ERROR: " "$@" >&2; exit; } dump_config() { cat <