]> arthur.barton.de Git - netdata.git/blobdiff - charts.d/cpu_apps.chart.sh
Merge pull request #646 from ktsaou/master
[netdata.git] / charts.d / cpu_apps.chart.sh
index 735ac30b3e1399d12ec99881178441e68e846095..5a25163e1398ee4dda91c26bb1b3405f7a15229f 100755 (executable)
@@ -1,10 +1,14 @@
 #!/bin/sh
 
-cpu_apps_apps="netdata asterisk squid apache2 mysqld dovecot cupsd sshd named clamd smbd"
+# THIS PLUGIN IS OBSOLETE
+# USE apps.plugin INSTEAD
+
+# a space separated list of command to monitor
+cpu_apps_apps=
 
 # these are required for computing memory in bytes and cpu in seconds
 #cpu_apps_pagesize="`getconf PAGESIZE`"
-cpu_apps_clockticks="`getconf CLK_TCK`"
+cpu_apps_clockticks="$(getconf CLK_TCK)"
 
 cpu_apps_update_every=60
 
@@ -15,7 +19,7 @@ cpu_apps_check() {
 
        if [ -z "$cpu_apps_apps" ]
        then
-               echo >&2 "cpu_apps: Please set cpu_apps_apps='command1 command2 ...' in $confd/cpu_apps_apps.conf"
+               echo >&2 "$PROGRAM_NAME: cpu_apps: Please set cpu_apps_apps='command1 command2 ...' in $confd/cpu_apps_apps.conf"
                return 1
        fi
        return 0
@@ -25,7 +29,7 @@ cpu_apps_bc_finalze=
 
 cpu_apps_create() {
 
-       echo "CHART apps.cpu '' 'Apps CPU' 'milliseconds / $cpu_apps_update_every sec' apps apps stacked 20001 $cpu_apps_update_every"
+       echo "CHART chartsd_apps.cpu '' 'Apps CPU' 'milliseconds / $cpu_apps_update_every sec' apps apps stacked 20001 $cpu_apps_update_every"
 
        local x=
        for x in $cpu_apps_apps
@@ -44,7 +48,7 @@ cpu_apps_update() {
        # for each dimension
        # remember: KEEP IT SIMPLE AND SHORT
 
-       echo "BEGIN apps.cpu"
+       echo "BEGIN chartsd_apps.cpu"
        ps -o pid,comm -C "$cpu_apps_apps" |\
                grep -v "COMMAND" |\
                (