Enhanced onos-log and onos-check-logs to work against instance specific logs whe…
…n an optional second argument is given, e.g. onos-log $OC1 c0
Showing
2 changed files
with
8 additions
and
2 deletions
| ... | @@ -7,7 +7,10 @@ | ... | @@ -7,7 +7,10 @@ |
| 7 | . $ONOS_ROOT/tools/build/envDefaults | 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | 8 | ||
| 9 | remote=$ONOS_USER@${1:-$OCI} | 9 | remote=$ONOS_USER@${1:-$OCI} |
| 10 | +instance=$2 | ||
| 10 | 11 | ||
| 11 | -LOG=$ONOS_INSTALL_DIR/log/karaf.log | 12 | +[ -n "$instance" ] && \ |
| 13 | + LOG=$ONOS_INSTALL_DIR/$KARAF_DIST/instances/$instance/data/log/karaf.log || \ | ||
| 14 | + LOG=$ONOS_INSTALL_DIR/log/karaf.log | ||
| 12 | 15 | ||
| 13 | ssh $remote "egrep 'ERROR|Exception' $LOG" | 16 | ssh $remote "egrep 'ERROR|Exception' $LOG" | ... | ... |
| ... | @@ -7,8 +7,11 @@ | ... | @@ -7,8 +7,11 @@ |
| 7 | . $ONOS_ROOT/tools/build/envDefaults | 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | 8 | ||
| 9 | remote=$ONOS_USER@${1:-$OCI} | 9 | remote=$ONOS_USER@${1:-$OCI} |
| 10 | +instance=$2 | ||
| 10 | 11 | ||
| 11 | -LOG=$ONOS_INSTALL_DIR/log/karaf.log | 12 | +[ -n "$instance" ] && \ |
| 13 | + LOG=$ONOS_INSTALL_DIR/$KARAF_DIST/instances/$instance/data/log/karaf.log || \ | ||
| 14 | + LOG=$ONOS_INSTALL_DIR/log/karaf.log | ||
| 12 | 15 | ||
| 13 | trap "ssh $remote 'ps -ef | grep \"tail -n 512\" | grep -v grep | cut -c10-15 | xargs kill'" EXIT | 16 | trap "ssh $remote 'ps -ef | grep \"tail -n 512\" | grep -v grep | cut -c10-15 | xargs kill'" EXIT |
| 14 | 17 | ... | ... |
-
Please register or login to post a comment