-#!/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
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
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
# 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" |\
(