bondbig
13-11-2008, 09:36
Hi!
I've met a problem using zabbix_agentd "UserParameter":
UserParameter=apache.hitspersec,BASE=`date +%d/%b/%Y:%H:%M --date "now -1 minutes"`;HITS=`grep $BASE /var/log/apache2/access_log | wc -l`; echo "scale=1; $HITS / 60.0" | bc
I want to monitor Apache hits/s. When i run this command in OS it works:
ddos-victim2:~ # BASE=`date +%d/%b/%Y:%H:%M --date "now -1 minutes"`;HITS=`grep $BASE /var/log/apache2/access_log | wc -l`; echo "scale=1; $HITS / 60.0" | bc
68.2
but if i try to run agentd, i receive an error:
ddos-victim2:~ # /usr/local/sbin/zabbix_agentd -t apache.hitspersec
apache.hitspersec [m|ZBX_NOTSUPPORTED]
And zabbix_server receives '0' as a result:
http://img239.imageshack.us/img239/3521/chartlb4.png
How can i fix it?
I've met a problem using zabbix_agentd "UserParameter":
UserParameter=apache.hitspersec,BASE=`date +%d/%b/%Y:%H:%M --date "now -1 minutes"`;HITS=`grep $BASE /var/log/apache2/access_log | wc -l`; echo "scale=1; $HITS / 60.0" | bc
I want to monitor Apache hits/s. When i run this command in OS it works:
ddos-victim2:~ # BASE=`date +%d/%b/%Y:%H:%M --date "now -1 minutes"`;HITS=`grep $BASE /var/log/apache2/access_log | wc -l`; echo "scale=1; $HITS / 60.0" | bc
68.2
but if i try to run agentd, i receive an error:
ddos-victim2:~ # /usr/local/sbin/zabbix_agentd -t apache.hitspersec
apache.hitspersec [m|ZBX_NOTSUPPORTED]
And zabbix_server receives '0' as a result:
http://img239.imageshack.us/img239/3521/chartlb4.png
How can i fix it?