Knowledge Doc: Slow response time on Logger peers: Setting a cronjob to gracefully restart Apache

1 Likes

Summary
This article describes the steps on how to setup a cronjob to do graceful restart of Apache for Logger Searh Heads and Peers

Products
ArcSight Logger

Environment
Any version of Logger for Software and Appliance Form Factors

Situation
Slow response time for the searches that are done across a group of Logger peers on a Logger Search Head.

Resolution
A workaround for this issue is to create a cronjob to gracefully restart the apache service on each Logger.
The steps are as follows for either Appliance or Software Form Factor:

  • Create the directory /opt/arcsight/scripts and inside that directory create a file called "graceful-restart.sh":
  • Give the following permissions to the "graceful-restart.sh" file:
  • Using a text editor, add the following lines to the "graceful-restart.sh" script:
    • #! /usr/bin/env sh
      
      if [ -f "/etc/arcsight_model" ]; then
      # For Appliance Form Factor
          /opt/local/apache/bin/httpd -k graceful
      else
          # For Software Form Factor
          export LIP=$(find /opt/ -name loggerd | grep -oP ".+(?=/current/arcsight/logger/bin/loggerd)")
          export LD_LIBRARY_PATH="$LIP/current/local/apache/lib/:$LIP/current/local/openssl/lib/:$LIP/current/local/pcre/lib/"
          $LIP/current/local/apache/bin/httpd -k graceful -d $LIP/current/local/apache/
      fi
  • Save the file on the text editor.
  • Next, create the following cronjob, where the "*/24" parameter sets the cronjob to execute the "graceful-restart.sh" script on a daily basis:
  • crontab -e
    
    # Add the following
    
    0 */24 * * * /opt/arcsight/scripts/graceful-restart.sh
    
    # Save the file on the text editor
  • The frequency can be reduced by lowering the hours on the "*/24" hours.

Knowledge Base Article Link

URL Name
KM000015765

Labels:

Support Tips/Knowledge Docs
  • Hi! We are seeing the same behavior after upgrade Logger from 6.7 to 7.2, maybe a better workaround could be monitor if the issue has started, and only if so restart the Apache.  We are running this script every 10 minutes from the cron (we have installed Logger on /opt/arcsight/logger):

    #!/bin/bash

    CURL="$(curl -s -v -m 10 -k https://localhost:9000/test 2>&1)"

    if [ $? -ne 0 ]
    then
            echo "$(date +'%Y%m%d%H%M%S') Apache problem detected"
            echo "$CURL"
            echo
            echo "$(date +'%Y%m%d%H%M%S') Restarting Apache..."

            /opt/arcsight/logger/current/../current/arcsight/logger/bin/loggerd restart apache
    fi

Related
Recommended