Issue CLI Commands with the MCS Utilities Tool

uimpga-ga
cli_tool
Use the MCS Utilities Tool to issue CLI commands to perform the following functions:
  • Find and fix configuration profile differences
  • Import and export configuration profiles
The MCS Utilities Tool provides the following value:
  • Flexibility to schedule reconciliation after business hours
  • In-depth reports that list detected profile differences
  • Increased performance of the mon_config_service probe
Contents
2
Prerequisites for Running the MCS Utilities Tool
(For 9.0.2 or Later) The device where you run the MCS Utilities Tool requires the following items being installed or running:
  • Java 8
  • wasp probe running on the robot
  • mon_config_service_ws 9.0.2 (or later) package is required to import or export templates.
  • The mon_config_service_cli 20.33 package is available with the UIM 20.3.3 release.
  • The mon_config_service_cli 20.31 package is included in the bundle mon_config_service_bundle 20.31. This bundle is released as part of the UIM 20.3.1 patch. The UIM 20.3.1 patch includes various standalone artifacts. Therefore, ensure that you deploy the related 20.3.1 artifacts (mon_config_service 20.31, mon_config_service_ws 20.31, mon_config_service_recon 20.31, mon_config_service_cli 20.31, robot_update 9.32, OC 20.3.1 Upgrade Installer, uimapi 20.31) to access the complete functionality that the patch provides.
If you want to run the MCS Utilities Tool on a device other than the primary hub, ping the primary hub from that device. The ping allows you to verify that the tool can establish a connection to the primary hub.
(For 8.5.0 or Earlier) For The device where you run the MCS Utilities Tool requires the following items being installed or running:
  • mcs-cli.jar
  • Java 7
  • wasp probe running on the robot where you installed mcs-cli.jar
  • mon_config_service_ws 8.5.0 package is required to import or export templates. Contact CA Support to get the mcs_ws-8.5.0 zip, and then import and deploy the package to the primary hub.
If you want to run the MCS Utilities Tool on a device other than the primary hub, ping the primary hub from that device. The ping allows you to verify that the tool can establish a connection to the primary hub.
(For 9.0.2 or Later) Deploy mon_config_service_cli
Deploy mon_config_service_cli from the local archive.
Follow these tasks:
  1. In Admin Console on the Archive tab, click the inline menu button ( Inline menu.png ) next to mon_config_service_cli and select
    Deploy
    .
  2. In the Hubs pane, select the primary hub.
  3. In the Target Robots pane, click '
    X
    ' to remove all robots but the primary hub.
  4. Click
    Deploy
    .
  5. The MCS Utilities Tool is available from a command line.
mon_config_service_ws 20.31 is included in the bundle mon_config_service_bundle 20.31. This bundle is released as part of the UIM 20.3.1 patch. Therefore, ensure that the related packages (mon_config_service 20.31, mon_config_service_ws 20.31, mon_config_service_recon 20.31, robot_update 9.32) are already deployed.
(For 8.5.0 or Earlier) Download the MCS Utilities Tool
Download the MCS Utilities Tool from the page.
Follow these steps:
  1. Click the
    Archive
    tab.
  2. Enter your login credentials.
  3. Click the disk icon for
    MCS Utilities Tool
    to download the mcs_cli-8.5.0.zip.
  4. Import the mcs_cli-8.5.0.zip to your primary hub by completing these steps:
    1. Access Admin Console and select a primary hub in the left panel.
    2. Select the
      Archive
      tab.
      This following image shows the location of the Archive tab available when a hub is selected.
      Sample Admin Console page with the Archive tab identified
    3. From the Actions drop-down list, select
      Import Packages
      .
      The following image shows the Import Packages option in the Actions drop-down.
      Actions drop-down with the Import Packages option
    4. Browse and select the downloaded mcs_cli-8.5.0.zip package.
    5. Select
      Yes
      on the Import dialog to confirm the import.
  5. Deploy mon_config_service_cli from the web archive to the local archive by completing these steps:
    1. In Admin Console on the Archive tab, click the inline menu button ( Inline menu.png ) next to mon_config_service_cli and select
      Deploy
      .
    2. In the Hubs pane, select the primary hub.
    3. In the Target Robots pane, click '
      X
      ' to remove all robots but the primary hub.
    4. Click
      Deploy
      . The MCS Utilities Tool is available from a command line.
