forked from jarus/munin-uwsgi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uwsgi_
38 lines (35 loc) · 876 Bytes
/
uwsgi_
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Copyright (c) 2011 Christoph Heer (Christoph.Heer@googlemail.com)
# License: BSD, see LICENSE for more details.
mode=`echo $0 | cut -d _ -f 2`
if [ "$1" = "suggest" ]; then
echo "memory"
echo "processes"
exit 0
fi
if [ "$mode" = "memory" ]; then
if [ "$1" = "config" ]; then
echo "graph_title uWSGI Memory"
echo "graph_vlabel RAM"
echo "graph_category uWSGI"
echo "graph_args --base 1024"
echo "ram.label RAM"
exit 0
else
echo -n "ram.value "
ps u -p $(pidof uwsgi uwsgi-core) | awk 'NR > 1 {nm += $5} END {print nm*1024}'
exit 0
fi
elif [ "$mode" = "processes" ]; then
if [ "$1" = "config" ]; then
echo "graph_title uWSGI Processes"
echo "graph_vlabel Processes"
echo "graph_category uWSGI"
echo "processes.label activ processes"
else
echo -n "processes.value "
ps -C 'uwsgi uwsgi-core' h | wc -l
exit 0
fi
fi
exit 0