Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / nginx / nginx_working_set @ a7139bca

Historique | Voir | Annoter | Télécharger (593 octets)

1
#!/bin/bash
2
#
3
# Munin plugin for monitoring Nginx working set
4
#
5
# by Mike Koss, Feb 12, 2012 - MIT License
6
#
7
#%# family=auto
8
#%# capabilities=autoconf
9

    
10
case $1 in
11
config)
12
    cat <<'EOF'
13
graph_title NGINX Working Set
14
graph_vlabel WS Bytes
15
graph_category webserver
16
graph_args --base 1024
17
ws.label Working Set
18
EOF
19
    exit 0
20
    ;;
21

    
22
autoconf)
23
    if [ "$(pidof nginx)" == "" ]; then
24
        echo no
25
    else
26
        echo yes
27
    fi
28
    exit 0
29
    ;;
30
esac
31

    
32
KBS=$(ps -o rss --no-heading -p $(pidof nginx))
33
total=0
34
for size in $KBS
35
do
36
    total=$(($total + $size * 1024))
37
done
38
echo ws.value $total