1 Reply Latest reply on Apr 11, 2013 9:06 AM by Paul Kloves
      • 1. Re: PCM getting configuration

        There is no command to "get" all configured Patrol Agent configurations, but I was able to get around this by applying a dummy variable and telling the CLI to back up all Agents.

         

        My dummy variable was:

         

          PATROL_CONFIG

          "/AgentSetup/Dummy/LastRuleSetApplyDate" = { REPLACE = "%LA_TIME%" }

         

        I then used the following Windows Batch file to apply this rule, which, of course, created a backup of each Patrol Agent's configuration:

         

        @Echo Off

        rem ------------------------------------------------------------------------------------------

        rem PCM-AutoGet.bat:  This script uses the PCM CLI to push a dummy RuleSet for the sole

        rem       purpose of automatically generating a backup of all Patrol Agents Configurations.

        rem       The RuleSet we push out, /Custom_RuleSets/GetLatestConfig/DateOfLastApply, sets a

        rem       Patrol Configuration variable, /AgentSetup/Dummy/LastRuleSetApplyDate with the date

        rem       and time stamp of the last time a RuleSet was applied to this server.  Not that this

        rem       is very useful information, but I felt like setting it to something kinda useful.

        rem

        rem Paul Kloves 2006-01-10

        rem ------------------------------------------------------------------------------------------

         

         

        SETLOCAL

         

         

        set SCRIPT=%TEMP%\%COMPUTERNAME%-%1-AgentReport.cli

        set LOG="%USERPROFILE%\My Documents\PCM-AutoGet.log"

         

         

        echo apply -ba -g WindowsOS Custom_RuleSets\GetLatestConfig\DateOfLastApply > %SCRIPT%

        echo apply -ba -g UnixOS Custom_RuleSets\GetLatestConfig\DateOfLastApply >> %SCRIPT%

         

         

        "%BMC_ROOT%\pconfmgr\pcm.cmd" -P "SOFTWARE\BMC Software\Patrol\SecurityPolicy_v3.0\pcm_cli" -f %SCRIPT% > %LOG% 2>&1

         

         

        ENDLOCAL

        exit 0

         

        Notice that I am applying the Rule to groups called WindowsOS and UnixOS.  These groups contain all of my Patrol Agents.  Also, I think I was passing the script the date and time so that the CLI file created had the dat and time in the filename.

         

        Hope this helps some,

          -Paul