RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • About
  •  

    Backup eXc Virtual Agent Config

    June 23rd, 2008

    I work in an environment that is over 90% virtualized on VMWare and to aid in monitoring that environment via OpsMgr 2007, I use Quest Management Xtensions (formerly eXc Virtual Agent). I have not yet had a chance to work with the recently released Operations Manager 2007 Cross Platform Extensions Beta. The Quest product is completely configurable (aside from the base framework) because everything is written in scripting language making calls to the VMWare and Linux kernels via WMI and SNMP and all the configuration files are stored in XML. The developers support custom changes to the script source code and even welcome submission of new ideas/techniques.

    While this makes the software very flexible, it also leaves room to mess things up which I have done a couple of times in the past while learning my way around. I also blew away my configs when I updated to the latest base framework a few months ago because I didn’t have the XML backed up. To prevent this in the future, I wrote a very simple, old-school backup process which captures the configuration files as well as the encrypted password files.

    This process runs on a central server that I use for automating and scheduling custom enterprise scripts and tasks. It consists of two simple files; a command batch script and a simple vbscript listed below. In addition, it requires that 7-zip be installed where the scripts will be run as it is used to compress the configuration files into a single archive.

    @echo off
    REM ======================================================================
    REM
    REM NAME: Backup_eXc_Config.cmd
    REM
    REM AUTHOR: Alan
    REM DATE  : 5/27/2008
    REM
    REM COMMENT: Backs up eXc config settings for XML and encrypted passwords.
    REM
    REM REQUIREMENTS:
    REM     1. 7-Zip must be installed to default location (www.7-Zip.com)
    REM     2. The DeleteFilesGT30Days.vbs script must be in same directory.
    REM ======================================================================
    
    REM SERVER01
    REM Get Date.
    set datestring=%date%
    
    REM Replace forward slashes with underscores.
    set datestring=SERVER01_%datestring:/=_%.zip
    
    REM Replace day with nothing so only date is left.
    set datestring=%datestring:Sun =%
    set datestring=%datestring:Mon =%
    set datestring=%datestring:Tue =%
    set datestring=%datestring:Wed =%
    set datestring=%datestring:Thu =%
    set datestring=%datestring:Fri =%
    set datestring=%datestring:Sat =%
    
    REM Change dir to 7-Zip and compress
    cd "C:\Program Files\7-Zip"
    7z.exe a -tzip "C:\Scripts\Batch\eXcBackup\"%datestring% "<a href="file://\\SERVER01\c$\Program">\\SERVER01\c$\Program</a> Files\eXc Software\WMI Providers\nonWindows\Virtual Agent Library\mom\VMWare" -r -x!*.log* -x!*.mdb -x!*.ldb -aoa
    7z.exe u "C:\Scripts\Batch\eXcBackup\"%datestring% "<a href="file://\\SERVER01\c$\Program">\\SERVER01\c$\Program</a> Files\eXc Software\WMI Providers\nonWindows\Encryption" *.txt
    
    REM Call script to delete old archives.
    cscript //nologo "C:\Scripts\Batch\eXcBackup\DeleteFilesGT30Days.vbs"
    '==========================================================================
    '
    ' NAME: DeleteFilesGT30Days.vbs
    '
    ' AUTHOR: Alan
    ' DATE  : 5/27/2008
    '
    ' COMMENT: Deletes .zip files in current directory older than 30 days.
    '
    '==========================================================================
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        &amp; "{impersonationLevel=impersonate}!\\" &amp; _
            strComputer &amp; "\root\cimv2")
    Set colFiles = objWMIService.ExecQuery _
        ("Select * from CIM_DataFile where Path = '\\Scripts\\Batch\\eXcBackup\\'")
    For Each objFile in colFiles
        If InStr(objFile.Name, ".zip") Then
            Set objZipFile = objFSO.Getfile(objFile.Name)
            If objZipFile.DateCreated &lt; (Now - 30) Then
             objZipFile.Delete
         End If
        End If
    Next

    Starting off easy…

    June 19th, 2008

    I’ve never been much of a blogger but I have learned a lot from reading other technical blogs and felt it might be a good idea to give a little back. In addition, this just makes an easy way for me to post and upload things I’m working on for later referral. Anyway, hope some of the scripts, etc that I post will help some others. Off and running then…

    Let’s start it off with a simple management pack shall we? I am by no means an Operations Manager guru, but frustration does tend to fuel the creative fire, eh? After looking at many frustrating posts from others regarding Symantec’s utter disregard of the multiple requests for a OpsMgr 2007 MP for BackupExec coupled with the fact that I needed one; I took the rules I used from the MOM 2005 MP and created my own for OpsMgr 2007.

    While this works without issue in my environment, I will reiterate that I am not a MP genius and have only written a few custom MP’s with many customizations added to the sealed MP’s. Also, while this works great in my environment, I do not guarantee (nor do I support) results in your environment. Individual mileage will vary. Hope this gets some other frustrated SCOM admins a little relief as it did for me.

    BackupExecMP