Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

NetBackup Administration Console - Automated Reporting ?

Updated: 19 Jan 2012 | 25 comments
smarsh88's picture
0 0 Votes
Login to vote
This issue has been solved. See solution.

Hello,

We are currently using the NetBackup Administration Console.

Each day, I am logging into the Console, choosing Reports > All Log Entries and manually running daily reports.

Is there a tool, or script I can use to automate this process?

 

Regards,

Shane

Comments

Mark_Solutions's picture
18
Jan
2012
2 Votes +2
Login to vote

All reports can be run from

All reports can be run from the command line, take a look at this tech note:

http://www.symantec.com/docs/TECH1672

#edit#

So you can put them in a .bat file and use Windows Scheduler or similar to automnate them for you

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.

Andy Welburn's picture
18
Jan
2012
0 Votes 0
Login to vote

Where did you did that one from Mark?

It's so O.L.D. I'm suprised there's not a preservation order on it! Still valid tho' wink

 

A bit more recent: http://www.symantec.com/business/support/index?pag...

Regards Andy

"It's not too late to panic ..."

smarsh88's picture
18
Jan
2012
0 Votes 0
Login to vote

Thats great thank you. But I

Thats great thank you. But I am looking at the following script:

 

All Log Entries Report
The All Log Entries report lists all log entries for the specified time period. This report includes the information from the Problems report and Media Log Entries report. This report also shows the transfer rate, which is useful in determining and predicting rates and backup times for future backups (the transfer rate does not appear for multiplexed backups).  
# cd /usr/openv/netbackup/bin/admincmd
# ./bperror -U -all [-d <start_date> <start_time> -e <end_date> <end_time>]

 

Obviously this shows a start date/time and end date/time. Does anyone know the syntax just to run the report for the past 24 hours? As I want to schedule this to happen daily. But only provide information from the last 24 hours...

Thanks again.

Andy Welburn's picture
18
Jan
2012
1 Vote +1
Login to vote

See the T/N Mark provided

it includes man page excerpts for each command:

bperror - Produce an error report

SYNOPSIS

/usr/openv/netbackup/bin/admincmd/bperror [-L | -l | -U] [-verbose] [-help]
[-d <mm/dd[/yy hh:mm:ss] ] [-e <mm/dd[/yy hh:mm:ss] ]
[-hoursago <hours ] [-client <name ] [-server <name ]
[-columns <40 or more ] [-all | -problems | -media | -backstat]

 

so -hoursago 24

Regards Andy

"It's not too late to panic ..."

Mark_Solutions's picture
18
Jan
2012
0 Votes 0
Login to vote

See Andy - the old ones are

See Andy - the old ones are sometimes the best! smiley

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.

Andy Welburn's picture
18
Jan
2012
0 Votes 0
Login to vote

Now lets not open that can'o'worms!!

laugh

Regards Andy

"It's not too late to panic ..."

smarsh88's picture
18
Jan
2012
0 Votes 0
Login to vote

:) Thats great, thank you. I

:)

Thats great, thank you. I have the data from the last 24 hours being exported to an xls file.

The only issue I notice now, is the data no longer saves in columns, as it once did when we was manually saving the log entries.

Is there a syntax I am missing to enable this?

 

Thank you.

Mark_Solutions's picture
18
Jan
2012
0 Votes 0
Login to vote

Save it to a text file then

Save it to a text file then open it in Excel - should come straight in using the default option

#edit#

Or try the -l or -L options rather than the -U option to see which gives you the best output - I think they may work better is going straight to a csv file

#edit 2# - re-edited!

Just checked - do it with the -l and to a text file, then open it in Excel and the tab / space delimiter should do the job

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.

smarsh88's picture
18
Jan
2012
0 Votes 0
Login to vote

This still doesnt seem to be

This still doesnt seem to be putting the data into columns frown ... Could be something I'm doing wrong.

 

My syntax that copies to text document works fine...

C:\Windows\system32>"D:\Program Files\Veritas\NetBackup\bin\admincmd\bperror" -all -hoursago 24 > c:\test.txt

Then rename to .csv or .xls and it puts everything in to the first colum but multiple rows.

I then tried:

C:\Windows\system32>"D:\Program Files\Veritas\NetBackup\bin\admincmd\bperror" -all -l -hoursago 24 > c:\test.txt

and then renamed, but still does the same.

Is there something wrong with my command?

Thanks again...

Mark_Solutions's picture
18
Jan
2012
1 Vote +1
Login to vote

Dont rename it - just go to

Dont rename it - just go to excel and open it (show all files) and the import wizard will guide you - took a look and it is easiest to actually set you own seperators in excel

Doesn't convert perfect on its own by the looks of it

I little bit of vbs scripting could possibly do it but there are too many spaces to get it to work perfectly

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.

smarsh88's picture
18
Jan
2012
0 Votes 0
Login to vote

Hmm, still not outputting

Hmm, still not outputting correctly.

I have compared the manual vs automated text documents and it seems that in the manual document, everything is seperated by tabs.

See comparison below:

MANUAL (Note all categories at present along top)

 

AUTOMATED (Scripted)

 

 How do I get all the categories to work with the script and everything seperated by tabs?

Thanks. 

Mark_Solutions's picture
18
Jan
2012
0 Votes 0
Login to vote

The issue for bringing it

The issue for bringing it into excel seems to be the first and last rows:

<2>bperror: INITIATING: version NetBackup 7.1 created: 2011020313

<2>bperror: EXIT status = 0

