search cancel

how can I quickly and easily spin up a large number of robots for testing purposes?

book

Article ID: 221034

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

In my lab/test environment, I want to set up a large number of robots (hundreds) in my UIM environment so I can test at scale.  How can I easily accomplish this?

Environment

UIM - any version - Linux robot required

Resolution

Attached to this article is a script (rename it to nimdup.sh) which can be used to make numerous copies of an existing robot that can run on a single host.  These will be real robots that can accept probe deployments, generate alarms and QoS, etc.

You will need one robot on Linux OS which will be used as the base robot image.  You will need to place the nimdup.sh file on the robot somewhere and the robot should be installed to the default /opt/nimsoft location.

 

You will need to edit the nimdup.sh file as follows:

Line 34:  Replace "MyDomain" with your UIM Domain.

Line 35 (optional): change "testrobot" to some other name.  Robots will be named e.g. testrobot-1, testrobot-2, testrobot-3, etc. if you do not change this.

Line 36: change 99.99.99.99 to the actual IP address of the machine hosting the robot (where you are running nimdup.sh)

Line 48: change "MYHUB" to the name of the hub which the robots will connect to

Line 49: change "MYHUBROBOTNAME" to the robotname of the hub from line 48

Line 50: change "1.2.3.4" to the IP address of the hub from line 48

 

Once you have made the appropriate changes, run the command as follows - the first parameter/digit is the "start number" and the second parameter digit is the "finish number", e.g. if you specify "1" and "20" you will get 20 robots named testrobot-1 through testrobot-20.

./nimdup.sh 1 20

to generate 200 robots:

./nimdup.sh 1 200

If you want 100 more after that, numbered testrobot-201 through testrobot-300:

./nimdup.sh 201 300

Robots are relatively low impact; on a system with 4gb RAM I was able to run 200 robots with plenty of resources left over.  The main danger is running out of ports and disk space, but you should be able to do 500 robots on a system with enough resources.

Additional Information

Attached to this KB you will also find a bulk_robot_utils.zip which contains some useful scripts for administering the environment:

  • one to start all robots that are stopped
  • one to stop all robots that are running
  • one to restart all robots (starts all stopped robots and restarts all running robots)
  • one to clear the niscache and robot_device_id on all the robots (with optional restart)
  • one to delete all the cloned robots (use with caution!)

Attachments

1652372707668__bulk_robot_utils.zip get_app
1652302381860___nimdup.sh get_app