Finding and Fixing Profile Differences
Use the following process to find and fix profile differences:
  1. Issue the Find-Profile-Diffs command to find robots with configuration profile differences.
  2. Issue the Fix-Profile-Diffs command to fix profile differences.
  3. Re-issue the Find-Profile-Diffs command with a file that lists the robots that had profile differences to verify that profile differences no longer exist.
Find Configuration Profile Differences Using the Find-Profile-Diffs Tool
The Find-Profile-Diffs tool finds differences in configuration profiles that the Monitoring Configuration Service (MCS) manages. Profile differences can occur when profile settings are changed in the Admin Console while the MCS is managing the profile. If a robot is reverted to a previous version, the configuration profiles might also be reverted to an earlier version that the Admin Console created.
The Find-Profile-Diffs tool finds devices (robots) with the following profiles:
  • Orphaned configuration profiles – Profiles that were deployed but are no longer being tracked by the Monitoring Configuration Service.
  • Configuration profile differences – Profile differences occur when the key values that are stored in the database do not match the configuration profiles that are applied to a target device.
Methods to Check for Configuration Profile Differences
The two ways to use the Find-Profile-Diffs tool to check for configuration profile differences are the following:
  • Use a scheduler to run the Find-Profile-Diffs command to check profiles that are managed by the Monitoring Configuration Service.
  • Run the Find-Profile-Diffs tool on-demand for a small number of robots and verify that the differences have been corrected.
Schedule a CRON Job and Find Configuration Profile Differences
You can schedule a CRON job to run the Find-Profile-Diffs command during non-critical operating hours, such as evenings or weekends. The tool does the following:
  1. Processes the first robot.
  2. Continues to process robots until the configured
    maximum run time
    or until the tool finishes processing all robots.
    At maximum run time, the tool attempts to finish processing the threads that it is running, and gracefully shuts down.
    • The tool remembers the last robot that it finished processing.
    • At the next scheduled CRON job, the tool begins processing where it left off.
    • When the tool finishes processing all robots, it returns to the first robot and the tool starts processing its profiles again.
After the tool generates a list of robots with profile differences, you can fix the profiles with differences. For more information, see the Use the Fix-Profile-Diffs Tool topic.
Find-Profile-Diffs Command Syntax
This command finds robots with configuration profile differences and automatically generates the devices_with_deltas report. This report lists the robots with orphaned configuration profiles or profile differences.
For detailed information about every probe that the Monitoring Configuration Service deployed or configured, use the -verbose argument. The -verbose argument generates the verbose_device_report in addition to the devices_with_deltas report.
The find-profile-diffs command uses the following format:
java -jar mcs-cli.jar find-profile-diffs [-engine
data engine address
] [-file
filename
] [-max_run_time
seconds
] -password
UIM password
[-probe_checker_type
callbacks
|
database
] [-threads
integer
] [-uim
UIM IP address
] -username
UIM_username
[-verbose
yes
|
no
]
You can run the Find-Profile-Diffs tool from different locations. However, we recommend that you run the tool from the same location to allow the tool to remember the last fully processed robot.
(Not Applicable)
This is the web service base URL. This argument should not be used with this command.
  • -engine
    /domain/hub/robot/data_engine
(Optional)
The UIM address of the data_engine to connect to. Use the format:
/domain/hub/robot/data_engine
.
If you are running the Find-Profile-Diffs tool on the primary hub, this argument is not required.
  • -file
    filename
(Optional)
Specify the relative or absolute path to the file that contains a list of robots (less than 100) the tool processes. In the file, list one robot name per line. Use this argument when you want to verify that the robots in the list do not have profiles with differences.
Omit this argument if you want the tool to process all robots with configuration profiles that are managed by the Monitoring Configuration Service.
Tip:
You can use the Devices_with_deltas report as the file with the list of robots.
  • -force
