Start a Conversation

Unsolved

This post is more than 5 years old

2995

June 21st, 2016 09:00

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.

2.4K Posts

June 21st, 2016 14:00

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

26 Posts

June 22nd, 2016 04:00

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.

2 Intern

 • 

137 Posts

June 22nd, 2016 06:00

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"

2.4K Posts

June 22nd, 2016 08:00

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.

26 Posts

June 23rd, 2016 09:00

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.

2 Intern

 • 

137 Posts

June 23rd, 2016 13:00

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).

2.4K Posts

June 23rd, 2016 20:00

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.

26 Posts

June 24th, 2016 00:00

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

26 Posts

June 24th, 2016 00:00

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

96 Posts

July 7th, 2016 07:00

You have to know the differences between totalsize and sumsize. If you have a big saveset that spans in two or more volumes, you will have several savesets with different size. You can check this adding "sumflags" in your mminfo query.

Sumflags could be t, m, or h, means tail, medium, and header.

Now, if you ask for sumsize, you will obtain the list of parts with its own sizes:

saveset (header) -> size of header

saveset (medium) -> size of medium

saveset (tail) -> size of tail

But if you query about totalsize, each saveset shows the size of the whole saveset:

saveset (header) -> size of saveset

saveset (medium) -> size of saveset

saveset (tail) -> size of saveset

It occurs if you add in your query some parameter thas tells mminfo show every part of the saveset, for example, sscreate (each part of the saveset have its own date of creation). If your query not have this kind of parameters, then totalsize is the same than sumsize.

On the other hand, you can use sumsize(20) and mminfo shows size in bytes... now you can be sure that all values are in the same unit.

Hope it helps...

No Events found!

Top