Based on a recommendation at the Zabbix forums, we updated this Zabbix template and
PERL script we are using to monitor our Apache2 server.
Here are the entries for zabbix_agentd.conf
Code:
UserParameter=apache2.total_accesses,cut -f1 -d":" /tmp/apache_data.txt
UserParameter=apache2.total_kbytes,cut -f2 -d":" /tmp/apache_data.txt
UserParameter=apache2.cpuload,cut -f3 -d":" /tmp/apache_data.txt
UserParameter=apache2.uptime,cut -f4 -d":" /tmp/apache_data.txt
UserParameter=apache2.reqpersec,cut -f5 -d":" /tmp/apache_data.txt
UserParameter=apache2.bytespersec,cut -f6 -d":" /tmp/apache_data.txt
UserParameter=apache2.bytesperreq,cut -f7 -d":" /tmp/apache_data.txt
UserParameter=apache2.busyworkers,cut -f8 -d":" /tmp/apache_data.txt
UserParameter=apache2.idleworkers,cut -f9 -d":" /tmp/apache_data.txt
UserParameter=apache2.totalworkers,cut -f10 -d":" /tmp/apache_data.txt
Basically, we have moved the
PERL script to a crontab running every minute and we then write the results to a /tmp file. Then the Zabbix agent reads the data from the file instead of calling the
PERL script 10 times. This is more efficient.
Also, we change the template to update every 60 seconds instead of 30 seconds to match the crontab entry.
Files attached. If you have any questions, please post here.