(Optional)
Ignore non-fatal errors.
  • -max_run_time
    seconds
(Optional)
Specify the number of seconds the tool processes robots with MCS configuration profiles. When the tool finishes processing configuration profiles or reaches the configured maximum run time, the tool gracefully shuts down. At max_run_time, if the tool is processing threads (for example, processing thread 4 of 10) the tool attempts to process the in-progress threads and gracefully shuts down.
Default
: 600 seconds (10 minutes)
When determining the max_run_time, factor in some extra time to allow the tool to finish processing in-progress threads and gracefully shut down. For example, if you have a two-hour window to run the tool, consider setting max_run_time to 5400 seconds. This allows an extra 1800 seconds for the tool to finish processing in-progress threads.
  • -password
    UIM password
(Required)
Specify the password that is used to log in the UIM server.
  • -probe_checker_type
    database
    |
    callbacks
(Optional)
Specify how the Find-Profile-Diffs tool checks for probes that are configured with the Monitoring Configuration Service.
database
– Use this option if you want the tool to query the database.
callbacks
– Use this option if you want the tool to issue callbacks to target devices to determine which probes were configured with the Monitoring Configuration Service.
When specifying callback with this argument, if the tool receives a NimException with status code 4 (usually due to a robot being unreachable), a warning message appears in the mcs-cli log instead of the entire stack trace. The log message is:
Couldn't reach device with cs id {id} due to {exception_message} ; flagging it as not having at least one of the possible probes installed.
The tool adds a log message in the mcs-cli log file every time the tool queries the database or runs callbacks to check for probes on target devices. The log message is:
Begin looking for devices with at least one of the possible probes installed using {CALLBACK_CHECKER | DATABASE_CHECKER}.
Default
: callbacks
  • -property_file
    filename
(Optional)
The absolute or relative path to a file that contains the login credentials for the UIM server.
Default
: /home/jp/.mcs-cli.properties
  • -threads
    thread count
(Optional)
Specify the number of threads the tool process in parallel. Valid range is 1-50.
Default: 30
  • -uim
    IP address of primary hub
(Optional)
Specify the IP address of the primary hub where you want to run the Find-Profile-Diffs tool.
If you are running the tool on the primary hub, this argument is not required.
  • -
    username UIM username
(Required)
Specify the username that is used to log in the UIM server.
  • -verbose <
    on
    |
    off
    >
