batch command

Use the batch command to queue config operations without any knowledge of the scripting capabilities of the operating system on which ToolsCenter Suite CLI is running. When you enter the config commands in a batch file, the ToolsCenter Suite CLI config application individually reads and executes each config command.

batch command syntax

OneCli.exe config batch --file <batchfilename>[--output<folder>][connection option] 
The format in the batch file should be:
 <command1> <command1 options>
<command2> <command2 options>
<command3> <command3 options>
The --output or connection option is not required for the command in the batch file as shown above.
Table 1. batch command parameters
Parameter Required/Optional Notes
--file Required
  • The file name of the batch file, which has the config commands.
  • ToolsCenter Suite CLI individually reads and executes each command.
--output Optional

By default, the log file output is saved to: ../Onecli-%PID%-%date%-%time%/.

connection options Optional
--imm <user:pwd@ip>
Use for OOB.
Use for in-band, if you know the LAN over USB IP of the target IMM.
Use to specify the target IMM.
--node <x>
Use for inband cases on a multinode system.
Where x is a numeric value that indicates the node number. For example, if "--node 2" the target IMM is in the second node of a multinode system.
Note:
  • In batch mode, the show and set commands ignore the suppressed information. You can see the suppressed settings current value using show, and set the suppressed settings without an error.
  • All of the commands in a batch file must target an individual system and not multiple systems. A batch file that contains commands that target multiple systems is not supported.
  • The example batch file shown below, contains the set and show commands. All of the set commands are sent to IMM at same time, and then all of the show commands are sent.
This is an example of batchfile.txt:
set IMM.Community_AccessType.1 Get
set IMM.Duplex1 Auto
set IMM.MTU1 1500
set IMM.SNMPv1Agent Enabled
set IMM.SNMPv3Agent Disabled
show IMM.SNMPv3Agent
set IMM.SNMPv3Agent Enabled
show IMM.SNMPv3Agent

Example of the batch command

OneCli.exe config batch --file batchfile.txt --imm USERID:
PASSW0RD@10.240.252.102
This is the output generated from this example:
Lenovo ToolsCenterSuite CLI tcliXXX-X.X.X
Based on module version X.X.X
Licensed Materials - Property of Lenovo
(C) Copyright Lenovo Corp. 2013-2016 All Rights Reserved
Invoking SHOW command ...
Connected to IMM by IP address 10.240.252.102
Batch mode start.
[set IMM.Community_AccessType.1 Get]
IMM.Community_AccessType.1=Get

[set IMM.Duplex1 Auto]
IMM.Duplex1=Auto

[set IMM.MTU1 1500]
IMM.MTU1=1500

[set IMM.SNMPv1Agent Enabled]
IMM.SNMPv1Agent=Enabled

[set IMM.SNMPv3Agent Disabled]
IMM.SNMPv3Agent=Disabled

Beginning intermediate batch update.
Waiting for command completion status.
Command completed successfully.
Completed intermediate batch update.
[show IMM.SNMPv3Agent]
IMM.SNMPv3Agent=Disabled

[set IMM.SNMPv3Agent Enabled]
IMM.SNMPv3Agent=Enabled

Beginning intermediate batch update.
Waiting for command completion status.
Command completed successfully.
Completed intermediate batch update.
[show IMM.SNMPv3Agent]
IMM.SNMPv3Agent=Enabled

Batch mode completed successfully.