lorf / zapache

Zabbix Apache Monitoring Script (from https://www.zabbix.org/wiki/Docs/howto/apache_monitoring_script#Method_3, originally from https://www.zabbix.com/forum/showthread.php?p=62457)
85 stars 44 forks source link

zapache/CPULoad not working with Zabbix Agent 2.4.5 #5

Closed araghav closed 9 years ago

araghav commented 9 years ago

Hi,

We are using Apache on Ubuntu 14.04. We have installed Zabbix Agent 2.4.5 and using zapache version 1.5 for monitoring Apache performance. While zapache is working fine for all parameters for only CPULoad, it is reporting as ZBX_NOTSUPPORTED. Kindly note that it working fine with Zabbix Agent version 2.4.5 on CentOS 6.4 ad Zabbix Agent 2.2.2 on Ubuntu 14.04.

Could this be a specific issue with Zabbix Agent 2.4.5 on Ubuntu 14.04?

Please help.

Regards, Ananth

lorf commented 9 years ago

Can You please provide output of the following commands on apache server (or equivalent appropriate to your configuration):

zabbix_get -s localhost -k zapache[CPULoad]
curl http://localhost/server-status?auto
sudo -u zabbix bash -x /var/lib/zabbixsrv/externalscripts/zapache CPULoad
lorf commented 9 years ago

Also, please check zabbix agent logs, script's stderr goes there.

araghav commented 9 years ago

Hi,

The issue is solved now. Actually, it took a very long time, more than 6 hours, to get the CPULoad information and it automatically changed the status from "Not Supported" to "Enabled". Values were so low (0.0003%) - Actually, there was no load on Apache server when I started monitoring. When I activated multiple virtual hosts, proxies & reverse proxies, the values increased and it started to give meaningful readings.

One thing I could not understand, why it took such a long time to capture CPULoad values and reported as Not Supported at the first place?

Regards, Ananth

lorf commented 9 years ago

Sorry, I need more information to debug the issue, such as mentioned commands output with no load on apache server.

xiaobao623 commented 9 years ago

Hi,Lorf, I have same issue. If the web server no load, then CPULoad results will display ZBX_NOTSUPPORTED

Zabbix 2.4.5

If I press test web server,then can see the reults,but very very low.

Apache/CPULoad zapache[CPULoad] 60 7 365 Zabbix agent 08/19/2015 03:09:08 PM 0.33 %

#################### I put my test log befroe press test web server

[root@pxeserver ~]# netstat -antp|grep 10050 tcp 0 0 127.0.0.1:10050 0.0.0.0:* LISTEN 7142/zabbix_agentd
tcp 0 0 192.168.134.10:10050 0.0.0.0:* LISTEN 7142/zabbix_agentd
tcp 0 0 192.168.134.10:10050 192.168.134.234:33482 TIME_WAIT -
tcp 0 0 192.168.134.10:10050 192.168.134.234:33451 TIME_WAIT -

tcp 0 0 192.168.134.10:10050 192.168.134.234:33469 TIME_WAIT -
[root@pxeserver ~]# zabbix_get -s localhost -k zapche[CPULoad] [root@pxeserver ~]# curl http://localhost/server-status?auto Total Accesses: 4 Total kBytes: 31 Uptime: 134 ReqPerSec: .0298507 BytesPerSec: 236.896 BytesPerReq: 7936 BusyWorkers: 1 IdleWorkers: 7 Scoreboard: W_........................................................................................................................................................................................................................................................ [root@pxeserver ~]# bash -x /var/lib/zabbixsrv/externalscripts/zapache CPULoad

############### After press web server log

[root@pxeserver ~]# bash -x /var/lib/zabbixsrv/externalscripts/zapache CPULoad

lorf commented 9 years ago

@xiaobao623 Very thanks for info!