#!/usr/bin/ksh
# nsum version 4 Sept 2022 Nigel Griffiths

OUT=nsum_report.csv
echo Output to $OUT

# For regular nmon files the program all the nmon files in the current directory
# For topas output files in nmon format change *.nmon to  *.topas.csv
# Note: Linux - not all data is available. Good luck.
# Note: AIX JFS statistics are collected at the end of the capture. If nmon was stopped early, it will not be be there.

echo nsum v4 file $OUT >$OUT

echo General Info >>$OUT
nsum_gen *.nmon   >>$OUT
echo General done

echo              >>$OUT
echo CPU          >>$OUT
nsum_cpu *.nmon   >>$OUT
echo CPU done

echo              >>$OUT
echo Memory       >>$OUT
nsum_ram *.nmon   >>$OUT
echo RAM done

echo              >>$OUT
echo Disks         >>$OUT
nsum_disk *.nmon  >>$OUT
echo Disks done

echo              >>$OUT
echo Networks      >>$OUT
nsum_net *.nmon   >>$OUT
echo Networks done

echo              >>$OUT
echo FC Adapter Ports        >>$OUT
nsum_fc *.nmon    >>$OUT
echo FC Adapter Ports done

echo              >>$OUT
echo JFS          >>$OUT
nsum_jfs *.nmon   >>$OUT
echo JFS done

echo All Done
