blob: 1a205f4767bb04a10bd1c3ed419b2a0e92a01887 [file] [log] [blame]
tom5a18e802014-09-18 12:38:15 -07001#!/bin/bash
2#-------------------------------------------------------------------------------
3# Monitors remote ONOS log file.
4#-------------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9remote=$ONOS_USER@${1:-$OCI}
10
11LOG=$ONOS_INSTALL_DIR/log/karaf.log
12
tom1f3805d2014-09-18 19:58:47 -070013trap "ssh $remote 'ps -ef | grep \"tail -n 512\" | grep -v grep | cut -c10-15 | xargs kill'" EXIT
14
tom5a18e802014-09-18 12:38:15 -070015ssh $remote "
16 while true; do
tomcaf3bf72014-09-23 13:20:53 -070017 echo ==================================================================
tom5a18e802014-09-18 12:38:15 -070018 [ ! -f $LOG ] && sleep 2 && continue
19 tail -n 512 --follow=name $LOG --sleep-interval 2
20 done
21"