Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions gatherLogs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
cd ~/RMS_data/logs

#
# Script to gather the logfiles and upload them for debugging & analysis
#
source /home/pi/source/ukmon-pitools/ukmon.ini
sudo cp /var/log/kern.log .
sudo chown pi:pi kern.log
cp /var/log/messages ./messages.log
cp /home/pi/source/RMS/.config ${LOCATION}.config
cp /home/pi/source/RMS/platepar_cmn2010.cal ${LOCATION}.cal
ZIPFILE=/tmp/${LOCATION}_logs.tgz
tar cvzf $ZIPFILE *.log* ${LOCATION}.config ${LOCATION}.cal
sftp -i $UKMONKEY -q logupload@$UKMONHELPER << EOF
cd logs
progress
put $ZIPFILE
exit
EOF
rm kern.log messages.log $ZIPFILE ${LOCATION}.config ${LOCATION}.cal
6 changes: 5 additions & 1 deletion ukmonPostProc.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ def installUkmonFeed():
def rmsExternal(cap_dir, arch_dir, config):
# called from RMS to trigger the UKMON specific code

initLogging(config, 'ukmon_')
# clear existing log handlers
log = logging.getLogger("logger")
while len(log.handlers) > 0:
log.removeHandler(log.handlers[0])

initLogging(config, 'ukmon_')
log.info('ukmon external script started')

rebootlockfile = os.path.join(config.data_dir, config.reboot_lock_file)
Expand Down