How to use Snap Creator PowerShell Toolkit to create custom reports

Snap Creator PowerShell, available here https://snapcreator.netapp.com/download is extremely useful to write your custom scripts.

 

In this blog entry, I am trying to produce a Backup History Report for the last 24 hours, using the Snap Creator PowerShell Toolkit.

 

There are 2 flavors to the script to show the power of the Snap Creator PowerShell Toolkit.

(Huge thanks to and , as this is technically their script!)

 

The first flavor of the script will report all the scheduled jobs that are known to a Snap Creator Server in the last 24 hours.
The report will be divided into a Successful Backup jobs and Failure Backup Jobs.

 

The second flavor of the script will report only the Oracle application related backup jobs in the last 24 hours.

The second report is also added with some intelligence to report the database name and the agent name associated with each config.

 

Steps Explained:

1) Define $24HoursAgo

2) Identify "Scheduled" jobs with a "success" result or "failure" result.

 

PS C:\> Get-ScWorkflowHistory | Get-Member

 

   TypeName: NetApp.SnapCreatorPS.Server.EngineV1.workflowStatus

 

Name                MemberType Definition

----                ---------- ----------

PropertyChanged     Event      System.ComponentModel.PropertyChangedEventHandler PropertyChanged(System.Object, System.ComponentModel.PropertyChangedEventArgs)

Equals              Method     bool Equals(System.Object obj)

GetHashCode         Method     int GetHashCode()

GetType             Method     type GetType()

ToString            Method     string ToString()

action              Property   System.String action {get;set;}

config              Property   System.String config {get;set;}

endTime             Property   System.DateTime endTime {get;set;}

endTimeSpecified    Property   System.Boolean endTimeSpecified {get;set;}

jobId               Property   System.Int32 jobId {get;set;}

jobIdSpecified      Property   System.Boolean jobIdSpecified {get;set;}

jobStatus           Property   System.Int32 jobStatus {get;set;}   (0 means success and -1 means failure)

jobStatusSpecified  Property   System.Boolean jobStatusSpecified {get;set;}

jobType             Property   System.String jobType {get;set;}   (look for scheduled jobs only)

profile             Property   System.String profile {get;set;}

startTime           Property   System.DateTime startTime {get;set;}

startTimeSpecified  Property   System.Boolean startTimeSpecified {get;set;}

taskName            Property   System.String taskName {get;set;}

timestamp           Property   System.String timestamp {get;set;}

userName            Property   System.String userName {get;set;}

workflowId          Property   System.Int32 workflowId {get;set;}

workflowIdSpecified Property   System.Boolean workflowIdSpecified {get;set;}

 

3) Report the output in a custom format table and email the output (separated by success and failure).

4) An example output of the first script looks like the output given below.

 

Successful Backup Jobs in the Last 24 Hours

profile Config StartTime            EndTime              TimeTaken

------- ------ ---------            -------              ---------

siva    c2sv   9/13/2013 4:25:43 PM 9/13/2013 4:27:16 PM 00:01:32.8310000

siva    my100  9/13/2013 4:49:30 PM 9/13/2013 4:49:42 PM 00:00:12.1000000

siva    my100  9/13/2013 4:50:00 PM 9/13/2013 4:50:12 PM 00:00:12.3840000

siva    my100  9/13/2013 4:52:00 PM 9/13/2013 4:52:12 PM 00:00:12.2940000

 

Failed Backup Jobs in the Last 24 Hours

profile Config            StartTime             EndTime               TimeTaken

------- ------            ---------             -------               ---------

oracle  oracle_hpux_risc  9/13/2013 9:37:44 AM  9/13/2013 9:37:44 AM  00:00:00.1430000

oracle  oracle_hpux_risc  9/13/2013 9:38:00 AM  9/13/2013 9:38:00 AM  00:00:00.1410000

oracle  oracle_aix        9/13/2013 9:38:00 AM  9/13/2013 9:38:00 AM  00:00:00.1530000

