Red Hat Training

A Red Hat training course is available for Red Hat JBoss Operations Network

11. Apache Resources

Q: Where can I get the Apache connectors?
Q: I have instrumented Apache with the Response Time module, but no RT metrics are being shown for my VirtualHosts.
Q: Some of my Apache metrics show values of zero. Why?
Q: What is the Augeas plug-in?
Q: Why does my agent log have the error "java.lang.UnsatisfiedLinkError: Unable to load library 'augeas': libaugeas.so: cannot open shared object file: No such file or directory"?
Q: Why does my Apache SNMP module fail to start with an error?
Q:
Where can I get the Apache connectors?
A:
The Apache plug-in monitors an Apache Web server through custom modules like the SNMP connector. The connectors can be downloaded from the JBoss ON server on the Downloads page in the GUI.
Q:
I have instrumented Apache with the Response Time module, but no RT metrics are being shown for my VirtualHosts.
A:
If there are no RT metrics being displayed for your VirtualHosts there are two things you should check:
  1. Can the agent's system user read the _rt log files? For instance, under RHEL/Apache, the default permissions of /var/log/httpd are 700, root:
    ls -arltd /var/log/httpd/
    drwx------ 2 root root 4096 Jul 28 11:36 /var/log/httpd/
    A workaround is to specify an alternate log directory for the httpd logs or, alternatively, to change the permissions of /var/log/httpd. Both of these have specific security implications. You could also run the agent as root; while this is the least preferable option, there are cases where this is necessary in order to not compromise system security by modifying file permissions. For example, JBoss ON cannot monitor the postgres daemon without root permissions, due to 700, postgres permissions on its data directory. Since those permissions shouldn't be altered, the only remaining option is to run the agent as root.
  2. Have you enabled the Response Time Metric for the Apache Vhost Template and enabled Response Time? It is disabled by default.
To do this, go to:
  1. Administration > System Configuration > Templates | Apache HTTP Server > Apache Virtual Host, and click Edit Metric Template.
  2. Select the checkbox next to HTTP Response Time.
  3. At the bottom of the page, select Update schedules for existing resources of marked type.
  4. Set the collection interval.
  5. Click the Go button ([>]).

Note

The RT metrics will now work. It may take approximately 10 minutes for the metrics to appear.
Q:
Some of my Apache metrics show values of zero. Why?
A:
Three metrics show values of zero when you are monitoring with the SNMP module:
  • Bytes Received for GET Requests per Minute
  • Bytes Received for POST Requests per Minute
  • Total Number of Bytes Received per Minute
This is because of how SNMP interprets information from the request body. First, SNMP provides various length values for the request body and a GET request does not have a body, so GET responses are not calculated and, therefore, have a value of zero. Second, Apache does not calculate a request body size if there is request chunking.
Q:
What is the Augeas plug-in?
A:
The Augeas plug-in is an abstract plug-in that exists solely as an extension point for other plug-ins. The Augeas plug-in provides the Java JNI classes necessary for other dependent plug-ins to use to access the Augeas native library. For example, the OpenSSHD plug-in depends on the Augeas plug-in because it uses the Augeas library to access the OpenSSH daemon configuration. Several other JBoss ON plug-ins use this Augeas plug-in:
  • hosts
  • grub
  • apt
Q:
Why does my agent log have the error "java.lang.UnsatisfiedLinkError: Unable to load library 'augeas': libaugeas.so: cannot open shared object file: No such file or directory"?
A:
This means that an Augeas-based plug-in has been deployed, but the Red Hat Enterprise Linux box does not have the Augeas native library installed. See http://augeas.net for more information on installing Augeas libraries.
Q:
Why does my Apache SNMP module fail to start with an error?
A:
There are a couple of common errors and causes.
Error Cause
Syntax error on line 1376 of /etc/httpd/conf/httpd.conf: Unable to write to SNMPvar directory" (on stderr) Ensure the directory specified via the "SNMPVar" directive exists and is writable by the user that owns the Apache process.
init_master_agent: Invalid local port (Permission denied)" (in the error_log file)
See if your Apache error_log contains a log message similar to the following:
[notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0
This means the SELinux (Security-Enhanced Linux) policy is preventing the httpd process from binding to the SNMP agent port, 1610 by default. To resolve the problem, change SELinux to permissive mode by running the command /usr/bin/setenforce 0 and then restarting Apache. You should then see a message similar to the following in your error_log:
[notice] SELinux policy enabled; httpd running as context user_u:system_r:unconfined_t"
This message has the term unconfined_t. This indicates SELinux is no longer restricting the process.