The dmctl command may also be run in batch mode by passing it a filename. The batch file is created by using a text editor and consists of a series of dmctl commands, with one command per line.

The following batch file creates two instances of the Printer class, and sets the value of the SM_SerialNumber attribute for an instance of the Router class:

create SM_Printer::HP_Printer1
create SM_Printer::HP_Printer2
put Router::lab-gw::SM_SerialNumber 123456abc

Before running dmctl in batch mode, change the directory to the location of the batch file. The following example runs dmctl in batch mode:

t# 
		
         BASEDIR
         /smarts/bin/dmctl --server=TEST_SERVER_RM
         
         --broker=localhost:426 --file=test_dmctl_batch.txts

Resulting topology from dmctl batch file “test_dmctl_batch.txt” shows the two new printers and the new value of the Router serial number in topology.

  1. New Instances of SM_Printer Class

    New Value of SM_SerialNumber

Figure 1. Resulting topology from dmctl batch file “test_dmctl_batch.txt”