3 mem_apps_apps="netdata asterisk squid apache2 mysqld dovecot cupsd sshd named clamd smbd"
5 # these are required for computing memory in bytes and cpu in seconds
6 #mem_apps_pagesize="`getconf PAGESIZE`"
7 #mem_apps_clockticks="`getconf CLK_TCK`"
11 # - 0 to enable the chart
12 # - 1 to disable the chart
14 if [ -z "$mem_apps_apps" ]
16 echo >&2 "mem_apps: Please set mem_apps_apps='command1 command2 ...' in $confd/mem_apps_apps.conf"
26 echo "CHART apps.mem '' 'Apps Memory' MB apps apps stacked 20000 $update_every"
29 for x in $mem_apps_apps
31 echo "DIMENSION $x $x absolute 1 1024"
33 # this string is needed later in the update() function
34 # to finalize the instructions for the bc command
35 mem_apps_bc_finalze="$mem_apps_bc_finalze \"SET $x = \"; $x;"
41 # do all the work to collect / calculate the values
43 # remember: KEEP IT SIMPLE AND SHORT
46 ps -o comm,rss -C "$mem_apps_apps" |\
48 ( sed -e "s/ \+/ /g" -e "s/ /+=/g";
49 echo "$mem_apps_bc_finalze"