1 # no need for shebang - this file is loaded from charts.d.plugin
4 # real-time performance and health monitoring, done right!
5 # (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
11 # these are required for computing memory in bytes and cpu in seconds
12 #mem_apps_pagesize="`getconf PAGESIZE`"
13 #mem_apps_clockticks="`getconf CLK_TCK`"
15 mem_apps_update_every=
19 # - 0 to enable the chart
20 # - 1 to disable the chart
22 if [ -z "$mem_apps_apps" ]
24 error "manual configuration required: please set mem_apps_apps='command1 command2 ...' in $confd/mem_apps_apps.conf"
34 echo "CHART chartsd_apps.mem '' 'Apps Memory' MB apps apps.mem stacked 20000 $mem_apps_update_every"
37 for x in $mem_apps_apps
39 echo "DIMENSION $x $x absolute 1 1024"
41 # this string is needed later in the update() function
42 # to finalize the instructions for the bc command
43 mem_apps_bc_finalze="$mem_apps_bc_finalze \"SET $x = \"; $x;"
49 # do all the work to collect / calculate the values
51 # remember: KEEP IT SIMPLE AND SHORT
53 echo "BEGIN chartsd_apps.mem"
54 ps -o comm,rss -C "$mem_apps_apps" |\
56 ( sed -e "s/ \+/ /g" -e "s/ /+=/g";
57 echo "$mem_apps_bc_finalze"