Note: This information does NOT apply to the classic Appserver.
The purpose of this Linux script is to help manage PASOE instance log file sizes when troubleshooting a problem and extended logging needs to be enabled which can result in very large files. The script aims to parse the logs every X amount of time, copy the logs that has errors, and clean the logs afterwards.
The script can be configured to run every X amount of time as long as the lock file exists.
Every time the script runs it will scan the logs looking for errors and/or keywords specified.
If the keywords are found in the logs, the script will place the files inside a tar.gz file and runs tcman clean on the instances to reset the size of the logs.
Explanation of the variables in the script and examples for the values:
#Name of the instances to be monitored, each name separated with a space.
PAS_INSTANCES = "oepas1 oepas2 oepas3"
#The root directory of all instances.
CAT_BASE = /usr/wrk
#The directory where tar.gz files should be created
TARGET_DIR = /tmp
# Place where the lock file should be created.
SCRIPT_LOCK = /tmp/PASOE_log_monitor.lk
#Time in seconds between each iteration of the script, 3600 seconds is an hour.
WAIT_IN_SECS = 3600
#Terms / key words to be searched in the logs.
GREP_KW = "error\|exception\|fail\|died\|terminated\|shutdown\|restarted\|Starting\|(14438)\|(15353)\|(15358)\|ccConvertBytes"
The script needs to be customized based on the errors, specific keywords, or information your interested in capturing.
Leave the variable SCRIPT_LOCK at the default values. If necessary change the path of the lock file but keep the same name for the file.