Importing User and Machine Groups into Stratusphere™ Using CSVs
Overview
Stratusphere allows you to import groups from Microsoft Active Directory through the Web UI. It is our experience at Liquidware Labs that in many instances, productions environments with 200+ users may have 1,000 user groups. This inordinately large number of groups defeats the purpose of importing through Active Directory based groups. Thus, Liquidware Labs recommends using a CSV based import of user and machine group membership. The current Web UI supports only user group-based imports and not machine-based imports. Until the UI supports this feature, Liquidware Labs recommends using the approach outlined below to import user and machine-based group information.
Preparation & Prerequisites
- Make sure the users and/or machines are already registered within the Stratusphere Hub UI. To verify, log in to the Administration section of the product and navigate to the Inventory > Users or Inventory > Machines tab.
- After the attached ZIP file is unzipped, do NOT open the CSV or import.pl script files using Windows Notepad or similar applications on Windows machines. The carriage returns for UNIX/Linux get replaced by Windows carriage returns and the script will NOT run on the Stratusphere Hub appliance.
- Download and install the latest version of Notepad++, which will be used to create and save the CSV based import file into a UNIX/Linux format. Do NOT use the standard Windows Notepad for this purpose. It does not work.
- Download and install WinSCP or FileZilla or any similar SCP capable software to transfer the script and CSV file from your desktop to the Stratusphere Hub appliance.
Instructions
- Extract the contents of the attached zip file, which includes the following two files:
- Use import.pl to run the script on any Stratusphere Hub appliance to update group memberships of existing machines and/or users.
- Use test.csv as an example of the file format required for the CSV file.
- Create the group membership data file that contains group membership information. Create separate files for users and separate files for machines. Make sure the username or machine name is the same case as what you see in the UI.
-
Note: This CSV file should be created with the UNIX format (CR/LF). We recommend using Notepad++ wherein you can create the file and use the EDIT > EOL CONVERSION > UNIX menu option to convert to UNIX/Linux format.
- The content should be in the following format for both user- and/or machine-based CSV files:
- <member-name>,<group1-name>;<group2-name>;…<groupN-name>;
- <member-name>,<group1-name>;<group2-name>;…<groupN-name>;
-
Note: Use the comma separator to start for the first group name, but then use semi-colons to separate the group names and to terminate the group names list line as well. The < and > are placeholders and should not be part of the actual data file.
- Use WinSCP or FileZilla or any similar SCP capable client to copy the import.pl script along with your CSV files to the /home/friend folder on the Stratusphere Hub. When prompted use the username friend and the password sspassword to copy these files.
-
Note: The default password for the friend account is sspassword. If you have changed this in your environment, use the new password you created.
- Use an SSH Client like PuTTY to connect to the Stratusphere Hub using the username friend and the password sspassword and su -’/‘sspassword to change to root.
-
Note: The default password for the root account is sspassword. If you have changed this in your environment, use the new password you created.
- Execute the following commands to change folders and permissions on the script:
- cd /home/friend
- chmod 755 import.pl
- If you are importing a User Group membership into a Stratusphere Hub, use the following syntax:
- ./import.pl –u –f <user-group-csv-filename>
-
Note: You can run the script multiple times with no adverse effects.
- If you have NOT created groups within the Web UI, and want the script to create new user groups while importing a User Group membership into a Stratusphere Hub, use the following syntax:
- ./import.pl –u –f <user-group-csv-filename> -c
- If importing Machine Group membership into a Stratusphere Hub use the following syntax:
- ./import.pl –m –f <machine-group-csv-filename>
- If you have NOT created groups within the Web UI, and want the script to create new user groups while importing User Group membership into a Stratusphere Hub use the following syntax:
- ./import.pl –m –f <machine-group-csv-filename> -c
-
Note: You can run the script multiple times if you need to make changes or additions
- Use exit to log out of the root console and another exit to log out of the friend console.
- Log in to the Web UI and navigate to the Inventory > Machines or Inventory > Users tab and click the Groups link to verify the group memberships.
Troubleshooting
Issue #1: No Such File or Directory
When running the script, you get the following error message:
Cause
The carriage returns in the script have been converted into Windows/DOS instead of the UNIX/Linux version.
Solution
Extract the ZIP file contents again and try again.
Issue #2: No Object Found
On running the script, you get the following error message:
Cause
A user or machine of that name was NOT found in the database. This might be caused by typos or by a mismatch between the case of the name you typed versus the case of the name in the database: for example, "smith" versus "Smith".
Solution
Make changes to the CSV file and rerun the script.