From e7fbfe0b8b12cde37600298ee4878a993ea798e2 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Tue, 21 Apr 2020 19:51:02 +0200 Subject: [PATCH] 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/apache/apache_memmory b/plugins/apache/apache_memmory index 1390d4dc..2a391ee5 100755 --- a/plugins/apache/apache_memmory +++ b/plugins/apache/apache_memmory @@ -43,8 +43,8 @@ fi if [ "$1" = "config" ]; then echo 'graph_title Average size of apache child processes' - echo 'graph_args --base 1000 -l 0 ' - echo 'graph_vlabel Kb' + echo 'graph_args --base 1024 -l 0 ' + echo 'graph_vlabel Bytes' echo 'graph_scale no' echo 'graph_category webserver' echo 'graph_info Indicate the memdium size of all the apache child process.' @@ -58,7 +58,7 @@ fi matched_processes=$(ps auxf | grep -- "$PROCS" | grep "^$USR" | grep -v grep) if [ -n "$matched_processes" ]; then - average_memory=$(printf '%s' "$matched_processes" | awk '{count+=1; sum+=$6} END {print sum/count}') + average_memory=$(printf '%s' "$matched_processes" | awk '{count+=1; sum+=$6} END {print sum / count * 1024}') else average_memory="U" fi