(Optional)
When verbose output is enabled, the Find-Profile-Diffs tool generates a verbose_device_report file. The file is stored in an Output/verbose_device_report folder in the directory where you run the Find-Profile-Diffs tool. For more information, see the verbose_device_report topic.
find-profile-diffs Command Examples
Run find-profile-diffs from the Primary Hub
The following command is issued from the primary hub. The command specifies to process profiles on robots for 90 minutes. The tool used callbacks (default) to determine which probes were configured with the Monitoring Configuration Service. After 90 minutes, the tool persists the last robot that is processed in the current run and gracefully shuts down. The following command can use ten threads. The tool generates the device_with_deltas report.
java -jar mcs-cli.jar find-profile-diffs -username jon -password test -threads 10 -max_run_time 5400
Run find-profile-diffs from a Secondary Hub
The following command is issued from a secondary hub. The tool uses 10 threads, runs for 90 minutes, and queries the database to determine which probes were configured with the Monitoring Configuration Service. The tool generates the device_with_deltas report and the verbose_device_report.
java -jar mcs-cli.jar find-profile-diffs -engine /domain/hub/robot/data_engine -uim 10.0.0.0 -username jon -password test -probe_checker_type database -threads 10 -max_run_time 5400 -verbose yes
Ensure the Tool Has Reconciled Profiles with Differences
The following command is issued from the primary hub after the fix-profile-diffs command was issued to reconcile profiles that are identified in a generated device_with_deltas report. The tool looks only at the robots that are listed in the specified file for profile differences. The file is a generated device_with_deltas report. This action lets you see if the tool reconciled all the profiles with differences that are listed in a device_with_deltas report.
java -jar mcs-cli.jar find-profile-diffs -username jon -password test -threads 10 -max_run_time 5400 -file /tmp/robots.txt
Find-Profile-Diffs Reports
The Find-Profile-Diffs tool generates reports and stores them in an Output folder in the directory where you run the tool. You do not have to run the tool from the directory where you saved the tool.
Device_with_deltas Report
The Devices_with_deltas report lists the robots with orphaned configuration profiles or profile differences. Orphaned configuration profiles are profiles that Monitoring Configuration Service deployed, but were not applied to a probe, so the profile remains inactive on a robot. Differences, or deltas, are detected when a key value in the MCS database does not match the configuration profile applied to a probe.
Verbose_device_report Report
The Verbose_device_report report lists every probe that was deployed or configured with the Monitoring Configuration Service. For each probe, the report lists the following information:
  • Number of Diffs – A count of profile differences that are detected on a robot.
  • Orphaned Profile IDs Found – A comma-separated list of orphaned profile IDs, or configuration profiles that encountered an error condition before being applied to a probe.
  • All Known Profile IDs Found – A comma-separated list of all the profile IDs applied to probes on a robot.
  • Profile IDs and Names with Diffs – A list of differences for each profile ID. Each discrepancy item includes the key value pair, the old value (the key value in the MCS database), and the new value (the key value in the cfg file the tool retrieved from the robot). If no profile differences are found, this information is omitted.
The verbose_device_report folder appears when you specify the -verbose argument with the Find-Profile-Diffs command. The Output/verbose_device_report folder resides where you run the Find-Profile-Diffs command. For example, if you save the mcs-cli.jar package in B:\ but you run the find-profile-diffs command from A:\ (for example, java –jar B/mcs-cli.jar find-profile-diffs) an Output folder with the verbose_device_report is generated and stored in A:\.
Fix Configuration Profile Differences Using the Fix-Profile-Diffs Tool
After you issue the Find-Profile-Diffs command, the tool generates a list of robots with profile differences. Use the Fix-Profile-Diffs tool to fix configuration profile differences. The tool fixes configuration profiles for the following:
  • Devices that are members of a USM group.
  • A specific device.
  • A list of robots specified in a file.
How the Tool Knows Which Configuration Profiles to Fix
You indicate which configuration differences the tool fixes by using the following arguments with the CLI command:
  • -device
  • -group
  • -file
Schedule a CRON Job and Fix Configuration Profile Differences
Instead of issuing the fix-profile-diffs CLI command, you can create a job in a scheduler (such as a CRON job on a Linux system) to run the Fix-Profile-Diffs tool. The tool processes
Fix-Profile_Diffs Command Syntax
The find-profile-diffs command uses the following format:
java -jar mcs-cli.jar fix-profile-diffs [-host IP address] [-device
ID] [-group ID
] [-threads
integer
] [-action delete|overwrite] [-engine
data engine address
] [-file
filename
]
-username
UIM username
-password
Use the –device argument, the –group argument, or the -file argument with the fix-profile-diffs command to indicate which configuration profiles the tool is fixing. Use the -group or -device arguments to fix profiles for a specific group or device. Use the -file argument to fix profiles for robots that are listed in a specified file.
  • -action
    delete|overwrite
(Optional)
The action the MCS takes when reconciling profiles with differences.
delete
- Deletes the probe, redeploys the probe, and reapplies the existing configuration profile.
If you specify the
-action delete
and
-group <ID>
arguments in the command, the
-action
automatically defaults to
overwrite
. To override this behavior and allow the tool to execute
-action delete
, include the
-force
argument.
overwrite
- The tool overwrites the configuration settings with the values in the existing configuration profile.
Default:
overwrite
(Not Applicable)
This is the web service base URL. This argument should not be used with this command.
  • -device
    CS_ID for a device
