Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
fixing nmon_helper.sh nmon command logging
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhemmarchand committed Mar 29, 2017
1 parent 911a416 commit 4cbf777
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions bin/nmon_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@
# 2017/03/24, Guilhem Marchand: - Be Python version restrictive for the fifo_reader choice
# - prevent AIX error messages related to LIBPATH and rpm
# - PowerLinux binaries identification failures
# 2017/03/29, Guilhem Marchand: - nmon command not correctly displayed in nmon_helper.sh output

# Version 1.3.37
# Version 1.3.38

# For AIX / Linux / Solaris

Expand Down Expand Up @@ -951,8 +952,10 @@ case $UNAME in
# fifo_started variable is exported by the function start_fifo_reader
case $fifo_started in
"fifo1")
echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command_fifo1} in ${NMON_EXTERNAL_DIR}"
${nmon_command_fifo1} > ${PIDFILE} ;;
"fifo2")
echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command_fifo2} in ${NMON_EXTERNAL_DIR}"
${nmon_command_fifo2} > ${PIDFILE} ;;
esac
;;
Expand Down Expand Up @@ -989,7 +992,10 @@ case $UNAME in
# Activation of Linux disks extended stats generate a message in stdout
# We don't want this as we need to retrieve the pid from nmon output
# However, we also want to analyse the return code, so we can't filter out in only one operation

echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command} in ${NMON_EXTERNAL_DIR}"
${nmon_command} > ${APP_VAR}/nmon_output.txt

if [ $? -ne 0 ]; then
echo "`date`, ${HOST} ERROR, nmon binary returned a non 0 code while trying to start, please verify error traces in splunkd log (missing shared libraries?)"
fi
Expand All @@ -1004,7 +1010,9 @@ case $UNAME in
if grep 'opening disk group file' ${APP_VAR}/nmon_output.txt >/dev/null; then

echo "`date`, ${HOST} WARN, nmon disks extended statistics cannot be collected, either this nmon version is not compatible or the disk group file does not exist, see ${APP_VAR}/nmon_output.txt"

nmon_command=`echo ${nmon_command} | sed "s/-g ${Linux_disk_dg_group} -D//g"`
echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command} in ${NMON_EXTERNAL_DIR}"
${nmon_command} &> ${PIDFILE}

if [ $? -ne 0 ]; then
Expand All @@ -1017,6 +1025,7 @@ case $UNAME in

# This version is not compatible with the auto group disk
nmon_command=`echo ${nmon_command} | sed "s/-g ${Linux_disk_dg_group} -D//g"`
echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command} in ${NMON_EXTERNAL_DIR}"
${nmon_command} > ${PIDFILE}

if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -1056,6 +1065,7 @@ case $UNAME in

fi

echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command} in ${NMON_REPOSITORY}"
${nmon_command} >/dev/null 2>&1 &
;;

Expand Down Expand Up @@ -1467,8 +1477,6 @@ if [ ! -f ${PIDFILE} ]; then

"")

echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command} in ${NMON_REPOSITORY}"

case $UNAME in

AIX | Linux)
Expand Down Expand Up @@ -1563,8 +1571,6 @@ else

"")

echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command} in ${NMON_REPOSITORY}"

case $UNAME in

AIX | Linux)
Expand Down Expand Up @@ -1685,8 +1691,6 @@ else
echo "`date`, ${HOST} INFO: Removing stale pid file"
rm -f ${PIDFILE}

echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command} in ${NMON_REPOSITORY}"

case $UNAME in

AIX | Linux)
Expand Down
2 changes: 1 addition & 1 deletion default/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ label = TA-nmon
[launcher]
author = Guilhem Marchand
description = Technical Addon for Nmon Performance Monitor
version = 1.3.05
version = 1.3.06

0 comments on commit 4cbf777

Please sign in to comment.