root / plugins / nginx / nginx_working_set @ f77cbb87
Historique | Voir | Annoter | Télécharger (390 octets)
| 1 | f77cbb87 | Mike Koss | #!/bin/bash |
|---|---|---|---|
| 2 | # |
||
| 3 | # Munin plugin for monitoring Nginx working set |
||
| 4 | # |
||
| 5 | # --- |
||
| 6 | |||
| 7 | if [ "$1" == config ]; then |
||
| 8 | cat <<'EOF' |
||
| 9 | graph_title NGINX Working Set |
||
| 10 | graph_vlabel WS Bytes |
||
| 11 | graph_category nginx |
||
| 12 | graph_args --base 1024 |
||
| 13 | ws.label Working Set |
||
| 14 | EOF |
||
| 15 | exit 0 |
||
| 16 | fi |
||
| 17 | |||
| 18 | KBS=$(ps -o rss --no-heading -p $(pidof nginx)) |
||
| 19 | total=0 |
||
| 20 | for size in $KBS |
||
| 21 | do |
||
| 22 | total=$(($total + $size * 1024)) |
||
| 23 | done |
||
| 24 | echo ws.value $total |