(Optional)
Specify the CA UIM computer system ID (CS_ID) of a target device that has profiles with differences. Computer system IDs are found in the CM_COMPUTER_SYSTEM table.
If you use this argument in the command, do not use the
-group
or
-file
arguments.
  • -engine
    /domain/hub/robot/data_engine
(Optional)
The UIM address of the data_engine to connect to. Use the format:
/domain/hub/robot/data_engine
.
If you are running the Fix-Profile-Diffs tool on the primary hub, this argument is not required.
  • -file
    filename
(Optional)
Indicates that the tool fixes the robots listed in the specified file. Specify the relative or absolute path to the file that lists the robot names. The file should list each robot name on a separate line, and should contain less than 100 robots. Robot names are found in the “name” column of the SSSRV2Device table. You can use the Devices_with_deltas report as the file with the list of robots.
Omit this argument when you want the tool to fix profile differences on all robots.
If you use this argument in the command, do not use the
-device
or
-group
arguments.
  • -force
(Optional)
Specify this argument if you want the tool to ignore non-fatal errors, or if you want the tool to delete and re-apply group configuration profiles during reconciliation. For more information, see the
-action
argument description.
  • -group
    group ID
(Optional)
Specify the group ID of a USM group that has group configuration profiles with differences. Group IDs are found in the SSRV2DeviceGroup table.
If you use this argument in the command, do not use the
-device
or
-file
arguments. When specifying this argument, the
-action
argument defaults to
overwrite
regardless of the value specified. To change this behavior, you must include the
-force
argument. See the -action and -force argument descriptions.
  • -host
    IP address
(Optional)
The IP address of the primary hub robot. Include this optional argument if a message displays to indicate an illegal session ID was detected (Caused by: (15) illegal SID, Received status (15) on response (for sendRcv)…).
  • -password
    UIM password
(Required)
Specify the password that is used to log in the UIM server.
  • -property_file
    filename
(Optional)
The absolute or relative path to a file that contains the login credentials for the UIM server.
Default
: /home/jp/.mcs-cli.properties
  • -threads
    thread count
(Optional)
Specify the number of threads the tool can use to reconcile profiles. Valid range is 1-50.
Default: 5
  • -username
    UIM username
(Required)
Specify the username that is used to log in the UIM server.
fix-profile-diffs Command Examples
Run fix-profile-diffs from the Primary Hub
The following command is issued from the primary hub. This command reconciles all profiles with differences on device 1. The tool overwrites profiles with differences with the configuration profile applied to the robot. The tool can use five threads (default) for processing. You can generate a Profile Reconciliation Report by issuing the cli-report command.
java -jar mcs-cli.jar fix-profile-diffs -username <username> -password <password> -device 1 -action overwrite
Run fix-profile-diffs from a Secondary Hub
The following command is issued from a secondary hub. This command fixes all profiles with differences on group 10. The tool deletes probes, redeploys probes, and then re-applies profiles to all member devices with profile differences in group 10. Notice the -force argument which overrides the group action default of overwrite. The tool can use five threads (default) for processing. You can generate a Profile Reconciliation Report by issuing the cli-report command.
java -jar mcs-cli.jar fix-profile-diffs -engine /domain/hub/robot/data_engine -group 10 -username jon -password test -action delete -force
Fix Profiles with Differences on the Robot List
You received an error message indicating an illegal session ID was detected when we ran the fix-profile-diffs command. We issued the following command from a secondary hub. This command fixes all profiles on robots that are listed in the file /tmp/robots.txt. The tool deletes probes, redeploys probes, and then re-applies profiles to all robots listed in the specified file. The -force argument tells the tool to ignore non-fatal errors. The tool can use four threads for processing.
You can generate a Profile Reconciliation Report by issuing the cli-report command.
java -jar mcs-cli.jar fix-profile-diffs -host 10.0.0.0 -engine /domain/hub/robot/data_engine -file /tmp/robots.txt -username jon -password test -action delete -force -threads 4
Generate a Profile Reconciliation Report
You can issue a
cli-report
command to generate a report of the audit events for a given time period. The results are stored in the filename designated in the -output argument. The command syntax is:
java -jar mcs-cli.jar cli-report -host
IP address
-start
yyyy-MM-dd'T'HH:mm:ss.SSSZZ
-end
yyyy-MM-dd'T'HH:mm:ss.SSSZZ
-output filename of report
  • -host
    IP address
