| Osmius Agent Apache | |
|
| Agent name: osm_ag_APACHE01 | Agent code: APACHE01 | |
| Content: | User manual for Osmius's Apache 1.3 o 2.x web servers agent | |
| Date created: 26/06/2008 | Date reviewed: 30/06/2008 | |
This Agent can monitor different parameters from an Apache server. It has been tested in:Apache/2.3.5 (Unix) mod_ssl/2.3.5 OpenSSL/0.9.7d mod_fcgid/2.3.2-dev, Apache/2.2.8 (Ubuntu) and Apache/1.3.31 (Unix) mod_perl/1.24. However, we strongly recommend to test it in a production environment before implanting it.
Apache agent has been developed using the functionalities and improvements of the Osmius framework and ACE libraries. Thus, it is mandatory to install ACE libraries to use this agent. In case of doubt, read the chapter: installation.
Apache agent provides eleven basic events with configuration parameters to allow scalability in an easy way. Events has been selected by the Osmius's R&D team as the most interesting for the first development.
All events are remote and Apache server-status based. Agent checks the information returned by the Apache server through server-status page and then builds a response. Check if your Apache has server-status.
To learn how to activate server-status go to: Apache agent prerequisites
Each Osmius agent usually can monitor one type of instance. If you are unaware of the concepts please go to the glossary. Each instance is defined individually in the configuration file (if you want more information please go to agents and instances). Depending on each agent we have to define the instance type and its connection info.
connection_info or connection information is the information that the agent needs to be able to connect to the instance (more information in connection_info).
In the Osmius's Apache agent case the connection_info prototype would be:
CONNECTION_INFO= -u URL_SEVER-STATUS [-p PORT]
Where we will replace in each declared instance:
An example could be:
CONECTION_INFO = -u http://localhost/server-status -p 8080 CONECTION_INFO = -u http://80.53.24.123/server-status
Type defines the type of instance to be monitored. All instances declared must have an associated type as you can see here
In Apache case:
TYPE= APACHE01
| EVENT | DESCRIPTION | c | w | a | tseconds | Extra parameter / Remarks |
|---|---|---|---|---|---|---|
| AVAILABL | Availability of the Apache connection | 1 | 0 | 0 | 60 | Silence mode ( -s) recommended |
| APPARSER | Parent Server generated by Apache | 0 | Administrator | Administrator | 120 | Silence mode ( -s) recommended |
| APUPTIME | Execution time of Apache in seconds | 1 | 600 | 300 | 600 | Silence mode ( -s) recommended |
| APTOTACC | Number of total access | 0 | Administrator | Administrator | 300 | Silence mode ( -s) recommended |
| APTRAFFI | MB of the Apache traffic | 0 | Administrator | Administrator | 3600 | Silence mode ( -s) recommended |
| APPRCCPU | % CPU consummed by Apache | 0 | Administrator | Administrator | 600 | Silence mode ( -s) recommended |
| APREQMIN | Average number of request per minute | 0 | Administrator | Administrator | 900 | Silence mode ( -s) recommended |
| APKBSSEC | Average KB per request | 0 | Administrator | Administrator | 900 | Silence mode ( -s) recommended |
| APKBSREQ | Average KB per request | 0 | Administrator | Administrator | 900 | Silence mode ( -s) recommended |
| APCURREQ | Number of actual requests | 0 | Administrator | Administrator | 120 | Silence mode ( -s) recommended |
| APIDLWRK | Number of inactive Apache servers | 1 | Administrator | Administrator | 900 | Silence mode ( -s) recommended |
Info events recover generic information that don't change very often from the instance. This type of events doesn't have severity, they just offer details about the instance.
| EVENT | DESCRIPTION | tseconds | Remarks |
|---|---|---|---|
| APINFTIT | Title | 86400 (1 day) | attribute “title” |
| APINFVER | Version | 86400 (1 day) | Apache version |
| APINFBLT | Built | 86400 (1 day) | Information about the version built |
| APINFRTM | Restart time | 86400 (1 day) | Date when Apache was reset |
AVAILABL checks if Apache server is responding requests. It returns Apache version and associated text as well.
Returned values:
| VALUE | MEANING |
| 1 | Available |
| 0 | Unavailable |
| -1 | Error |
Recommended parameters:
| Comparison type | Inverted. The higher the value the lesser the severity. (-c 1) |
| Monitor interval | 300 seconds – 1 hour –> depends on the instance importance |
| Warning threshold | 0 |
| Alert threshold | 0 |
Configuration example:
AVAILABL = -t 60 -c 1 -w 0 -a 0 -T "Apache Intranet"
Remarks: Apache server version is showed in the text associated to the event. For example: Apache/2.2.8 (Ubuntu).
APPARSER returns the number of Parent Servers generated by Apache.
Returned values:
| VALUE | MEANING |
| -1 | Error |
| X | Number of parent server generated |
Recommended parameters:
| Comparison type | Direct. The higher the value, the higher the severity (-c 0) |
| Monitor interval | 300 seconds – 1 hour –> depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APPARSER = -t 120 -c 0 -w 25 -a 60 -T "example.com server generation"
Remarks: None.
APUPTIME returns the time that Apache has been working since its last restart.
Return values:
| VALUE | MEANING |
| -1 | Error |
| X | Number of seconds |
Recommended parameters:
| Comparison type | Inverted. The higher the value the lesser the severity (-c 1) |
| Monitoring interval | 300 seconds – 1 hour –> depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APUPTIME = -t 300 -c 1 -w 250 -a 100 -T "example.com uptime"
Remarks: Time will be returned in the event's associated text: [X] days [Y] hours [Z] minutes [W] seconds.
APTOTACC returns the number of global access to Apache.
Return values:
| VALUE | MEANING |
| -1 | Error |
| X | Number of access |
Recommended parameters:
| Comparison type | Direct. The higher the value, the higher the severity (-c 0) |
| Monitoring interval | 60 seconds – 1 week –> depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APTOTACC = -t 300 -c 0 -w 1000 -a 10000 -T "example.com total access"
Remarks: None.
APTRAFFI returns the average Apache traffic.
Return values:
| VALUE | MEANING |
| -1 | Error |
| X | MB traffic |
Recommended parameters:
| Comparison type | Direct. The higher the value, the higher the severity (-c 0) |
| Monitor interval | 600 seconds – 1 day –> depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APTRAFFI = -t 3600 -c 0 -w 512 -a 1024 -T "example.com traffic in MB"
Remarks:
Event's associated text shows a conversion of the traffic to a more reasonable measure if it's needed: kB, GB …
For example: Total traffic in MB[2048] 2.0 GB
APPRCCPU returns the percentage of CPU consumed by Apache.
Returned values:
| VALUE | MEANING |
| -1 | Error |
| X | % CPU used |
Recommended parameters:
| Comparison type | Direct. The higher the value, the higher the severity (-c 0) |
| Monitor interval | 60 seconds – 1 hour –> depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APPRCCPU = -t 600 -c 0 -w 70 -a 85 -T "example.com Apache CPU Usage percentage"
Remarks: None.
APREQMIN returns the average requests per minute received by Apache.
Returned values:
| VALUE | MEANING |
| -1 | Error |
| X | Requests per minute |
Recommended parameters:
| Comparison type | Direct. The higher the value, the higher the severity (-c 0) |
| Monitor interval | 60 seconds – 1 hour –> depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APREQMIN = -t 900 -c 0 -w 5 -a 10 -T "requests per minute in ApacheCPD3"
Remarks: Average requests per seconds is returned in the event's associated text
APKBSSEC returns the average kbytes sent.
Returned values:
| VALUE | MEANING |
| -1 | Error |
| X | KB/s sent |
Recommended parameters:
| Comparison type | Direct. The higher the value, the higher the severity (-c 0) |
| Monitor interval | Depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APKBSSEC = -t 900 -c 0 -w 150 -a 250 -T "KB/s Apache154"
Remarks: None.
APKBSREQ returns the average KBs per request.
Returned values:
| VALUE | MEANING |
| -1 | Error |
| X | KBs per request |
Recommended parameters:
| Comparison type | Direct. The higher the value, the less critical state (-c 0) |
| Monitor interval | Depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APKBSREQ = -t 900 -c 0 -w 100 -a 256 -T "KBs per request in WebInterna"
Remarks: None.
APCURREQ returns the number of current requests.
Returned values:
| VALOR | SIGNIFICADO |
| -1 | Error |
| X | Current requests |
Recommended parameters:
| Comparison type | Direct. The higher the value, the higher the severity (-c 0) |
| Monitor interval | Depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APCURREQ = -t 120 -c 0 -w 10 -a 20 -T "Current requests in Apache"
Remarks: None.
APIDLWRK returns the number of inactive workers o servers in Apache.
Returned values:
| VALUE | MEANING |
| -1 | Error |
| X | Inactive servers |
Recommended parameters:
| Comparison type | Inverted. The higher the value the lesser the severity. (-c 1) |
| Monitor interval | 300 seconds – 1 hour –> depends on the instance importance |
| Warning threshold | Ask to Apache admin |
| Alert threshold | Ask to Apache admin |
Configuration example:
APIDLWRK = -t 900 -c 1 -w 25 -a 10 -T "Inactive servers"
Remarks: None.
To be able to compile this agent we need some prerequisites that are generic for the compilation of any Osmius agent, you may know more about them in: prerequisites.
Specifically, for the Osmius's Apache agent we need to install mod_status or mod_info, depending on the Apache version. We do this in order to activate the web page “server-status” generated by Apache.
For the Apache version 1.3 we must install mod_status and for Apache 2.x mod_info. Go to this web to get more information about Apache modules: http://modules.apache.org/
To conclude we have to activate the Apache directive ExtendedStatus, to do this we must add the next sentence in the Apache config file:
ExtendedStatus On
Make sure that you can reach the server-status page from the Apache agent location. In our case, we had to edit status.conf file (/etc/apache2/mods_enabled) and add a command named Allow from followed by the agent host IP.
From the agent folder using the console or terminal.
Linux:
$ACE_ROOT/bin/mpc.pl -type make osm_ag_apache.mpc
HP-UX:
$ACE_ROOT/bin/mpc.pl -type gnuace osm_ag_apache.mpc
Windows with Visual C 8:
%ACE_ROOT\bin\mpc.pl -type vc8 osm_ag_apache.mpc
Linux:
make -f Makefile.Osm_Ag_Apache_Osmius
HP-UX:
gmake -f Makefile.Osm_Ag_Apache_Osmius
Windows:
Double click over Osm_Ag_Apache_Osmius.vcproj and the project will be opened in Visual Studio. In the configuration of the solution select Release. Press Rebuild to compile.
Binaries will be automatically installed in the bin folder of the OSM_ROOT base
Apache agent shares the same execution caracteristics with the rest of the agents. You can learn more in Starting and stopping agents.
To execute Apache agent:
| osm_ag_APACHE01[.exe]1) -c osm_ag_APACHE01.ini -m MASTERAG -p 1950 -d [>> osm_ag_apache.log]2) |
Osmius's Apache agent, as the others Osmius agents, allows the execution in standalone mode. This option can be useful when we are developing a new agent or to perform concept tests of an agent.
You only must add a new value in the configuration file of the Apache agent (osm_ag_APACHE01.ini) named SNDCMD as you can see here.
Then you have to execute the Apache agent setting the communications port with the Master Agent to zero. For example:
| osm_ag_APACHE01[.exe]3) -c osm_ag_APACHE01.ini -m 00000000 -p 0 -d |
Tests made to Osmius's Apache agent.
| Date: | 26/06/2008 | |
|---|---|---|
| Test | Result | Remarks |
| Creation of an instance with all its events in silent mode | OK | N/A |
| Creation of an instance with all its events with custom text | OK | N/A |
| Creation of an instance with all its events without custom text | OK | N/A |
| Declaration of 3 instances with all its events to 5 seconds and holding in execution for 48 hours | OK | N/A |
| Declaration of 2 instances, cause desconnection of one and then reconnect | OK | N/A |
| Declare 1 iunstance and test each event | OK | N/A |
| Delete global parameter and check that it doesn't run | OK | Se ha borrado PORTCM |
| Delete instance CONN_INFO and check that it doesn't run | OK | N/A |