Batch Export of LAS Audit information

jacksonse

By: jacksonse

April 22, 2012 5:27 pm

Reads: 118

Download batch_export_of_LAS_data.txt

 Lou has been kind enough to share a script he wrote to export the LAS data in buik so the SQL reports can be generated around the summary and trend reports in the NRC console.  So one reason to run some thing like this s is you started using DRA today but did not install the DRA reporting until a year later.  this script walks the LAS directory and re-exports the LAS data to summarize the data for the SQL reports.  This has to be run on each DRA server and you will need to modify the path to the LARK directory and the Logarchive directory in the script.     

Option Explicit

On Error Goto 0

‘ VBScript to reload all DRA log archive data to NRC. Run from the DRA server.

‘ The Log Archive service must be shutdown (also shutdown the Administration Service ‘ to prevent losing any stray DRA activity logging while this is running).

‘ Best run from a cmd window using CSCRIPT, and piping the output to a log file for review.

‘ CSCRIPT <path>\DRALogExportToNRC.vbs > NRCExport.log

 

‘ Path to the LARK Data Exporter executable Const ExePath = “D:\PROGRA~2\NetIQ\DRA\Log Archive Resource Kit\LogArchiveReportDataExporter.exe”

‘ Path to the Log Archive data

Const LogDir  = “D:\PROGRA~2\NetIQ\DRA\NetIQLogArchiveData”

 

Dim Shell, Cmd, RC

Dim FSO, Folder, Subfolder, Subfolders

 

Set Shell = WScript.CreateObject(“WScript.Shell”)

 

Set FSO        = CreateObject(“Scripting.FileSystemObject”)

Set Folder     = FSO.GetFolder(LogDir)

Set Subfolders = Folder.SubFolders

 

‘ Iterate through the log archive partitions and re-export each one For Each Subfolder in Subfolders

  If IsNumeric(Subfolder.Name) Then

    Cmd = Chr(34) & ExePath & Chr(34) & ” Logvolume ” & Subfolder.Name

    WScript.Echo “Running: ” & Cmd

    RC  = Shell.Run(Cmd,,True)

    If RC = 0 Then

      WScript.Echo “Partition Exported: ” & Subfolder.Name & vbCrLf

    Else

      WScript.Echo “ERROR ‘” & RC & “‘ exporting partition ” & Subfolder.Name & vbCrLf

    End If

  End If

Next

 

NetIQ does not test or validate any software, code or other materials provided in, on or through NetIQ Cool Solutions (collectively, “Materials”), so please use caution when downloading or accessing any Materials from Cool Solutions and ensure that you have reasonable and current security, spyware and anti-virus measures in place on your computer and/or network prior to downloading. Additionally, do not use any Materials downloaded from Cool Solutions in any production environment without first testing the Materials to ensure they are compatible with your version of NetIQ software or any other hardware or software present in your network or environment. Cool Solutions is not a substitute for authorized NetIQ support and should not be used as such. NETIQ COOL SOLUTIONS AND ANY MATERIALS ARE PROVIDED ON AN AS-IS, AS-AVAILABLE BASIS WITHOUT ANY WARRANTY OF ANY KIND. By downloading this file, you are agreeing to these terms of use. To report a problem please contact: coolguys-netiq@netiq.com. Your use of Cool Solutions is governed by the Cool Solutions Terms and Conditions. https://www.netiq.com/communities/coolsolutions/terms-and-conditions/

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Cool Tools, Directory and Resource Administrator, Technical Solutions

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

1 Comment

  1. By:jacksonse

    sorry, the script is missing the foreach line

    For Each Subfolder in Subfolders

    it should be:

    Option Explicit
    On Error Goto 0
    ‘ VBScript to reload all DRA log archive data to NRC. Run from the DRA server.
    ‘ The Log Archive service must be shut down (also shut down the Administration Service
    ‘ to prevent losing any stray DRA activity logging while this is running).

    ‘ Best run from a cmd window using CSCRIPT, and piping the output to a log file for review.
    ‘ CSCRIPT \DRALogExportToNRC.vbs > NRCExport.log

    ‘ Path to the LARK Data Exporter executable
    Const ExePath = “D:\PROGRA~2\NetIQ\DRA\Log Archive Resource Kit\LogArchiveReportDataExporter.exe”
    ‘ Path to the Log Archive data
    Const LogDir = “D:\PROGRA~2\NetIQ\DRA\NetIQLogArchiveData”

    Dim Shell, Cmd, RC
    Dim FSO, Folder, Subfolder, Subfolders

    Set Shell = WScript.CreateObject(“WScript.Shell”)

    Set FSO = CreateObject(“Scripting.FileSystemObject”)
    Set Folder = FSO.GetFolder(LogDir)
    Set Subfolders = Folder.SubFolders

    ‘ Iterate through the log archive partitions and re-export each one
    For Each Subfolder in Subfolders
    If IsNumeric(Subfolder.Name) Then
    Cmd = Chr(34) & ExePath & Chr(34) & ” Logvolume ” & Subfolder.Name
    WScript.Echo “Running: ” & Cmd
    RC = Shell.Run(Cmd,,True)
    If RC = 0 Then
    WScript.Echo “Partition Exported: ” & Subfolder.Name & vbCrLf
    Else
    WScript.Echo “ERROR ‘” & RC & “‘ exporting partition ” & Subfolder.Name & vbCrLf
    End If
    End If
    Next

Comment