(Optional)
IP address of the primary hub robot. Include this optional argument if a message displays to indicate an illegal session ID has been detected (Caused by: (15) illegal SID, Received status (15) on response (for sendRcv)…).
  • -output
    filename
(Optional)
The relative or absolute path to the file where this report is saved. This file is in CSV format so a .csv extension is recommended. If this is the first time you are generating this report, the tool automatically creates this file. The file is overwritten if a report already exists.
  • -start
    yyyy-MM-dd'T'HH:mm:ss.SSSZZ
(Required)
A date and time to start running the report. Example: 2016-05-18T13:32:56.971-0600
  • -end
    yyyy-MM-dd'T'HH:mm:ss.SSSZZ
(Required)
A date and time to stop generating the report. Example: 2016-05-18T15:32:00.000-0600
Example
The following command generates audit events in a CSV file for the device with the address 10.10.10.105. Each row is an audit event. The tool generates the report for 24 hours, starting on April 21, 2017 at 1 pm. The audit events are stored in the
outtext.csv
file.
java -jar mcs-cli.jar cli-report -username administrator -password xxxx -host 10.10.10.105 -start 2017-04-21T12:13:14.000-0500 -end 2017-04-22T12:13:14.000-0700 -output outtext.csv
Export Configuration Profiles
You can export existing Monitoring Configuration Service configuration profiles with the
profile-export
command. The export process saves an exported profile as an XML file. You can import the XML file to your system or you can archive the file as a backup of your current configuration. Only Nimbus users who have POLICY_MANAGEMENT and PROBE_TEMPLATE_MANAGEMENT permissions can export Monitoring Configuration Service configuration profiles.
The mon_config_service_ws v9.00 package must be installed and deployed to the primary hub before you can export configuration profiles.
Export Profile Command Syntax
Enter the profile-export command on a command line to export an MCS configuration profile. The profile export is possible for group-level and device-level profiles. The command syntax is:
java -jar mcs-cli.jar profile-export -base_url
http://<IP address>/mcsws/v<version>
[-device
ID
] [-group
ID
] -profile
ID
[-file
filename
]
Use the –device argument, the –group argument, or the -file argument with the fix-profile-diffs command. Use the -group or -device arguments to reconcile profiles for a specific device or group. Use the -file argument to reconcile profiles for a list of robots provided in a file.
  • -base_url  http://<IP address>/mcsws/v<version>
The IP address of the robot running the Web Service (mon_config_service_ws) package. The Web Service package is currently 'v0' (version zero).
  • -device
    CS_ID for a device
(Optional)
Specify the CA UIM computer system ID (CS_ID) of a target device that has the desired profile applied. Computer system IDs are found in the CM_COMPUTER_SYSTEM table.
If you use this argument in the command, do not use the -group argument.
  • -file
    filename
The relative or absolute path to where you want to store the exported profile XML file.
  • -group
    group ID
(Optional)
Specify the group ID of a USM group that has the desired profile applied. Group IDs are found in the SSRV2DeviceGroup table.
If you use this argument in the command, do not use the -device argument.
  • -password
    UIM password
Specify the password that is used to log in the UIM server.
  • -profile
    profile ID
(Optional)
The ID of the MCS profile that you want to export from the database.
  • -username
    UIM username
