Description
Registers, updates, deletes, lists, and reports about policies managed by Systemwalker Software Configuration Manager.
Synopsis
[Windows]
swcfmg_report_policy.exe { -add -file "Policy information file path" [-e "Character encoding"] | -update -file "Policy information file path" [-e "Character encoding"] | -delete -id "Policy ID" | -list [ -file "Output file path"] [-e "Character encoding"] | -report [ -file "Output file path"] [-e "Character encoding"] }
[Linux]
swcfmg_report_policy { -add -file "Policy information file path" [-e "Character encoding"] | -update -file "Policy information file path" [-e "Character encoding"] | -delete -id "Policy ID" | -list [ -file "Output file path"] [-e "Character encoding"] | -report [ -file "Output file path"] [-e "Character encoding"] }
Options
Registers a policy using the data entered in the specified policy information file.
The policy information file is in CSV format. For details on the policy information file, refer to "2.2.10 Policy Information File".
Updates a policy using the data entered in the specified policy information file.
The policy information file is in CSV format. For details on the policy information file, refer to "2.2.10 Policy Information File".
Deletes the policy that has the specified policy ID.
Outputs the policy registered using this command in CSV format. For details on the file, refer to "2.2.10 Policy Information File".
If -file "Output file path" is omitted, information will be output to the standard output for the command. If the specified file does not exist, a new file will be created. If the file exists, the existing file will be overwritten. If the file cannot be output because of an error, either a new file will not be created or, if an existing file was to be overwritten, the existing file will be kept as it is, without being overwritten.
Outputs policy compliance status.
If -file "Output file path" is omitted, information will be output to the standard output for the command. If the specified file does not exist, a new file will be created. If the file exists, the existing file will be overwritten. If the file cannot be output because of an error, either a new file will not be created or, if an existing file was to be overwritten, the existing file will be kept as it is, without being overwritten.
For details on output files, refer to "Notes".
Specify the character encoding for the file.
The following character encoding can be specified. Use uppercase letters.
UTF-8
If this option is omitted, the character encoding of the execution environment of this command will be used.
Return codes
Return Code | Meaning |
---|---|
0 | The command has terminated normally. |
10 | A parameter error has occurred. |
20 | The specified I/O path is incorrect. |
30 | The specified character encoding is incorrect. |
70 | The specified policy ID is incorrect. |
100 | Systemwalker Software Configuration Manager is not running. |
101 | A command that cannot be executed at the same time as this command is already running. |
102 | You do not have the privileges required to execute this command. |
110 | A write error has occurred. |
200 | Setup has not been performed. |
255 | A system error has occurred. |
Command location
[Windows]
Systemwalker Software Configuration Manager installation directory\SWCFMGM\bin
[Linux]
/opt/FJSVcfmgm/bin
Privilege required
[Windows]
This command can be executed on the admin server.
[Linux]
This command can be executed on the admin server.
Notes
This command cannot be executed at the same time as other commands. An exclusive control error will occur if a command is executed while another command is still executing.
Execute this command while Systemwalker Software Configuration Manager is running.
Policy information is registered in accordance with the policy information file.
Behavior is not guaranteed if the character encoding specified for this command does not match the character encoding specified for the policy information file.
When modifying registered policy information, it is recommended that you edit the listed file and use the edited file as the input data for update.
Use this command to delete policy information that is no longer required for Systemwalker Software Configuration Manager.
In each line of a CSV file, the compliance status for one registered policy is output. The status is output in the following format:
Item No. | Item Name | Remarks |
---|---|---|
1 | Policy ID | Outputs the policy ID. |
2 | Policy name | Outputs the policy name. |
3 | Status | Outputs the status.
|
4 | Number | Outputs the number of CIs in violation of the policy. |
5 | View ID | The view ID. |
6 | View name | The view name. |
If no policy information is registered, only header information is output.
#policy-id,policy-name,status,violation-count,view-id,view-name
If there are errors in the policy information file, the registration or update of the policy information will be canceled. An error message similar to the following will be output to the trace log:
The file description is incorrect. [Line number:n](Cause:Cause)
One of the following messages will be output in Cause:
Message | Meaning |
---|---|
Number of elements. | Review the number of elements in the line indicated. |
The specified elements are invalid. () | The values of elements within "()" in the given line are invalid. Enter the correct values. For acceptable values, refer to "2.2.10 Policy Information File". When "threshold-value" is displayed in "()" and a regular expression is specified as the comparison method, review the regular expression pattern. |
Mandatory elements are not specified. | Enter the mandatory elements in the given line. |
The same policy is specified in another line. | The same policy information is already defined in one of the preceding lines. |
The specified view does not exist. | There is no view corresponding to "view-id" in the given line. |
The specified policy does not exist. | There is no policy corresponding to "policy-id" in the given line. |
The policy has already been registered. | The policy information in the given line is already registered. |
Examples
Registration
[Windows]
swcfmg_report_policy.exe -add -file C:\work\policyinfo.csv
[Linux]
swcfmg_report_policy -add -file /tmp/policyinfo.csv
Update
[Windows]
swcfmg_report_policy.exe -update -file C:\work\policyinfo.csv
[Linux]
swcfmg_report_policy -update -file /tmp/policyinfo.csv
Deletion
[Windows]
swcfmg_report_policy.exe -delete -id Policy1
[Linux]
swcfmg_report_policy -delete -id Policy1
List
[Windows]
swcfmg_report_policy.exe -list -file C:\work\policyinfo.csv
[Linux]
swcfmg_report_policy.exe -list -file /tmp/policyinfo.csv
Reporting
[Windows]
swcfmg_report_policy.exe -report -file C:\work\policystatus.csv
[Linux]
swcfmg_report_policy.exe -report -file /tmp/policystatus.csv