From 240cf1fdb00336091b524edce728f7d6eb5f9980 Mon Sep 17 00:00:00 2001 From: Mike Koss Date: Tue, 14 Feb 2012 16:48:07 -0800 Subject: [PATCH] autoconf support --- plugins/nginx/nginx_working_set | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/plugins/nginx/nginx_working_set b/plugins/nginx/nginx_working_set index c2a5c8e6..04e8b809 100755 --- a/plugins/nginx/nginx_working_set +++ b/plugins/nginx/nginx_working_set @@ -2,9 +2,13 @@ # # Munin plugin for monitoring Nginx working set # -# --- +# by Mike Koss, Feb 12, 2012 - MIT License +# +#%# family=auto +#%# capabilities=autoconf -if [ "$1" == config ]; then +case $1 in +config) cat <<'EOF' graph_title NGINX Working Set graph_vlabel WS Bytes @@ -13,7 +17,17 @@ graph_args --base 1024 ws.label Working Set EOF exit 0 -fi + ;; + +autoconf) + if [ "$(pidof nginx)" == "" ]; then + echo no + else + echo yes + fi + exit 0 + ;; +esac KBS=$(ps -o rss --no-heading -p $(pidof nginx)) total=0