These disrupt it when bringing it into excel (though i agree tabs is not what it does!)

Who is good at vsb?

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.

Yasuhisa Ishikawa's picture
18
Jan
2012
3 Votes +3
Login to vote

Try this batch (attached .txt is same)

@ECHO OFF
SETLOCAL
SETLOCAL ENABLEDELAYEDEXPANSION

SET PATH=%PATH%;C:\Program Files\Veritas\NetBackup\bin\admincmd

ECHO DATE,TIME,SERVER,CLIENT,SEVERITY,JOBID,TYPE,DESC

FOR /F "tokens=*" %%i IN ('cmd.exe /C "bperror.exe -all -L -hoursago 24 | findstr /N /R .*"') DO (
	SET _line=%%i
	SET _line=!_line:*:=!
	IF "!_line!"=="" (
		IF NOT "!_date!"=="" ECHO !_date!,!_time!,!_server!,!_client!,!_severity!,!_jobid!,!_type!,!_desc!
		SET _date=
		SET _time=
		SET _server=
		SET _client=
		SET _severity=
		SET _jobid=
		SET _type=
		SET _desc=
	) ELSE (
		IF NOT "!_line:~0,1!"==" " (
			SET _num=1
			FOR /F "tokens=1,2,3,4,5,6,*" %%i IN ("!_line!") DO (
				SET _date=%%i
				SET _time=%%j
				SET _server=%%l
				SET _server=!_server:~2!
				SET _client=%%m
				SET _client=!_client:~2!
				IF "!_client!"=="?" SET _client=
				SET _jobid=%%n
				SET _jobid=!_jobid:~2!
			)
		) ELSE IF !_num!==1 (
			SET /A _num=!_num! + 1
			FOR /F "tokens=1,2,3,*" %%i IN ("!_line!") DO (
				SET _severity=%%i
				FOR /F "delims=() tokens=1,*" %%i IN ("!_severity!") DO (
					SET _severity=%%i
				)
				SET _type=%%k
				FOR /F "delims=() tokens=1,*" %%i IN ("!_type!") DO (
					SET _type=%%i
				)
			)
		) ELSE (
			IF "!_desc!"=="" (
				SET _desc=!_line:~2!
			) ELSE (
				SET _desc=!_desc! !_line:~2!
			)
		)
	)
)
ECHO !_date!,!_time!,!_server!,!_client!,!_severity!,!_jobid!,!_type!,!_desc!

AttachmentSize
sample.txt 1.55 KB

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

smarsh88's picture
19
Jan
2012
0 Votes 0
Login to vote

Ok, thank you. Sorry for

Ok, thank you. Sorry for sounding incompetent, but how do I output the results to a text file?

Never done any VBS...

Yasuhisa Ishikawa's picture
19
Jan
2012
0 Votes 0
Login to vote

Batch file contents posted

I posted batch file to create reporting in CSV format.
Just download sample.txt, place it on your master server, and rename it to <desired_name>.bat.
The run it from command prompt!

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

Mark_Solutions's picture
19
Jan
2012
0 Votes 0
Login to vote

I am still working on this

I am still working on this for you as well - nearly there just some tidying up to do - get back to you later with an alternative that does it in one go for you

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.

Marianne van den Berg's picture
19
Jan
2012
1 Vote +1
Login to vote

Why not use the standard

Why not use the standard reports that is available in the free version of OpsCenter?

Reports can be generated and scheduled for automatic email delivery.

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows.
Handy NBU links

Mark_Solutions's picture
19
Jan
2012
0 Votes 0
Login to vote

Thats a good idea

Thats a good idea Marianne!yes

Still - I do like the challenge!

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.

smarsh88's picture
19
Jan
2012
1 Vote +1
Login to vote

Solved... Thank you all!

Managed to get Yasuhisa's script working to absolute perfection... I just edited the commas for tabs (within the ECHO Commands), due to the output data having commas which confused the spreadsheet.

I can now output the script straight to xls/csv without any problems.

Thanks again for all your support. Very much appreciate the help from everyone and for getting this issue resolved so quickly.

Regards,

Shane

smarsh88's picture
19
Jan
2012
0 Votes 0
Login to vote

One more quick question. What

One more quick question. What do I add in to change the date format.

Currently it is mmddyyyy

I would like ddmmyyyy (uk format)

 

Thanks...

Yasuhisa Ishikawa's picture
19
Jan
2012
0 Votes 0
Login to vote

Insert one line

To change date format, just insert one line.

SET _date=%%i
SET _date=!_date:~2,2!/!_date:~0,2!/!_date:~4!
SET _time=%%j

Attachment is modified script with tab delimiter and UK date format.

AttachmentSize
sample_tab_uk.txt 1.62 KB

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

smarsh88's picture
20
Jan
2012
0 Votes 0
Login to vote

Hmm, the date is now

Hmm, the date is now appearing like:

/1/01/9/2012

??

Yasuhisa Ishikawa's picture
20
Jan
2012
1 Vote +1
Login to vote

Ooops!

I made a mistake, sorry.
Please correct as bellow.

SET _date=!_date:~3,2!/!_date:~0,2!/!_date:~6!

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

smarsh88's picture
20
Jan
2012
0 Votes 0
Login to vote

Fixed!

That works perfectly.

Thank you so much!

Mark_Solutions's picture
19
Jan
2012
0 Votes 0
Login to vote

Now you are getting towards

Now you are getting towards VB - abandoned my efforts after you had a result!

Authorised Symantec Consultant

Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.