Description
This command imports user account information of servers to CMDB. The input file format is CSV format.
Used in combination with swrba_uaexport (user information export command), user account information that has already been registered can be extracted from CMDB, edited, and re-imported, and the user account information can then be updated/added.
Synopsis
swrba_uaimport -f input file name [-e input file character code] |
Options
Specifies the input file (CSV format) in which user account information of the registration target server has been defined.
Input file examples are shown below.
"192.168.0.1","OS","user001","xe3539caeb","true","false",,"Comment A" "192.168.0.1","OS","user002","ex3535akft","false","true",,"Comment B" "192.168.0.2","OS","user001","xe359jsg35","true","false",,"Comment C" "192.168.0.2","OS","user002","djh847wag4","false","true",,"Comment D" |
The CSV format spec is shown below.
Columns are separated using commas (,).
If the data contains commas (,) and double-quotes (), then all the data that is specified in the column is enclosed in double-quotes (). Additionally, if the data contains double-quotes (), then the double-quotes () are described twice in succession. By describing a double-quote () twice in succession, it will be represented as one double-quote ().
Example 1: When a comma (,) is specified (In this example, a comma (,) is contained in last column as Comment,D.)
"192.168.0.2","OS","user002","djh847wag4","false","true",," Comment,D" |
Example 2: When a double-quote () is specified (In this example, a double-quote () is contained in the last column as CommentD.)
"192.168.0.2","OS","user002","djh847wag4"," false","true",,"CommentD """ |
To describe a default value, specify an empty character string using one of the formats shown below.
Example 1: Nothing is described between the separator character commas (,). (In this example, the default value is specified in the last two columns)
"192.168.0.2","OS","user002","djh847wag4","false","true",, |
Example 2: Nothing is described between the enclosed character double-quotes (). ((In this example, the default value is specified in the last two columns)
"192.168.0.2","OS","user002","djh847wag4","false","true","","" |
Line feed characters cannot be entered in the column data.
The CSV format column positions are shown below.
Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 | Column 7 | Column 8 | |
---|---|---|---|---|---|---|---|---|
Item | Server IP address | Authentication destination type | User | Password | Administrator user | Server connection user | Connection destination information | Comment |
Example | 192.168.0.1 | OS | user001 | xe3539caeb | true | False | Comment A |
The definition rules for each column are shown below.
Column | Item | Can omit or not | Default Value | Input Content | Content that is Checked | Conditions |
---|---|---|---|---|---|---|
1 | IP address | Not possible | - | Specify the server IP address. | Number of characters that can be entered | Between 1 and 255 characters |
Character set | Letters of the alphabet (case-sensitivity is used), numbers, symbols | |||||
Content | If the specified IP address LogicalServer-CI has not been registered in CMDB, an error will occur | |||||
2 | Authentication destination type | Not possible | - | Specify the authentication destination type. OS must be specified. Nothing else can be specified except OS. | Number of characters that can be entered | Between 1 and 255 characters |
Character set | Letters of the alphabet (case-sensitivity is used), numbers | |||||
3 | User | Not possible | - | Specify the user account for the authentication destination. | Number of characters that can be entered | Between 1 and 255 characters |
Character set | - Letters of the alphabet - Blank spaces cannot be specified | |||||
Uniqueness | The same user cannot be registered more than once in the corresponding server | |||||
4 | Password | Possible | - | Specify the password character string for the user. If the password character string is omitted, the behavior will be as shown below.
| Number of characters that can be entered | Between 1 and 255 characters |
5 | Administrator user | Not possible | - | Administrator user: true All other cases: false | Uniqueness | Multiple users cannot be registered as the administrator user in the corresponding server |
Character set | Letters of the alphabet (case-sensitivity is not used) | |||||
Content | Any character string except true/false will result in an error | |||||
6 | Server connection user | Not possible | - | User that connects to the server: true All other cases: false | Uniqueness | Multiple users cannot be registered as the server connection user in the corresponding server |
Character set | Letters of the alphabet (case-sensitivity is not used) | |||||
Content | Any character string except true/false will result in an error | |||||
7 | Connection destination information | Possible | Empty | Only default values can be specified Any value except a default value that is specified will result in an error. | Number of characters that can be entered | See Input content. |
Character set | See Input content. | |||||
8 | Comment | Possible | Empty | None | Number of characters that can be entered | Between 0 and 255 characters |
Character set | The content is not checked |
Point
If the user account information entered in the input file contains an error, the user account information with the error fails to be imported. All other user account information is imported.
When the configuration information is automatically collected, the IP address of the LogicalServer-CI of the IPv6 environment is stored in the RFC 5952 format. In this case, the IP address specified in the input file should also be written in the RFC 5952 format. For all other cases, use the same format as registered in the CMDB.
Refer to "Settings for Automatically Collecting Configuration Information" in the Systemwalker Runbook Automation Installation Guide for details.
Specifies the input file character code. The following character codes can be specified:
UTF-8
SJIS
EUC
If this option is omitted, the character code of the input file will be as follows:
[Windows]
SJIS
[Linux]
The character code specified in the LANG environment variable
If the LANG environment variable has not been set, or LANG variable has been set other than ja_JP.euc or ja_JP.UTF-8 or ja_JP.SJIS or ja_JP.WINDOWS-31J, then UTF-8 will be used.
Return Values
Normal termination
Termination following a warning
There is user account information for which the import failed
Parameter error
An error other than the above 1 or 2
Error Content Notification
If the imported information contains an error, the error content is notified in standard error output.
Refer to the error information that was output in standard error output to correct the input data for the user account information for which the import failed, and then re-execute the command to import the user account information.
Example: If the error occurs on multiple lines, then these multiple lines will be notified.
> swrba_uaimport -f importcsv.txt |
Command Location
[Windows]
<Systemwalker Runbook Automation installation directory>\bin |
[Linux]
/opt/FJSVswrbam/bin |
Privilege Required/Execution Environment
[Windows]
This command requires administrator privileges. When using Windows Server 2008 or later operating system, run as an administrator.
This command can be executed on a Management Server.
[Linux]
This can only be executed by a system administrator (superuser).
This command can be executed on a Management Server.
Note
The user account information of the imported input file will always be valid.
If the user account information to import has already been registered in CMDB, this command will replace the user account information registered in CMDB with the user account information described in the input file.
This command sequentially processes user account information specified for the input file.
Therefore, when same two or more user account information as one input file exists, user account information described in the end becomes effective. Moreover, when two or more manager users have been described to the same server in the input file, the user described in the end becomes a manager user. Information is not updated to the server that has not been described to the input file.
The user account information for the server connection user and administrator user can be registered for only one user in one server. Accordingly, when the user account information for the second user is imported for the server connection user or administrator user, processing will be as follows:
The user account for the second user is registered as the true attribute.
The user account attributes that have already been registered change to false.
swrba_uaexport and swrba_uaimport cannot run at the same time. For this reason, an error will occur if one command is executed while the other command is already under execution.
Execute this command when Systemwalker Runbook Automation is running.
If this command is used before Systemwalker Runbook Automation has started up, it will fail because of the following error:
Error: Failed to register the user. Detail=com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers |
If the character code that was specified in this command and the character code that was specified in the input file are different, then the behavior cannot be guaranteed. Enter the character code so that it matches.