Quantcast
Channel: Software Communities : Popular Discussions - vRanger
Viewing all articles
Browse latest Browse all 1662

Ranger Report alternative. Flexible PowerShell script

$
0
0

Few customers are concerned with the fact that scheduled reports in Ranger 6.1.0 disappear after service restart. On-demand reports seem to be ok.

This bug will be fixed in v. 7.x

I posted one alternative method before (http://communities.quest.com/thread/25191?tstart=0). MS Access can be used to generate various reports.

Meantime I decided to look at what Ranger GUI normally provides. Well, frankly speakling, we can do better.

There are few things that need improvements. For example, Backup Task Report:

  1. Backup size reported in GB while actual numbers are in MB.
  2. Report will never include jobs that failed to create individual task. This failure (which Ranger does not consider failure) is hard to trace through GUI.

 

Long story short. Attached is a powershell script that will create a report equivalent to Backup Task Report.

 

Advantages:

  1. As usually it is Ranger independent, you can run it from any Windows box with PS v.2 installed.
  2. There are 3 delivery options: output saved locally as html file, email with html body, email with html file attached.
  3. Script will generate report for any data returned by SELECT statement in the body of the script.. If you can construct (you are welcome to ask for help) necessary SELECT statement, the script can be used for any kind of report, e.g. savepoints distributed between repos, last successful run for each VM, etc.
  4. If you are failiar with HTML and CSS you can easily customize report, e.g. table colors, fonts, etc.

 

Instructions:

  1. Save attachment to your system. Remove .zip extension.
  2. Adjust parameters under VARIABLE BLOCK.
  3. Open powershell and and navigate to a script location.
  4. You may need to enable script execution (Set-ExecutionPolicy unrestricted).
  5. Execute script: .\BT_report00.ps1

 

Here are few screenshots:

 

Backup Task report in IE.

pic01.png

 

Mini SavePoint report as email with html body. Following SELECT was used:

$SqlCmd.CommandText = "select top 100 VmName, StartTime, SizeInMbOriginal, SizeInMbStored from savepoint where IsDeleted = 0 order by VmName, StartTime"

pic02.png


Viewing all articles
Browse latest Browse all 1662

Trending Articles