This plugin gathers useful information from the Apache log file for both monitoring and alert purposes. This plugin tails the Apache access log based on the Apache LogFormat directive that you supply. The Apache plugin will help you get started monitoring more data from the Apache log.
And the dataum to be monitored and plotted are (but is not limited to):
The error hits acceleration and response time acceleration can be useful for detecting whether or not there is a problem with how pages are being served to clients or whether a problem will exist in the near future.
For example, if the response time acceleration increases (> 0.0), it could be caused by too many hits to the site, which might cause the site to slow down or perhaps it is caused by a problem with the application, etc. You could also use the response time rate to help predict when the server will start to break down if it continues to increase at the same rate.
You can also set up an alert specification so that your system administrator receives an email notification when problems occur.
Use the following steps to set up the Apache plugin to collect and monitor Apache response time data so that you can use one of the predefined alert specifications to take action when problems related to Apache response times occur.
Before you can view any of the response time data, you must first modify the Apache configuration. In order to enable the collection of response time data, you must add the "response time" (%D) to the Apache LogFormat Directive and also input the LogFormat to the plugin by using the "-l" option. By default, Apache uses the LogFormat "combined" format:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
and the plugin uses the same format for the "-l" option:
"-l" "%h %l %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
You must add the SYS Monitoring Apache Log Add RightScript to your ServerTemplate in order to monitor the Apache response data. Import this RightScript from the MultiCloud Marketplace.
You may want to set up an alert specification and escalation that sends an email when Apache-related problems occur. You can either use one of the alert specifications related to Apache or create your own. See Design -> Alerts - > Specifications.
This collectd exec plugin gathers Apache info by parsing the apache log file. This plugin demostrates a simple way to create a custom collectd plugin for monitoring purposes.
-f, --apache-log FILE
This is the absolute path of the Apache access log. (default: /var/log/httpd/access_log)
-l, --apache-logformat LOGFORMAT
Parsing the log requires the Apache LogFormat directive for this log file. (default: Apache 'combined' LogFormat)
-b, --backup-log FILE
This option sets the path where the file is backed up, which restores the data from last time. (default: /tmp/apache_log_monitor.backup)
-i, --hostid INSTANCE ID
The instance id of which the data is being collected.
-n, --sampling-interval INTERVAL
The interval (in seconds) between each sampling. The max interval is 15 seconds. (default: 10 seconds)
-a, --acceleration-interval INTERVAL
The interval (in seconds) between each acceleration rate sampling. (default: 300 seconds)
-h, --help
Once you've installed the plugin, you can find it in /usr/lib*/collectd/plugin. You can change configuration options by modifying /etc/collectd.d/apache_log_monitor.conf .
<Plugin exec> # userid plugin executable plugin args Exec "apache" "$collectd_dir/plugins/apache_log_monitor" "-l" "%h %l %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" </Plugin>
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.