SSH Apache

SSH Apache Profile

This profile monitors a UNIX Apache web server. HTTP and HTTPS services are monitored remotely. Monitoring script are installed on the remote server and called from the GroundWork server using the SSH protocol. The Apache configuration must be changed to allow the monitoring server to check the Apache server status. Please reference SSH document under GroundWork Profiles>SSH Profiles when using this profile.

Services Configuration
  • SERVICE - Definitions in Monarch are stored under this name.
  • COMMAND LINE - Service command name with arguments to be passed to the plugin.
  • PLUGIN COMMAND LINE - Plugin script called by Nagios for this Service.
  • EXTENDED INFO - The Extended Service Info definition, typically used for generating graphs.
    Command lines displayed below are intended to be single line commands.
    Service Command Line Plugin Command Line Extended Info
    ssh_apache check_by_ssh_apache $USER1$/check_by_ssh -H $HOSTADDRESS$ -t 60 -l "$USER17$" -C "$USER22$/check_apache.pl -H $HOSTADDRESS$" number_graph
    tcp_http_port check_http!3!5!80 $USER1$/check_http -t 60 -H $HOSTADDRESS$ -w "$ARG1$" -c "$ARG2$" -p "$ARG3$" number_graph
    tcp_https check_https!3!5 $USER1$/check_http -t 60 -H $HOSTADDRESS$ -w "$ARG1$" -c "$ARG2$" -S number_graph
Profile Package

This package includes the following files:

Profile Definitions

  • service-profile-ssh-apache.xml
  • perfconfig-ssh-apache.xml

Plugins scripts on the GroundWork Server

  • check_http
  • check_by_ssh

Plugins scripts on the Remote Monitored Server

  • check_apache.pl

Performance Graphing Programs

  • number_graph.cgi
Installation

GroundWork Monitor includes many monitoring profiles for a variety of devices, systems and applications. Profiles already imported on a new GroundWork installation include Service Ping, SNMP Network, and SSH UNIX. The GroundWork Monitor Configuration tool is used to import updated Profiles and Profiles that require additional setup; the Profile XML file and its companion Performance Configuration definition file. Services can also be imported in addition to Service Profiles in the Profile Importer. The import process is documented under GROUNDWORK PROFILES > How to import profiles.

Implementation

This section contains detail settings used by this Profile. These parameters can be altered with the Configuration tool.

For check_apache or check_apache2.pl plugin to run, ExtendedStatus must be turned On in Apache.
  1. In the file /usr/local/groundwork/apache2/conf/httpd.conf add the following:
    ExtendedStatus On
    <Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from all
    </Location>
  2. Restart Apache:
    /usr/local/groundwork/ctlscript.sh restart apache
  3. Verify:
    http://ipaddress/server-status
Command Parameters

Command parameters are in the Configuration Services section with the following names and default values.

ssh_apache

  • Checks the Apache server status page for load statistics.
  • No arguments.

tcp_http_port

  • Uses check_http plugin to get a web page from $HOSTADDRESS$
  • Default warning threshold is a 3 second page load time.
  • $ARG1$ - Warning seconds
  • Default critical threshold is a 5 second page load time.
  • $ARG2$ - Critical seconds
  • Default port is 80.
  • $ARG3$ - Web server port

tcp_https

  • Uses check_http plugin with the -S (SSL) switch to get a web page from $HOSTADDRESS$.
  • Default warning threshold is a 3 second page load time.
  • $ARG1$ - Warning seconds
  • Default critical threshold is a 5 second page load time.
  • $ARG2$ - Critical seconds
Performance Graphing Parameters

The following parameters are used to generate performance charts. These parameters are set using the Configuration>Performance tool in GroundWork Monitor.

ssh_apache

  • Graph response time of Apache server.
  • Nagios® service description must contain the string "ssh_apache".

tcp_http_port

  • Graph response time of HTTP server.
  • Nagios® service description must contain the string "tcp_http_port".

tcp_https

  • Graph response time of HTTPS server.
  • Nagios® service description must contain the string "tcp_https".

Implementation Notes

The steps are:

  1. If you are communicating to a remote host that is behind a firewall, make sure the SSH port 22 is allowed to access the remote host.
  2. The Apache configuration file, httpd.conf. must be modified to support mod_status directive. The following is an example of these configuration statements.
    # Allow server status reports generated by mod_status
    # with the URL of [http://servername/server-status]
    # Change the ".example.com" to match your domain to enable.
    <Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from example.com
    </Location>
  3. You can test this configuration by opening a page to URL http://<host$#62;/server-status. You should see a status page similar to the following:
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.