DJMC117
1 Nickel

Help with NetWorker CLI

Hi,

I need to get some information on backup jobs and output to a delimited text file or csv file.

The information which I require is Client name, SSID, size, duration and if the backup was successful.

I can get some of this info using mminfo but can't figure out how to get the duration or success status.

I have also looked at gstclreport but don't know how to edit or create customised report.

Could nsradmin give me the information I require?

Any help would be appreciated.

Tags (2)
0 Kudos
10 Replies
bingo.1
4 Tellurium

Re: Help with NetWorker CLI

What you need is just mminfo. However, there are some limitations:

  - The success is indicated by the entriy in the media db itself. However, the save set could be aborted

    To avoid this you should query for non-suspect & non-aborted save sets

  - There is no 'duration'. However you could query for 'sscreate(20)' & 'sscomp(20)' . These values are in seconds

    (UNIX timestamp). In a later step you can just substract the values and calculate the duration.

    Powershell is very handy in automating these steps.

The core command should read like

  mminfo -q "... ,!suspect,!aborted" -r "...,sscreate(20),sscomp(20)" [-ot] -xc, > outfile.txt

DJMC117
1 Nickel

Re: Help with NetWorker CLI

Hi Bingo,

Thanks for your reply, you have been very helpful.
The command didn't quite work but I was able to piece it together to get most of the info I require. Still working on the status...

The command  doesn't seem to like the aborted constraint, is there a manual or guide which lists and explains all the possible options? I have the CLI guide but it seems very limited?

Thanks again for you help.

0 Kudos
bbeckers1
1 Nickel

Re: Help with NetWorker CLI

you can additionally use nsrsgrpcomp which shows the save group status (failed/succeeded/running,etc).


-L shows all groups currently present in jobs database:

# nsrgrpcomp -L
...

group1, Wed Jun 22 10:00:02 2016(1466582402), 18245860, 0, failed

group2, Wed Jun 22 10:00:02 2016(1466582402), 18245858, 18241848, succeeded

group3, Wed Jun 22 15:00:01 2016(1466600401), 18252738, 0, running
...

you can do that also for a specific group, which then reports the savegroup completion messages

the jobquery command - queryable akin to nsradmin - can also give group completion status, start and end time using type "savegroup job"

bingo.1
4 Tellurium

Re: Help with NetWorker CLI

Compared with others the 'mminfo' manpage is actually very good.

However, sometimes the names are a bit strange and do no comply with the 'standard naming procedures/habits' .

So if you want to look for 'not aborted' save sets you must actually use the '!incomplete' flag.

Sorry for the confusion.

DJMC117
1 Nickel

Re: Help with NetWorker CLI

Thanks to all for your help,

The command which I ended up with is as follows:

mminfo -q "savetime>=24 hours ago" -r "client, sscreate(30), sscomp(30), sumsize, name, ssflags" > c:\daily.csv

What I think it's doing is querying all the backups in the last 24hrs and printing the client name, start and end time, size of the backup, name of the savesets and the associated saveset flags. The flags should tell me if the job finished (F), is incomplete (i ) or still in progress (I).

Any comments would be appreciated.

0 Kudos
bbeckers1
1 Nickel

Re: Help with NetWorker CLI

as you haven't clearly stated what you actually require this for, might NW notifications not be something for you? so that you can send out for instance mails for failed backups?

the NMC reports are not enough for you either?

in our case we redirect group output to a separate logfile for each group, which in its name contains status OK or FAIL, also something we can filter on with scripts to see how many backups have succeeded the last couple of days for instance

or nsrwatch of recent nw8.2.3.x which has been greatly revamped (be aware however that nw8.2.3.x in our case has some issues like not following storage node definitions in a normal way if a client has more than one or that clientnames above 46 characters are regarded as invalid clients).

0 Kudos
bingo.1
4 Tellurium

Re: Help with NetWorker CLI

Using "sumsize" is not ideal as NW choses the approppriate unit by himself. For each save set.

This is not ideal as you cannot sort. And you cannot summarize.

For this purpose I recommend that you use 'totalzize'. The result is that all amounts will be reported in bytes.

0 Kudos
DJMC117
1 Nickel

Re: Help with NetWorker CLI

Hi Barry,

Thanks for getting back on this.

The command is to be scheduled to run daily and the output will be feed into another application to produce usage and trending reports, similar information form other products eg Disk arrays will also be gathered.

I basically need the above info output as a text or csv file on a daily basis, I know the NW reports can be exported but I don't think they can be scheduled, if you are aware of how to do this please let me know, it would be much appreciated.

D

0 Kudos
DJMC117
1 Nickel

Re: Help with NetWorker CLI

Hi Bingo,

I thought the sumsize looked neater in the output as it gave the units. However I see your point so I think I will use the totalsize constraint as suggested.

Thanks again for you time and help.

D

0 Kudos