- ${SSH} "${!CONTROLLERIP}" "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log"
- ${SSH} "${!CONTROLLERIP}" "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*"
- scp "${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar" "${WORKSPACE}/odl${i}_karaf.log.tar"
- ${SSH} "${!CONTROLLERIP}" "tar -cf /tmp/odl${i}_zrpcd.log.tar /tmp/zrpcd.init.log"
- scp "${!CONTROLLERIP}:/tmp/odl${i}_zrpcd.log.tar" "${WORKSPACE}/odl${i}_zrpcd.log.tar"
- tar -xvf ${WORKSPACE}/odl${i}_karaf.log.tar -C . --strip-components 2 --transform s/karaf/odl${i}_karaf/g
- grep "ROBOT MESSAGE\| ERROR " odl${i}_karaf.log > odl${i}_err.log
- # Print ROBOT lines, Print Caused by...Exception: lines,
- # Print Exception{ lines as well as the previous line that has the timestamp for context
- sed -n -e '/ROBOT MESSAGE/P' -e '/Caused by.*Exception:/P' -e '$!N;/Exception:/P;D' -e '$!N;/Exception{/P;D' odl${i}_karaf.log > odl${i}_exception.log
- grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" odl${i}_karaf.log > odl${i}_err_warn_exception.log
- rm ${WORKSPACE}/odl${i}_karaf.log.tar
+ NODE_FOLDER="odl_${i}"
+ mkdir -p ${NODE_FOLDER}
+ ${SSH} ${!CONTROLLERIP} "journalctl > /tmp/journalctl.log"
+ scp ${!CONTROLLERIP}:/tmp/journalctl.log ${NODE_FOLDER}
+ ${SSH} ${!CONTROLLERIP} "dmesg -T > /tmp/dmesg.log"
+ scp ${!CONTROLLERIP}:/tmp/dmesg.log ${NODE_FOLDER}
+ ${SSH} ${!CONTROLLERIP} "cp -r /tmp/${BUNDLEFOLDER}/data/log /tmp/odl_log"
+ ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_karaf.log.tar /tmp/odl_log/*"
+ scp ${!CONTROLLERIP}:/tmp/odl${i}_karaf.log.tar ${NODE_FOLDER}
+ ${SSH} ${!CONTROLLERIP} "tar -cf /tmp/odl${i}_zrpcd.log.tar /tmp/zrpcd.init.log"
+ scp ${!CONTROLLERIP}:/tmp/odl${i}_zrpcd.log.tar ${NODE_FOLDER}
+ tar -xvf ${NODE_FOLDER}/odl${i}_karaf.log.tar -C ${NODE_FOLDER} --strip-components 2 --transform s/karaf/odl${i}_karaf/g
+ grep "ROBOT MESSAGE\| ERROR " ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err.log
+ grep "ROBOT MESSAGE\| ERROR \| WARN \|Exception" \
+ ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_err_warn_exception.log
+ # Print ROBOT lines and print Exception lines. For exception lines also print the previous line for context
+ sed -n -e '/ROBOT MESSAGE/P' -e '$!N;/Exception/P;D' ${NODE_FOLDER}/odl${i}_karaf.log > ${NODE_FOLDER}/odl${i}_exception.log
+ rm ${NODE_FOLDER}/odl${i}_karaf.log.tar
+ mv karaf_${i}_threads* ${NODE_FOLDER}
+ mv ${NODE_FOLDER} ${WORKSPACE}/archives/