]> arthur.barton.de Git - netdata.git/blobdiff - charts.d/cpu_apps.chart.sh
ab-debian 0.20170327.01-0ab1, upstream v1.6.0-42-gaa6b96fc
[netdata.git] / charts.d / cpu_apps.chart.sh
old mode 100755 (executable)
new mode 100644 (file)
index 5f36e86..8e07583
@@ -1,10 +1,19 @@
-#!/bin/sh
+# no need for shebang - this file is loaded from charts.d.plugin
 
-cpu_apps_apps="netdata asterisk squid apache2 mysqld dovecot cupsd sshd named clamd smbd"
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# 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 +24,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"
+               error "manual configuration required: please set cpu_apps_apps='command1 command2 ...' in $confd/cpu_apps_apps.conf"
                return 1
        fi
        return 0
@@ -25,12 +34,12 @@ 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
        do
-               echo "DIMENSION $x $x incremental 1000 $((cpu_apps_clockticks * cpu_apps_update_every))"
+               echo "DIMENSION $x $x incremental 1000 $cpu_apps_clockticks"
 
                # this string is needed later in the update() function
                # to finalize the instructions for the bc command
@@ -44,7 +53,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" |\
                (