I had apache on te same server ase Zabbix, and i want to graph apache activity, suche as number of connection, mb tranfer and other is anyboday have an idea to do it? thanks.
Ad Widget
Collapse
Monitoring apache activity
Collapse
X
-
Greetings,
There are a number of ways to do this, though I haven't sat down and worked out how to integrate them into Zabbix yet.
The first is to use the Apache internal stats system and feed data from it to various probes through the UserParam settings in the zabbix_agentd.conf file. If you use this feature, please be aware that this generates roughly the same load as two simultaneous static content requests against the Apache server. This data is almost all point in time data, and gives you an absolute status of the system at the point in time where the request is made.
The second option is to write a log parser to go through and read the Apache logs, taking that data and feeing it into various probes through the UserParam settings in the zabbix_agentd.conf file. This feature uses more or less resources depending on how well you code, and has the potential to be more accurate as it can show you the whole life of a single connection.
Personally, if I were to implement this capability myself, I would go with a combination of the two, with the understanding that I will be taking a bit of an overall performance hit on the system. As such, I would do the first method roughly every 30 seconds and the second method roughly every 5 minutes. -
We re doing it with zabbix agent using custom parameters.
1 - First of you need to use the server-status feature of apache (if you have it active else you just need to activate it in the config of apache and may be to re compile apache to have it if it was not compiled with it). To minimize the security problems, be sure to cnfig your apache so only you and the server can access the url with server-status.
2 - Then we create for example a lil script like this one to get the number of request processed by apache :
nbrequest.sh
This script will create a file called "status" parsed with awk to get the parameter you wish. We use wget to the html page from the apache server.
wget http://127.0.0.1/server-status -O /path_to_the_file_to_create/status >/dev/null 2>/dev/null
cat /path_to_the_file_to_create/status | awk '/Total accesses:/ {print $3}'
Be sure that zabbix will be able to run that script.
3 - Add the custom parameter in the zabbix agent config file :
UserParameter=apache[request],/path_to_your_script/apache_current.sh
4 - You can now create an item for your host , a zabbix agent type, with the key apache[request].
Note that this value is the total number of request so you ll want to use delta type value to get the number of request per second.
Yu can use this method for any value you can get by a shell script. It is best to get the value from a file isntead of getting it directly from a shell command in the zabbix agent config file to avoid any problems with zabbix agent getting stuck on a value.
I hope you understood this method, this is not the only way to do it, but by this one you can get any value you wish from whatever, system, network or application.
kayouLast edited by Kayou; 27-09-2005, 11:41.Comment
-
no probleme with the configuration of the user parameter i have allready do that in the past. but i need a cripts or something equivalent.
the script you propose will be tested it seems to work but i'll test it and say you if its ok in a few dayZabbix 1.8.3
SLES 11 x64
French Zabbix userComment
Comment