DX Unified Infrastructure Management

 View Only

MSI Robot Installation

By Anon Anon posted Aug 29, 2012 12:12 PM

  

Version 5.60 of the Nimsoft NMS server introduced RMP and MSI packages for mass deployment of robots. The MSI version is a little different to many MSI in the fact it requires an answer file located in the install directory. The answer file is a basic robot configuration file called nms-robot-vars.cfg and follows the below format.

 

DOMAIN=companyZdom
HUBIP=145.23.31.5
HUB=companyZhub
HUBROBOTNAME=hubsysA
ROBOTNAME=NotNecessarilyHostnameButSomethingElseIChoose
ROBOTIP=198.201.4.7
HUBPORT=48002
FIRST_PROBE_PORT=48000
SECONDARY_DOMAIN=
SECONDARY_HUB=
SECONDARY_HUBROBOTNAME=
SECONDARY_HUBIP=
SECONDARY_HUBPORT=
SECONDARY_HUB_DNS_NAME=

 

This file should be place in the same location the MSI is copied to. At the bottom of the page is a windows batch file created to make the install process of the MSI robot much more automated. The script completes the following:

 

1 - Creates a temp mapped drive
2 - Copies the MSI to the local server
3 - Creates the nms-robot-vars.cfg
4 - Set the ROBOTNAME to the hostname of the device
5 - Sets the robot IP to that of the first interface in ipconfig (if someone whiches to improve on this please leave a comment below! :smileyhappy:
6 - Starts the MSI installation using the nms-robot-vars.cfg to build the robot configuration
7 - Deletes the robot MSI from the local machine
8 - Un-mapps the network drive

Lets investigate this step by step to understand what the script is doing and how to modify it. As always if anyone has suggestions or tips to improve the script we would love to hear from you either via email or the comments section below.

 

Map the nework drive

 

:: Edit the following line to map a temp drive to a share with the MSI file hosted there
net use r: \\<ip or UNC>\<file_share>

Create a file share that the remote servers can connect to and transfer the MSI file from. Copy the MSI file to this network share. Find the above lines in the script and change to reflect the share location.

 

Set the install path

 

::smileyfrustrated:et the drive letter and install path then create it
set install_path=progra~1\nimsoft\

set drive_letter=c:\

Change the install path by chaging the variables in the script.

 

Set up the nms-robot-vars.cfg - Domain and Hub

 

:: These variables should stay static so no need to dynamicly update, just change to suit your environment
echo DOMAIN=nevil >> %drive_letter%%install_path%nms-robot-vars.cfg

 

The lines in the script such as the above will build the nms-robot-vars.cfg you should change the variables to suit your environment, domain, hub name/ip etc. These should stay fairly contstant an hence do not need to be changed dynamically or updated very often.

 

 Set up the nms-robot-vars.cfg - IP and Robot name

 

::Robotname is currently set using the hostname as %host% variable or change to manually overide
echo ROBOTNAME=%HOST% >> %drive_letter%%install_path%nms-robot-vars.cfg
::IP address of the first adaptor it finds.
echo ROBOTIP=%IP% >> %drive_letter%%install_path%nms-robot-vars.cfg

 

The IP variable will take the first IP address it finds from ipconfig, this might not be suitable for all environments

The above two lines set the robot IP and robot name, the IP is gained from a cat of ipconfig.exe and looking for the "IPv4 Address" this means it will take the first configured IP address it finds and this may pose a limitation in some environments. The code below is what parses the IP from ipconfig:

 

::Gets the IP address of the first adaptor it finds
for /f "usebackq tokens=2 delims=:" %%f in (`ipconfig ^| findstr /c:"IPv4 Address"`) do
(        set IP=%%f)

 

Last but not least the script sets the robot name to the hostname of the device. All these settings can be changed later when the robot is in the NMS system via Infrastructure Manager but these setting will get the robot up and running with a unique identifier. Below is the code from the script to find the hostname and set it as a variable:

 

::Allows %HOST% to be used as a variable for the robotname
for /f "tokens=* delims= " %%a in ('hostname') do (set HOST=%%a)

 

The nms-robot-vars.cfg is now built and ready to use my the MSI as an answer file.

 

Start the MSI Installation and clean up



The script will now copy the MSI file locally to the server and start the install. For a full list of switches and their meaning execute MSIEXEC from the command line. Once the file has been copied and executed by MSIEXEC the MSI itself is deleted and the network drive unmapped.

 

::smileyfrustrated:tart the MSI install from mapped drive R: uncomment relivent architecture
cp R:/nimsoft-robot-x64.msi %drive_letter%%install_path%
msiexec /i %drive_letter%%install_path%nimsoft-robot-x64.msi /qn INSTALLDIR="%drive_letter%%install_path%"
sleep 60

del
%drive_letter%%install_path%nimsoft-robot-x64.msi

net use r: /delete:finish

 

 

Distributing the batch file to remote servers

 

The last part of this guide discusses pushing the script we have been working on to the remote servers for this we reccomend PSEXEC.

PSEXECis a free microsoft tool and can be downloaded here:  http://download.sysinternals.com/Files/PsTools.zip

 

PSEXEC Usage

Open a dos window and launch the PSEXEC Tool:

 

Install on all computers currently logged in your domain

psexec \\* -s \\Server\NetLogon\robot_install.bat

 

Install on a single computer

psexec \\COMPUTER_NAME -s \\Server\NetLogon\robot_install.bat

 

Install on all computers using the domain administrator credentials

psexec \\* -s -u Domain\Administrator -p Password \\Server\NetLogon\robot_install.bat

 

Install on specific computers (ALL.TXT is a text file that lists target computer names, one per line), using domain administrator credentials

psexec @ALL.TXT -s -u Domain\Administrator -p Password \\Server\NetLogon\robot_install.bat

 

Note: when doing mass deployment on multiple computers, you should monitor the response file to get a list of computers that were not deployed (were not connected when the PSEXEC ran), and run the PSEXEC mutliple times throughout the business hours to make sure all your computers are getting installed.

1 comment
4 views