diff --git a/plugins/nginx/nginx_working_set b/plugins/nginx/nginx_working_set new file mode 100755 index 00000000..c2a5c8e6 --- /dev/null +++ b/plugins/nginx/nginx_working_set @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Munin plugin for monitoring Nginx working set +# +# --- + +if [ "$1" == config ]; then + cat <<'EOF' +graph_title NGINX Working Set +graph_vlabel WS Bytes +graph_category nginx +graph_args --base 1024 +ws.label Working Set +EOF + exit 0 +fi + +KBS=$(ps -o rss --no-heading -p $(pidof nginx)) +total=0 +for size in $KBS +do + total=$(($total + $size * 1024)) +done +echo ws.value $total