Add Apache HTTP Server

You can add Apache HTTP Server entities using the Add Entity UI or using the cloud agent command line interface (omcli) with the appropriate JSON files.

Step 1: Prepare Apache HTTP Server for monitoring.

Apache HTTP Server Prerequisites

In this release, only Apache HTTP Server 2.4.x and 2.2 for Linux are supported.

To enable the collection of configuration metrics, note the following:
  1. The Cloud Agent should be installed on the same host as Apache HTTP Server. The Apache *.conf file(s) , including httpd.conf file, should be accessible and readable by the Cloud Agent install user.

  2. The Apache install user and the Cloud Agent install user should be a part of the same operating system group.

In order to monitor an Apache HTTP Server you must first:

  • Enable ‘mod_status’ for the Apache module.

  • Configure/server-status location directive for the specified Host and Port (default or configured virtual host).

  • Turn ‘ON’ the Extended Status.

  • If applicable, provide access to the configured location directive so that HTTP/HTTPS request can be successfully made from the host where the agent is installed on.

For more information, see https://httpd.apache.org/docs/2.4/mod/mod_status.html and http://httpd.apache.org/docs/current/mod/core.html#location.

For HTTPS/Secure communication between Apache HTTP Server and the cloud agent during metrics collection, you must provide an SSL certificate. To make the certificate available with the cloud agent:
  1. Append the contents of your certificate file to the existing certificate file. For example, on a UNIX host the existing certificate file is: <AGENT_BASE_DIR>/sysman/config/b64InternetCertificate.txt

    Ensure that only the following lines are appended to the b64InternetCertificate.txt file. Do not include blank lines, comments, or any other special characters.

    ----BEGIN CERTIFICATE----
    <<<Certificate in Base64 format>>>
    ----END CERTIFICATE----
  2. Restart the agent by running the following commands from the agent installation directory (for example, on a UNIX host, this directory is <AGENT_BASE_DIR>/agent_inst/bin).
    a) ./omcli stop agent
    b) ./omcli start agent
    

For data retrieval of memory-related metrics (supported on Unix platforms and when an entity is locally monitored), the PID file (httpd.pid) file needs to be accessed.

If Apache is running as root or some user other than the agent process owner, access to the PID file will fail. Hence, to allow access to httpd.pid, you need to ensure that the file can be accessed without compromising Linux security. There are several ways to achieve this. One option is as follows:

As a privileged user, run the following commands:
setfacl -R -L -d -m u:<agent_user>:rx /etc/httpd/run
setfacl -R -L -m u:<agent_user>:rx /etc/httpd/run

where /etc/httpd/run is the directory containing the PID file.

Step 2: Decide how you want to add the Apache HTTP Server.

You can add Apache HTTP Server entities using one of two ways:

  • Add them from UI
  • Use the agent's omcli add_entity command with the appropriate JSON files

Adding Entities from the UI

  1. From the Management Cloud main menu, select Administration, Discovery, and then Add Entity. The Add Entity page displays.
  2. Select the Apache HTTP Server Entity Type.
  3. Enter the following UI properties.
    Apache HTTP Server UI Properties
    • Entity Name: Name of the Apache HTTP Server entity appearing in the UI. .
    • Host Name: Host Name of the Apache HTTP Server.
    • Server Root: Server Root of the Apache HTTP Server.
    • Absolute Path of httpd.conf: Absolute path of the Apache httpd.conf file. Note: Filename needs to be appended.
    • Is Remote: Is the Apache installation host different from the agent host? Yes/No
    • Binary Home: Absolute path of the httpd binary (Optional - default value, if not provided: <Apache Home>/bin or /usr/bin)
    • Protocol: Protocol for connection to the Apache HTTP Server.
    • Listen Port: Listen Port of the Apache HTTP Server.
    • Server Status Connection Hostname: Server-status (Optional). This property specifies the value for the Host Name configured for /server-status connection (if different than FQDN - e.g., localhost). This needs to be specified if the connection-string (host:port) has a different host-name value than the value specified for host_name property. If specified, this value will be used to connect to Apache and retrieve data from the URI /server-status. If this property value is not specified, the default value will be the same as the host_name property value. (Optional)
    • Cloud Agent: Cloud agent monitoring the Apache HTTP Server.

See Add Entities from the Console for detailed instructions on using the Add Entity UI.

Using omcli and the Appropriate JSON Files

  1. Download and extract the required JSON file(s) from the master JSON zip file. See the table below for the specific JSON files you'll need.
  2. Edit the file(s) and specify the requisite properties shown below.
    Apache HTTP Server JSON Files and Properties

    Definition File: omc_generic_apache_sample.json

    • host_name: Host Name of the Apache HTTP Server.
    • omc_listen_port: Listen Port of the Apache HTTP Server.
    • omc_httpd_conf_path: Absolute Path of httpd.conf
    • omc_protocol: Protocol for connection to the Apache HTTP Server.
    • omc_server_root: Server Root of the Apache HTTP Server.
    • omc_is_remote: Indicates whether the HTTP Apache Server is local(NO) or remote(YES) - possible values: yes / no.
    • omc_binary_home: Absolute path of the httpd binary (Optional - default value, if not provided: $omc_server_root/bin)
    • omc_access_log_path: Access Log Path (Optional)
    • omc_error_log_path: Error Log Path (Optional)
    • omc_server_status_connect_host: Server-status (Optional). This property specifies the value for the Host Name configured for /server-status connection (if different than FQDN - e.g., localhost). This needs to be specified if the connection-string (host:port) has a different host-name value than the value specified for host_name property. If specified, this value will be used to connect to Apache and retrieve data from the URI /server-status. If this property value is not specified, the default value will be the same as the host_name property value. (Optional)
  3. Add the entity using omcli.
    omcli add_entity agent DEFINITION_FILE [-credential_file CREDENTIAL_FILE [-encryption_method_gpg]] 
  4. Verify the status of the newly added entity.
    omcli status_entity agent DEFINITION_FILE

See step 4. Adding Entities to Your Service of Add Entities Using JSON Files for more information.

Step 3: (Optional but recommended) Set up alerts.

To enable lights-out monitoring, you can set up alert rules to generate alerts and send notifications if your entities have performance issues.

See Set Up Alert Rules and Set Up Alert Thresholds and Notifications.

Troubleshooting

If you run into any issues regarding discovery or monitoring of Apache HTTP Server, see the following: