NetWorker Basics – Let nsr_render_log B your friend

A post from a long time ago explained how you could enable realtime rendering of NetWorker logs from their raw to human-readable formats.

If you can enable realtime rendering, it makes for easy reviews of NetWorker logs. But you may not always have an option, particularly on clients throughout your environment. Some client systems may have capacity constraints (real or imagined), or you might only have access to systems if there’s a problem to be fixed.

If you come from a Unix background, you’d undoubtedly be familiar with the commands:

  • tail -f, and
  • tail -Xf (where X is a number)

The first instance of tail lets you starting watching a log in real-time from the last 10 lines in the log, and the second lets you specify how many lines you want to go back.

Unless you enable real-time rendering of logs, you won’t get that “tail” luxury of seeing the logs continuously update in a shell session. But that doesn’t mean nsr_render_log lacks tools to help you get to what you need.

If you’re after just a range of time (or to be more correct the time and date) within the log rendering, you can invoke nsr_render_log with a -S start and -E end option. I love that the start and end times can be specified in any NetWorker time format though! So you can be specific with “-S 30/12/2020 14:59:01” -E “31/12/2020 01:59:33”, but you can also be a little more imprecise in the time statements – “-S 33 hours ago” -E “14 hours ago”.

If you’re just after a block of lines, you can use the -B option – and better yet, if you specify a negative number, nsr_render_log will pull those details from the end of the file. For example:

Using nsr_render_log -B
Using nsr_render_log -B

In the above example, I’ve invoked nsr_render_log with an argument of “-B -15” which means, “grab the last 15 lines of the log file”. This is really handy if you’re just wanting to see the latest content from the log.

But, if you’re a NetWorker administrator who doesn’t have login access to the agent-based clients within your environment, you can go one better than the above by doing a remote grab of the client logs from the command line. That’s right, from the NetWorker server you can invoke nsr_render_log using an option of -R client to retrieve the rendered log details from a client. So below you’ll see me running the command from my backup server, again requesting the tail end of the log from my client:

Using nsr_render_log from the NetWorker server for a remote client
Using nsr_render_log from the NetWorker server for a remote client

When you run nsr_render_log remotely, you’re not just limited to using the -B option, either. For instance, you can use those start and stop time options as well:

nsr_render_log rendering remote logs within a time range
nsr_render_log rendering remote logs within a time range

I often under-think the nsr_render_log utility. I tend to think of it as something that I run from the client to dump output that I’ll manually scan through. But it’s a lot more intelligent — as you can see from the above examples, you can exercise considerable precision in picking out how many lines, what date range or what client you want the logs from.

That’s still not all, though! Using appropriate arguments, you can get nsr_render_log to output information only relating to specific processes, programs, hostnames, devices, and a variety of other options, too. (You can find more details on those options in the man page for nsr_render_log, or the command line reference guide for NetWorker.)


Before I sign off: I’ve started a new blog that explores tech – and working in tech – more broadly. You can see what I’m up to on that blog over at Musing About Tech.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.