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

Commit

Permalink
fix nmon external issue with AIX
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhemmarchand committed Mar 30, 2017
1 parent 8fba9ad commit 06cd790
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
14 changes: 6 additions & 8 deletions bin/nmon_external_cmd/nmon_external_snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Date - March 2017
# Guilhem Marchand 2017/03/18, initial version

# Version 1.0.0
# Version 1.0.01

# For AIX / Linux / Solaris

Expand All @@ -22,18 +22,16 @@
# - nmon_external: manage any number of fields without transposition
# - nmon_external_transposed: manage any number of fields with a notion of device / value

# Do no try to do anything unless the NMON_EXTERNAL_DIR variable has been correctly set
# Do no try to do anything unless the fifo file to be writen exist in the current directory
# we exit without any error code, the situation is not expected but we do not want to generate bad data in nmon data

if [ "$NMON_EXTERNAL_DIR" = "" ]
then
exit 0
if [ ! -s nmon.fifo ]; then
exit 0
fi

# CAUTION: ensure your custom command does not output any comma within the field name and value

# Number of running processes
echo "PROCCOUNT,$1,`ps -ef | wc -l`" >>$NMON_EXTERNAL_DIR/nmon.fifo
echo "PROCCOUNT,$1,`ps -ef | wc -l`" >>nmon.fifo

# Uptime information (uptime command output)
echo "UPTIME,$1,\"`uptime | sed 's/^\s//g' | sed 's/,/;/g'`\"" >>$NMON_EXTERNAL_DIR/nmon.fifo
echo "UPTIME,$1,\"`uptime | sed 's/^\s//g' | sed 's/,/;/g'`\"" >>nmon.fifo
12 changes: 5 additions & 7 deletions bin/nmon_external_cmd/nmon_external_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@
# - nmon_external: manage any number of fields without transposition
# - nmon_external_transposed: manage any number of fields with a notion of device / value

# Do no try to do anything unless the NMON_EXTERNAL_DIR variable has been correctly set
# Do no try to do anything unless the fifo file to be writen exist in the current directory
# we exit without any error code, the situation is not expected but we do not want to generate bad data in nmon data

if [ "$NMON_EXTERNAL_DIR" = "" ]
then
exit 0
if [ ! -s nmon.fifo ]; then
exit 0
fi

# CAUTION: ensure your custom command does not output any comma within the field name and value

# number of running processes
echo "PROCCOUNT,Process Count,nb_running_processes" >>$NMON_EXTERNAL_DIR/nmon.fifo
echo "PROCCOUNT,Process Count,nb_running_processes" >>nmon.fifo

# uptime information
echo "UPTIME,Server Uptime and load,uptime_stdout" >>$NMON_EXTERNAL_DIR/nmon.fifo
echo "UPTIME,Server Uptime and load,uptime_stdout" >>nmon.fifo
7 changes: 6 additions & 1 deletion bin/nmon_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@
# - 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
# 2017/03/30, Guilhem Marchand: - several failure in nmon external for AIX

# Version 1.3.38
# Version 1.3.39

# For AIX / Linux / Solaris

Expand Down Expand Up @@ -953,9 +954,11 @@ case $UNAME in
case $fifo_started in
"fifo1")
echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command_fifo1} in ${NMON_EXTERNAL_DIR}"
cd ${NMON_REPOSITORY}/fifo1
${nmon_command_fifo1} > ${PIDFILE} ;;
"fifo2")
echo "`date`, ${HOST} INFO: starting nmon : ${nmon_command_fifo2} in ${NMON_EXTERNAL_DIR}"
cd ${NMON_REPOSITORY}/fifo2
${nmon_command_fifo2} > ${PIDFILE} ;;
esac
;;
Expand All @@ -970,8 +973,10 @@ case $UNAME in
# fifo_started variable is exported by the function start_fifo_reader
case $fifo_started in
"fifo1")
cd ${NMON_REPOSITORY}/fifo1
nmon_command=${nmon_command_fifo1} ;;
"fifo2")
cd ${NMON_REPOSITORY}/fifo2
nmon_command=${nmon_command_fifo2} ;;
esac

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.07
version = 1.3.08

0 comments on commit 06cd790

Please sign in to comment.