In your zabbix_agentd.conf, enter this for your user parameters:
Code:
UserParameter=cpu.mysql,ps -eo pcpu,pid,user | grep mysql | sort -k 1 -r | awk -- 'BEGIN { total=0 } { total += $1 } END { print total }'
UserParameter=cpu.apache,ps -eo pcpu,pid,user | grep www-data | sort -k 1 -r | awk -- 'BEGIN { total=0 } { total += $1 } END { print total }'
Although it is worth noting you are actually measuring a user there rather than a specific process/application.
Comment