#!/bin/bash dataDir='/home/nmon/data' htmlDir='/home/nmon/public_html' # process each node/computer ls -1 ${dataDir} | while read node do echo "Processing node: ${node}" # Make sure config file is there if [[ -f ${dataDir}/${node}/report.config ]] then # make sure output has somewhere to go if [[ ! -d ${htmlDir}/${node} ]] then mkdir -p ${htmlDir}/${node} fi # now process each day of data that has not already been processed cd ${dataDir}/${node} rm -rf tmp ls -1 *.nmon | while read file do echo " ${file}" # change periods to spaces tmp=$(echo ${file} | sed 's/\./ /g') # make name the parameter list set ${tmp} # find out how many tokens last="$#" # next to last is date ((cnt=2)) while ((cnt < last)) do shift ((cnt = cnt + 1)) done # finally have date as first parameter dt="${1}" date=$(date -d ${dt} '+%B %-d, %Y (%A)') # if file does not exist, we need to generate html if [[ ! -f ${htmlDir}/${node}/${dt}.html ]] then pyNmonAnalyzer -i ${node}.${dt}.nmon -b -t static -x -o html cat html/report.html | sed "s/\"img\//\"img-${dt}\//g" | sed "s//

HPC nmon Visualization<\/h2>

${node} on ${date}<\/h3><\/center>/" > ${htmlDir}/${node}/${dt}.html mv html/img ${htmlDir}/${node}/img-${dt} rm -rf html if [[ ! -L ${htmlDir}/${node}/index.php ]] then ln -s ${htmlDir}/index.php ${htmlDir}/${node}/index.php fi fi done fi done