Hi guys,
I need to monitor 3 log paths: /tmp/OM/X.1/log/server.log, /tmp/OM/X.2/log/server.log, /tmp/OM/X.3/log/server.log.
I created a script, saved as '/tmp/OM/loginfo.sh' and ran test OK on server.
#!/bin/bash
# Array of log file paths
log_paths=(
"/tmp/OM/X.1/log/server.log"
"/tmp/OM/X.2/log/server.log"
"/tmp/OM/X.3/log/server.log"
)
# Loop through each log file path
for path in "${log_paths[@]}"
do
# Extract the directory path and filename
dirname=$(dirname "$path")
filename=$(basename "$path")
# Print the directory path and filename
echo "Path: $dirname, Filename: $filename"
done
-sh-4.2$ bash /tmp/OM/loginfo.sh
Path: /tmp/OM/X.1/log, Filename: server.log
Path: /tmp/OM/X.2/log, Filename: server.log
Path: /tmp/OM/X.3/log, Filename: server.log
I followed instruction in OBM document: "Script or command that returns the path and name of the log file you want to access. For example, type <`command`>
where command
is the name of a script that returns the path and name of the log file you want the policy to read."
I put <'/tmp/OM/loginfo.sh'> in Log file path section but Event says "The process '/tmp/OM/loginfo.sh' terminated with a non-zero exit code. (OpC20-432)"
Any advice or help would be greatly appreciated.
Thank you in advance for your support