Révision e7fbfe0b
Plugin apache_memory: use base SI units for result
Munin will take care for proper units dynamically.
This breaks previously existing graphs.
| plugins/apache/apache_memmory | ||
|---|---|---|
| 43 | 43 |
if [ "$1" = "config" ]; then |
| 44 | 44 |
|
| 45 | 45 |
echo 'graph_title Average size of apache child processes' |
| 46 |
echo 'graph_args --base 1000 -l 0 '
|
|
| 47 |
echo 'graph_vlabel Kb'
|
|
| 46 |
echo 'graph_args --base 1024 -l 0 '
|
|
| 47 |
echo 'graph_vlabel Bytes'
|
|
| 48 | 48 |
echo 'graph_scale no' |
| 49 | 49 |
echo 'graph_category webserver' |
| 50 | 50 |
echo 'graph_info Indicate the memdium size of all the apache child process.' |
| ... | ... | |
| 58 | 58 |
|
| 59 | 59 |
matched_processes=$(ps auxf | grep -- "$PROCS" | grep "^$USR" | grep -v grep) |
| 60 | 60 |
if [ -n "$matched_processes" ]; then |
| 61 |
average_memory=$(printf '%s' "$matched_processes" | awk '{count+=1; sum+=$6} END {print sum/count}')
|
|
| 61 |
average_memory=$(printf '%s' "$matched_processes" | awk '{count+=1; sum+=$6} END {print sum / count * 1024}')
|
|
| 62 | 62 |
else |
| 63 | 63 |
average_memory="U" |
| 64 | 64 |
fi |
Formats disponibles : Unified diff