Specify the username that is used to log in the UIM server.
Examples
The following command exports a CPU Monitor profile (profile 49) that is applied to device 1 and stores the profile on your local drive at d:/profiles/FC/cpu_monitor.xml.
java -jar mcs-cli.jar profile-export -base_url http://10.0.0.0/mcsws/v0 -device 1 -profile 49 -file d:/profiles/FC/cpu_monitor.xml
When the profile is exported, you see the following message:
Exporting profile to file [d:/profiles/FC/cpu_monitor.xml].
Successfully exported profile.
The following is the valid example for group-level profile:
java -jar mcs-cli.jar profile-export -base_url http://10.0.0.0/mcsws/v0 -group 6 -profile 9 -file E:/Test/profile2.xml
Invalid examples are as follows:
java -jar mcs-cli.jar profile-export -base_url http://10.0.0.0/mcsws/v0 -file E:/Test/profile1.xml
java -jar mcs-cli.jar profile-export -base_url http://10.0.0.0/mcsws/v0 -group 6 -file E:/Test/profile3.xml
java -jar mcs-cli.jar profile-export -base_url http://10.0.0.0/mcsws/v0 -profile 11 -file E:/Test/profile3.xml
java -jar mcs-cli.jar profile-export -base_url http://10.0.0.0/mcsws/v0 -device 1 -file E:/Test/profile3.xml
java -jar mcs-cli.jar profile-export -base_url http://10.0.0.0/mcsws/v0 -profile 5
Bulk Profile Export
The bulk-profile-export option helps you export all group profiles from the specified groups. You can use the keyword ALL when specifying groups, which gets all the group profiles for all the groups. One exception is that the Device Type profile is not exported.
You can specify a directory in which you want to create the output files, or leave as the default, which is 'Profiles'. The directory is created if it does not exist. Sub-directories are created with each group's name. In order to support groups with same name, the folder naming convention should be changed to <groupname>_groupId_<groupId>. In these sub-directories, the profile XML files are written for each profile in the group.
An example is as follows:
java -jar mcs-cli.jar bulk-profile-export -base_url http://10.0.0.0/mcsws/v0 -directory E:/Test/ -groups ALL
Import Configuration Profiles
You can import an exported Monitoring Configuration Service configuration profile with the
profile-import
command. Only Nimbus users who have POLICY_MANAGEMENT and PROBE_TEMPLATE_MANAGEMENT permissions can import Monitoring Configuration Service configuration profiles.
The mon_config_service_ws v9.0.0 package is required to use the import template feature.
Import Profile Command Syntax
Enter the profile-import command on a command line to import an MCS configuration profile. The command syntax is:
java -jar mcs-cli.jar profile-import [-base_url http://<IP address>/mcsws/v<version>] [-device
ID
] [-group <id>] -profile
ID
[-file
filename
] [-force]
Use the –device argument, the –group argument, or the -file argument with the fix-profile-diffs command. Use the -group or -device arguments to reconcile profiles for a specific device or group. Use the -file argument to fix profiles for a list of robots that are provided in a file.
  • -base_url  http://<IP address>/mcsws/v<version>
(Required)
The IP address of the robot running the Web Service (mon_config_service_ws) package. The Web Service package is currently 'v0' (version zero).
  • -device
    CS_ID for a device
(Optional)
Specify the CA UIM computer system ID (CS_ID) of a target device has the desired profile applied. Computer system IDs are found in the CM_COMPUTER_SYSTEM table.
If you use this argument in the command, do not use the -group or -file arguments.
  • -file
    filename
(Optional)
The relative or absolute path of the profile XML file that you want to import.
  • -force
(Optional)
Specify this argument if you want the tool to ignore non-fatal errors.
  • -group
    group ID
(Optional)
Specify the group ID of a USM group where the imported profile is applied. Group IDs are found in the SSRV2DeviceGroup table.
If you use this argument in the command, do not use the -device or -file arguments.
  • -password
    UIM password
(Required)
Specify the password that is used to log in the UIM server.
  • -profile
    profile ID
(Optional)
The ID of the MCS profile that you want to import.
  • -username
    UIM username
