X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=charts.d%2Fcpu_apps.chart.sh;h=8e075831a5b51a9f6485ed9a410663914a9b2cef;hb=12c44a2888801ecd4d163ca8f4f9b6731bb6ecd2;hp=5f36e8658210e7b28e0122115c8e4f9b92cd3034;hpb=bdf5738fcf96e6ba89ca022594d66d73eefbf91c;p=netdata.git diff --git a/charts.d/cpu_apps.chart.sh b/charts.d/cpu_apps.chart.sh old mode 100755 new mode 100644 index 5f36e865..8e075831 --- a/charts.d/cpu_apps.chart.sh +++ b/charts.d/cpu_apps.chart.sh @@ -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 +# 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" |\ (