5.20.7 Configuring Multiple Devices

 

To configure multiple devices, either the devices can be associated with the task individually or a device list can be associated with the task.  The best choice is to associate a device list with the task for configuring multiple devices.  The device list consists of a set of devices, grouped based on certain properties.  When you want to execute a task over a set of devices, then those devices can be made as a device list and can be associated with the task, so that the task is executed over all the devices present in the device list.  

 

An example "MultiTaskConfiguration.java" present in <Web NMS Home>/examples/configuration directory helps you to create tasks that configure multiple devices.

 

Note:  While creating the device list, ensure that the devices associated are logically grouped. This helps in reusing the device list with other tasks.

 

To create a device list, the following have to be done:

Device d1 = new Device("device1", "161");

Device d2 = new Device("device2", "161");

......

......

Device d10 = new Device("device10", "161");

String deviceListName = "list1";

String protocol = "snmp";

DeviceList dlist = new DeviceList(deviceListName, protocol);

dlist.setDevices(new Device[] {d1,d2,d10});

String DeviceListXML = dlist.getDeviceList();

configclientapi.saveDeviceList(DeviceListXML);

 

Once the device list gets stored, associate the tasks with this list at the time of its execution by using the method setDeviceList(String[] deviceListName) of TaskGenerator.

 

TaskGenerator tg = new TaskGenerator;

tg.setDeviceList(String[] dlist);

 



Copyright © 2011, ZOHO Corp. All Rights Reserved.