AutoSys Workload Automation

How To - Use EEM Safex Command to Export and Import EEM Policies via an AE Job (For Windows)

  • 1.  How To - Use EEM Safex Command to Export and Import EEM Policies via an AE Job (For Windows)

    Broadcom Employee
    Posted 09-29-2015 08:02 PM

    You can use the EEM safex command to export EEM policies via an Autosys job. The same command can be used to import those EEM policies into a different EEM instance. This is a step-by-step guide on how to create and execute the job to complete the policy export(s) and import(s).

     

    NOTE: You can also export and import EEM policies using the EEM safex command via the command line by following this guide.

     

    Exporting EEM Policies

    • Download and extract the contents of the EEMr12_Export_Import_v4.zip into your %EIAM_HOME%\bin directory
    • Download and save the eem_safex_export.bat file
    • Use a text editor and edit the eem_safex_export.bat file (instructions on how to fill out the parameters are within the batch file)
    • Create an AE command job that looks similar to the one below:

    /* ----------------- eem_safex_export ----------------- */

     

    insert_job: eem_safex_export  job_type: CMD

    command: "FULL_PATH_TO_EEM_SAFEX_EXPORT.BAT"

    machine: localhost

    owner: Administrator@localhost

    permission:

    date_conditions: 0

    std_out_file: "FULL_PATH_OF_STD_OUT_FILE"

    std_err_file: "FULL_PATH_OF_STD_ERR_FILE"

    alarm_if_fail: 1

    • Execute the job
    • To determine if the job ran correctly, check the following two places:
      1. The location of your exported XML file [%EIAM_HOME%\bin\EEMr12_Export_Import_v4\XML directory]
      2. The std_out file [it should look similar to the output below]


    %EEMBACK_I_018 Export Started at 9/29/2015 2:45:33 PM

     

    %EEMBACK_I_006 Export completed at 9/29/2015 2:45:33 PM

     

     

    Displaying stdout

     

    Setting back end to "hudja03-u131653"

     

     

     

    Displaying stderr

     

    Setting Translation file:C:\Program Files (x86)\CA\SC\EmbeddedEntitlementsManager\bin\safex.tr

     

    OK:Successfully Authenticated

     

    OK: action[Attach] with ApplicationInstance label[WorkloadAutomationAE]

     

    OK: action[Export] performed on object[ApplicationInstance] count[1]

     

    OK: action[Export] performed on object[Folder] count[9]

     

    .

    .

    .

     

    OK:Total objects Added 0

     

    OK:Total objects Modified 0

     

    OK:Total objects Removed 0

     

    OK:Total objects Skipped 0

     

    OK:Total objects Exported 43

     

    %EEMBACK_E_025 Run completed - 9/29/2015 2:45:33 PM

     

     

    Importing EEM Policies

    • Download and save the eem_safex_import.bat file
    • Use a text editor and edit the eem_safex_import.bat file (instructions on how to fill out the parameters are within the batch file)
    • Create an AE command job that looks similar to the one below:

    /* ----------------- eem_safex_import ----------------- */

     

    insert_job: eem_safex_import  job_type: CMD

    command: "FULL_PATH_TO_EEM_SAFEX_IMPORT.BAT"

    machine: localhost

    owner: Administrator@localhost

    permission:

    date_conditions: 0

    std_out_file: "FULL_PATH_OF_STD_OUT_FILE"

    std_err_file: "FULL_PATH_OF_STD_ERR_FILE"

    alarm_if_fail: 1

    • Execute the job
    • To determine if the job ran correctly, check the following two places:
      1. The location of your exported XML file [%EIAM_HOME%\bin\EEMr12_Export_Import_v4\XML directory]
      2. The std_out file [it should look similar to the output below]


    %EEMBACK_I_019 Import Started at 9/29/2015 2:50:17 PM

     

    %EEMBACK_I_020 Removing Application Instance prior to Import at 9/29/2015 2:50:17 PM

     

    %EEMBACK_I_014 Application instance unregistered.

     

     

    Displaying stdout

     

    Setting back end to "localhost"

     

    Displaying stderr

     

     

    Setting Translation file:C:\Program Files (x86)\CA\SC\EmbeddedEntitlementsManager\bin\safex.tr

     

    OK:Successfully Authenticated

     

    OK: action[Attach] with ApplicationInstance label[]

     

    OK: action[UnRegister] performed on ApplicationInstance name[WorkloadAutomationAE] with label[WorkloadAutomationAE]

     

    OK: action[Detach] from ApplicationInstance label[]

     

    OK:Total objects Added 0

     

    OK:Total objects Modified 0

     

    OK:Total objects Removed 1

     

    OK:Total objects Skipped 0

     

    OK:Total objects Exported 0

     

     

    Displaying stdout

     

    Setting back end to "localhost"

     

     

    Displaying stderr

     

    Setting Translation file:C:\Program Files (x86)\CA\SC\EmbeddedEntitlementsManager\bin\safex.tr

     

    OK:Successfully Authenticated

     

    OK: action[Attach] with ApplicationInstance label[]

     

    OK: action[Register] performed on ApplicationInstance name[CA Workload Automation AE] with label[WorkloadAutomationAE]

     

    OK: action[Detach] from ApplicationInstance label[]

     

    OK: action[Attach] with ApplicationInstance label[WorkloadAutomationAE]

     

    OK: action[Skip] performed on object[Folder] name[/Calendars]

     

    OK: action[Skip] performed on object[Folder] name[/Policies]

     

    OK: action[Skip] performed on object[Folder] name[/Users]

     

    OK: action[Skip] performed on object[Folder] name[/UserGroups]

     

    OK: action[Add] performed on object[Folder] name[/WorkloadAutomationAE_Common]

     

    OK: action[Add] performed on object[Folder] name[/WorkloadAutomationAE_W12]

     

    OK: action[Skip] performed on object[Folder] name[/System]

     

    OK: action[Add] performed on object[UserGroup] name[/UserGroups/WorkloadAutomationAEAdmin]

     

    OK: action[Add] performed on object[UserGroup] name[/UserGroups/WorkloadAutomationAEWebService]

     

    OK: action[Add] performed on object[Policy] name[/WorkloadAutomationAE_W12/W12: Default Resources Policy]

     

    OK: action[Add] performed on object[Policy] name[/WorkloadAutomationAE_W12/W12: Default Machine Policy]

     

    OK: action[Add] performed on object[Policy] name[/WorkloadAutomationAE_W12/W12: Default Job Type Policy]

     

    .

    .

    .

     

    OK:Total objects Added 33

     

    OK:Total objects Modified 4

     

    OK:Total objects Removed 0

     

    OK:Total objects Skipped 5

     

    OK:Total objects Exported 0

     

     

    %EEMBACK_I_010 Import completed at 9/29/2015 2:51:17 PM

     

    %EEMBACK_E_025 Run completed - 9/29/2015 2:51:17 PM