(Required)
Specify the username that is used to log in the UIM server.
Example
The following command imports the cpu_monitor.xml profile from the location d:/profiles/FC. The imported profile is applied to a device named 'srd84-pri01-w2k8r2x64rob'.
java -jar mcs-cli.jar profile-import -base_url http://10.0.0.0/mcsws/v0 -device srd84-pri01-w2k8r2x64rob -file d:/profiles/FC/cpu_monitor.xml -force
When the profile is imported, you see the following message:
Adding profile from file [d:/profiles/FC/cpu_monitor.xml] to device [srd84-pri01-w2k8r2x64rob] on a server with base IP [http://10.0.0.0/mcsws/v0].
Successfully imported profile
Additional Information
Review the following additional points:
  • The import command supports the import of a device-level profile exported from a device belonging to another domain. However, in case of a group profile, the profile must already exist in the database of the environment if it needs to be imported to the device.
  • If you export a profile from a group:
    • You can import that profile only to a group.
    • You cannot import that profile to a device. If you try to import it to a device, you get the following error if the group is not present:
      2019-03-04 11:53:13 INFO [main] [com.nimsoft.selfservice.cli.handlers.ProfileImport] Failed to import profile. Error: Failed to create profile. Error: Failed to make POST request for URL [http://u1912/mcsws/v0/devices/5/profiles]. Status code was [40
      0]. Output was : [[MCS-000] An unexpected problem occurred. Please review the application logs., An unexpected problem occurred. [MCS-000], MCS-000].
  • Consider a scenario where you export a profile at the device level. Note that, in this case, the profile was specifically applied to that device (ancestorprofile in the SSRV2Profile table for the profile_id is NULL). Now, if you want to import this profile, you can import it to a device or a group.
  • Consider a scenario where you export a profile at the device level. Note that, in this case, the profile was "inherited" by the device, because it was applied at the group level (ancestorprofile is not NULL for the profile_id for the device in the SSRV2Profile table). Now, if you want to import this profile, you can successfully import it at the group level. Additionally, if the ancestorprofile profile_id already exists in the SSRV2Profile table, you can successfully import the profile at the device level. If the ancestorprofie does not exist in the SSRV2Profile table and you still want to import the profile in this XML file, then you must modify the XML file and remove the following line from the file:
    <ancestorprofileId> </ancestorprofileId>
Bulk Profile Import
You want to do an import of one or more profiles from multiple groups to multiple groups.
  • The directory in which the profiles are stored must have a sub-directory with the name of the group. If the groups have the same name, the folder naming convention should be <groupname>_groupId_<groupId>.
  • That directory contains one or more profiles to be imported.
You want to do an import of one or more profiles to several groups.
  • The directory in which the profiles are stored must have a sub-directory for each specified group.
  • Each group directory contains zero or more profiles to be imported.
An example is as follows:
To import all the profiles from Source Groups 1,2,3 to Target Groups 4,5,6:
java -jar mcs-cli.jar bulk-profile-import -base_url http://10.0.0.0/mcsws/v0 -sourcegroups Group1,Group2,Group3 -targetgroups Group4,Group5,Group6 -directory E:/Test/
To import all the profiles from Source Groups 1,2,3 to all groups in target environment:
java -jar mcs-cli.jar bulk-profile-import -base_url http://10.0.0.0/mcsws/v0 -sourcegroups Group1,Group2,Group3 -targetgroups ALL -directory E:/Test/
To import all the profiles from Source Groups 1,2,3 to Target Groups 1,2,3 in target environment:
java -jar mcs-cli.jar bulk-profile-import -base_url http://10.0.0.0/mcsws/v0 -groups Group1,Group2,Group3 -directory E:/Test/
Use the –group argument, -sourcegroups argument or the -targetgroup with the bulk-profile-import command.
  • -groups
To be used only when group names imported from the file are same as the target group names
  • -sourcegroups
Specifies list of groups from profile need to be imported from the file. ALL specifies all profiles from all existing groups in the environment to be imported
  • -targetgroups
Specifies list of groups mapped to the same in groups parameter. ALL specified all the profiles of source groups mentioned using -sourcegroups parameter are to imported to all groups in the target environment.
In UIM 20.3, export and import from one domain to another domain is supported. This functionality is supported with the bulk export and import as well.