Skip to content

Instantly share code, notes, and snippets.

@angoca
Last active June 26, 2016 14:40
Show Gist options
  • Save angoca/19a064a90568cc798bb2 to your computer and use it in GitHub Desktop.
Save angoca/19a064a90568cc798bb2 to your computer and use it in GitHub Desktop.
Render NSR (Networker) log continuosly like tail -f
#!/bin/bash
# Reads the Networker logs periodically.
# By default 15 seconds.
#
# Original from: http://www.backupcentral.com/phpBB2/two-way-mirrors-of-external-mailing-lists-3/emc-networker-19/nsr-render-log-97064/
LOG_FILE=/nsr/logs/daemon.raw
#LOG_FILE=/nsr/apps/logs/nmda_db2.messages.raw
DATE=$(date +"%m/%d/%y %H:%M:%S")
TIME=$1
[[ -z ${TIME} ]] && TIME=5
while [ true ] ; do
nsr_render_log -S "${DATE}" ${LOG_FILE} | grep -v "^No lines match the search criteria.$"
DATE=$(date +"%m/%d/%y %H:%M:%S")
sleep ${TIME}
done
@angoca
Copy link
Author

angoca commented Jan 28, 2016

This script will render continuosly the NSR log messages. By default it checks the daemon messages, but it can be changed to show any other NSR log file. In this code, the logs of the DB2 module are commented, ready to be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment