2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/nginx/nginx_working_set
Mike Koss f77cbb8707 Simpler nginx working set plugin. Replaces nginx_memory (which displays total of virtual memory)
and ngnix_memory (sic) which has a bug including non-nginx processes.
2012-02-13 10:53:16 -08:00

25 lines
390 B
Bash
Executable File

#!/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