BAT - niscache cleanup & robot ID reset

Document created by Yu_Ishitani Employee on Feb 24, 2017Last modified by Yu_Ishitani Employee on Mar 1, 2017
Version 5Show Document
  • View in full screen mode

Here is a sample BAT which does the below for all standalone robots in your environment.


- niscache file cleanup

- robot ID reset

- device entry removal from CM_COMPUTER_SYSTEM table


(*) This is Microsoft SQL Server only, but you can tweak / change to adjust for your database.

(*) This requires sqlcmd to be available locally. This is available in SQL Server's Command Line Utilities at Microsoft download site.

(*) HUB robot is excluded. (CM_NIMBUS_ROBOT where is_hub=0)

(*) UIM version minimum requirement is 8.2.



set ROBOT_LIST=robot_list.txt
set ROBOT_CSKEY_LIST=robot_cskey_list.txt
set ROBOT_QUERY="set nocount on; select address from CM_NIMBUS_ROBOT where is_hub = 0"
set ROBOT_CSKEY_QUERY="set nocount on; select cs_key from CM_COMPUTER_SYSTEM where nimbus_type = 1"
set DBUSER=sa
set DBPASS=password
set DBHOST=dbserver
set PU="C:\Program Files (x86)\Nimsoft\bin\pu.exe"
set UIMUSER=administrator
set UIMPASS=password

sqlcmd -S %DBHOST% -U %DBUSER% -P %DBPASS% -d %UIMDB% -h -1 -W -Q %ROBOT_QUERY% -o %ROBOT_LIST%

for /f %%a in (%ROBOT_LIST%) do (
%PU% -u %UIMUSER% -p %UIMPASS% %%a/controller _nis_cache_clean NULL NULL
%PU% -u %UIMUSER% -p %UIMPASS% %%a/controller _reset_device_id_and_restart NULL

for /f %%b in (%ROBOT_CSKEY_LIST%) do (
%PU% -u %UIMUSER% -p %UIMPASS% discovery_server remove_master_devices_by_cskeys %%b

4 people found this helpful