How to automatically fix missing USM robots due to cloning

Document ID : KB000056948
Last Modified Date : 17/10/2018
Show Technical Document Details
Introduction:
As cloning VMs becomes an increasingly common practice, we are also seeing issues where robot device IDs are also duplicated, thereby preventing robots from showing up in USM.
At the appropriate logging levels, one can see evidence of discovery_server keeping a particular robot and ignoring others.

The goal of this article is to use that logging to generate alarms that will be parsed by an auto operator to automatically reset the robot's device ID.
*** It is important to note that implementing the nas Auto-Operator portion of this procedure will cause the robot to be rebooted as the duplicate robot IDs are detected.
If you need to control this process, do not implement the nas Auto-Operator portion so you can act on the alarms manually.
Instructions:
Discovery Server setup

RDP or SSH into the primary hub and access the discovery_server probe folder.
Windows:
default location is C:\Program Files (x86)\Nimsoft\probes\service\discovery_server
Linux:
default location is /opt/nimsoft/probes/service/discovery_server

Open log4j.xml in a text editor
 
Locate the "MaxFileSize" directive and increase the value to  "15242880".
This will give logmon time more time to capture the entries in discovery_server.log before it rolls over. You can reduce the MaxBackupIndex to store fewer rolled log files if disk space is a concern.
Save the file

Open Infrastructure Manager and open the discovery_server configuration in raw configure.

Change the loglevel to 5 and click OK
 


Logmon setup

From Infrastructure Manager, access your archive and download logmon if it is not already.

Deploy logmon to your primary hub

Open the configuration UI

Right Click in the left pane and click New

Give the profile a name like "RobotWIthDuplicateDeviceId"

Click the check box next to the profile name to activate it.

On the general tab, browse to the location of your discovery_server.log.
In Windows the default location is C:\Program Files (x86)\Nimsoft\probes\service\discovery_server
In Linux the default location is /opt/nimsoft/probes/service/discovery_server
Uncheck Generate Quality of Service
robot with duplicate device id

Click the Watcher Rules tab
Right-click in the left pane of this tab and choose New
Give the watcher a name of "Keeping"
Click the checkbox next to the watcher name to activate it.
On the Standard tab,
Match Expression: *WARN ?com.nimsoft.discovery.server.nimbus.scan.RobotWithDuplicateDeviceIdPruner - Keeping robot*
Message to Send on Match: Keeping duplicate robot ${robot}
watcher rule

On the Variables tab
Right-click in the list section and choose New
Name: robot
Source FROM Position
Select Column and enter 11 for the value
Source TO Position
Select To Column and enter 11 for the value
Click OK
variable settings logmon

On the Alarm tab
Suppression Key: ${robot}
suppression key robot

Now we need to create a second Watcher
Right-click in the left pane of the Watcher Rules tab again and choose New
Give the watcher a name of "Ignoring"
Click the checkbox next to the watcher name to activate it.
On the Standard tab,
Match Expression: *WARN ?com.nimsoft.discovery.server.nimbus.scan.RobotWithDuplicateDeviceIdPruner - Ignoring robot*
Message to Send on Match: Ignoring duplicate robot ${robot}
match expression logmon

On the Variables tab
Right-click in the list section and choose New
Name: robot
Source FROM Position
Select Column and enter 11 for the value
Source TO Position
Select To Column and enter 11 for the value
Click OK
variable settings logmon 2

On the Alarm tab
Suppression Key: ${robot}
User-added image

Click OK on the probe GUI to save and activate the new profile.

At this point, logmon will generate Informational alarms related to duplicate robot IDs.
For some customers, this may be sufficient to simply alert on which robots need further action.
To automatically generate a new robot device ID and close the alarms, continue with the following instructions. Remember, this portion will cause the robots to reboot automatically in order to generate new robot IDs.

Setting up NAS
Download the LUA script attached to this article.
Save it to your primary UIM server and place it in your nas\scripts directory.
In Windows the default location is C:\Program Files (x86)\Nimsoft\probes\service\nas\scripts
In Linux the default location is /opt/nimsoft/probes/service/nas/scripts
From Infrastructure Manager, open your nas configuration.
Click the Auto-Operator tab
Click the Profiles tab
Right-click in the Auto-Operator list and choose New
Action type: script
Script: ResetRobotDeviceId (please see attached zip file for the script)
Action mode: On message arrival
Severity Level: Informational
Message string: /*Keeping duplicate robot*/
Click OK
Enter new profile name: KeepingDuplicateRobot
Click OK
reset device id robot script profile

Right-click in the Auto-Operator list and choose New
Action type: script
Script: ResetRobotDeviceId
Action mode: On message arrival
Severity Level: Informational
Message string: /*Ignoring duplicate robot*/
Click OK
Enter new profile name: IgnoringDuplicateRobot
Click OK
reset device id robot script profile
Click OK to save the nas configuration and restart.

Please find the attached zip file.
File Attachments:
TEC000005296.zip