oracle  oracle_aix        9/13/2013 10:38:00 AM 9/13/2013 10:38:00 AM 00:00:00.1300000

oracle  oracle_hpux_risc  9/13/2013 10:38:00 AM 9/13/2013 10:38:00 AM 00:00:00.0970000

oracle  oracle_aix        9/13/2013 11:38:00 AM 9/13/2013 11:38:00 AM 00:00:00.1140000

 

5) An example output of the second script looks like the output given below.

Please note that this output also includes DatabaseName (sid:username) and Agent IP address.

 

Successful Backup Jobs in the Last 24 Hours

profile Config           Agent         Dbname             StartTime             EndTime               TimeTaken

------- ------           -----         ------             ---------             -------               ---------

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 9:38:00 AM  9/13/2013 9:38:00 AM  00:00:00.1530000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 10:38:00 AM 9/13/2013 10:38:00 AM 00:00:00.1300000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 11:38:00 AM 9/13/2013 11:38:00 AM 00:00:00.1140000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 12:38:00 PM 9/13/2013 12:38:00 PM 00:00:00.1330000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 1:38:00 PM  9/13/2013 1:38:00 PM  00:00:00.1090000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 2:38:00 PM  9/13/2013 2:38:00 PM  00:00:00.1210000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 3:38:00 PM  9/13/2013 3:38:00 PM  00:00:00.1060000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 4:14:00 PM  9/13/2013 4:14:00 PM  00:00:00.1150000

 

Failed Backup Jobs in the Last 24 Hours

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 4:50:00 PM  9/13/2013 4:50:00 PM  00:00:00.2570000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 4:52:00 PM  9/13/2013 4:52:00 PM  00:00:00.1570000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 4:54:00 PM  9/13/2013 4:54:00 PM  00:00:00.6880000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 4:56:00 PM  9/13/2013 4:56:00 PM  00:00:00.3600000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 4:58:00 PM  9/13/2013 4:58:00 PM  00:00:00.4180000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 5:22:00 PM  9/13/2013 5:22:00 PM  00:00:00.3430000

oracle  oracle_aix       10.61.161.227 NFSGAUTCHER:oradba 9/13/2013 5:24:00 PM  9/13/2013 5:24:00 PM  00:00:00.3610000

oracle  oracle_hpux_risc 10.61.168.155 NFSGAUTCHER:oracle 9/13/2013 5:14:00 PM  9/13/2013 5:14:00 PM  00:00:00.3880000

oracle  oracle_hpux_risc 10.61.168.155 NFSGAUTCHER:oracle 9/13/2013 5:16:00 PM  9/13/2013 5:16:00 PM  00:00:00.3880000

oracle  oracle_hpux_risc 10.61.168.155 NFSGAUTCHER:oracle 9/13/2013 5:18:00 PM  9/13/2013 5:18:00 PM  00:00:00.3550000

oracle  oracle_hpux_risc 10.61.168.155 NFSGAUTCHER:oracle 9/13/2013 5:20:00 PM  9/13/2013 5:20:00 PM  00:00:00.3940000

oracle  oracle_hpux_risc 10.61.168.155 NFSGAUTCHER:oracle 9/13/2013 5:22:00 PM  9/13/2013 5:22:00 PM  00:00:00.3680000

oracle  oracle_hpux_risc 10.61.168.155 NFSGAUTCHER:oracle 9/13/2013 5:24:00 PM  9/13/2013 5:24:00 PM  00:00:00.3990000

 

Please share your feedback after trying out this script.  Also, I welcome you to share your cool PowerShell script to me at sivar @ netapp.com so that we can showcase it here.

Comments

Hi. Where can I download Snap Creator PowerShell Toolkit?
The link https://snapcreator.netapp.com/download dead.

Link to download still dead?

Is there another link where we can download the snapcreator powershell plug-in?