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

Commit

Permalink
fifo_consumer.sh issue generates gaps in data #28
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhemmarchand committed May 31, 2017
1 parent 6eb42da commit b35aecd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
20 changes: 14 additions & 6 deletions TA-nmon/bin/fifo_consumer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
# Guilhem Marchand 2017/04/24, Use the nmon var directory in Splunk dir for temp creation
# Guilhem Marchand 2017/05/23, Integrate new fifo mode from parsers, fixed hard coded arguments
# Guilhem Marchand 2017/05/29, error in rotated files naming for purge rm command
# Guilhem Marchand 2017/05/30, improvements to prevent gaps in data

# Version 1.0.06
# Version 1.0.07

# For AIX / Linux / Solaris

Expand Down Expand Up @@ -128,6 +129,7 @@ nmon_config=$SPLUNK_HOME/var/log/nmon/var/nmon_repository/$FIFO/nmon_config.dat
nmon_header=$SPLUNK_HOME/var/log/nmon/var/nmon_repository/$FIFO/nmon_header.dat
nmon_timestamp=$SPLUNK_HOME/var/log/nmon/var/nmon_repository/$FIFO/nmon_timestamp.dat
nmon_data=$SPLUNK_HOME/var/log/nmon/var/nmon_repository/$FIFO/nmon_data.dat
nmon_data_tmp=$SPLUNK_HOME/var/log/nmon/var/nmon_repository/$FIFO/nmon_data_tmp.dat

# rotated
nmon_config_rotated=$SPLUNK_HOME/var/log/nmon/var/nmon_repository/$FIFO/nmon_config.dat.rotated
Expand Down Expand Up @@ -200,17 +202,23 @@ if [ -s $nmon_config ] && [ -s $nmon_header ] && [ -s $nmon_data ]; then

done

# copy content
cat $nmon_data > $nmon_data_tmp

# empty the nmon_data file
> $nmon_data

# Ensure the first line of nmon_data starts by the relevant timestamp, if not add it
head -1 $nmon_data | grep 'ZZZZ,T' >/dev/null
head -1 $nmon_data_tmp | grep 'ZZZZ,T' >/dev/null
if [ $? -ne 0 ]; then
tail -1 $nmon_timestamp >$temp_file
cat $nmon_config $nmon_header $temp_file $nmon_data | $SPLUNK_HOME/bin/splunk cmd $APP/bin/nmon2csv.sh $nmon2csv_options
cat $nmon_config $nmon_header $temp_file $nmon_data_tmp | $SPLUNK_HOME/bin/splunk cmd $APP/bin/nmon2csv.sh $nmon2csv_options
else
cat $nmon_config $nmon_header $nmon_data | $SPLUNK_HOME/bin/splunk cmd $APP/bin/nmon2csv.sh $nmon2csv_options
cat $nmon_config $nmon_header $nmon_data_tmp | $SPLUNK_HOME/bin/splunk cmd $APP/bin/nmon2csv.sh $nmon2csv_options
fi

# empty the nmon_data file
> $nmon_data
# remove the copy
rm -f $nmon_data_tmp

fi

Expand Down
Binary file modified TA-nmon_1319.tgz
Binary file not shown.
1 change: 1 addition & 0 deletions docs/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ V1.3.19:
- fix: CIM compliance improvements and corrections
- fix: missing oshost tag for ITSI
- fix: fifo_consumer.sh error in file naming for rotated files purge
- fix: fifo_consumer.sh issue generates gaps in data #28
- feature: Allows deactivating fifo mode and switch to old mechanism via nmon.conf #26
- feature: Allows deactivating nmon external generation via nmon.conf #25

Expand Down

0 comments on commit b35aecd

Please sign in to comment.