discovery server issues - data not populating - Invalid object name 'NAS_CS_STATE_MONITOR'.

Document ID : KB000047596
Last Modified Date : 14/02/2018
Show Technical Document Details

Problem: 

After an upgrade of UIM, we noticed several symptoms related to discovery server:

  1. discovery_server queue is empty
  2. (new) devices are not appearing in UMP
  3. (new) devices are not being inserted to the database
  4. see discovery_server complaining about 'NAS_CS_STATE_MONITOR' in the logs:

10 Oct 2016 13:58:46,383 [probeDiscovery-1] ERROR com.nimsoft.discovery.common.util.ExceptionUtil - Error importing device: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar []; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'NAS_CS_STATE_MONITOR'.

 

Environment:  

This issue was found after upgrading from UIM 8.2 --> UIM 8.42.

This information is generally applicable to most versions of UIM.

 

Cause: 

This was found to be related to corrupted data being stored in the NAS tables that causes issue during the upgrade process.

 

Resolution:

This scenario can be corrected by running a simple query on the database to recreate the table and trigger.

 

1. Deactivate the discovery_server probe

2. Execute the following query using MS SQL Management Studio:

CREATE TABLE NAS_CS_STATE_MONITOR ( change_ts datetime ) 
INSERT INTO NAS_CS_STATE_MONITOR VALUES (getdate()) 
GO 
CREATE TRIGGER tr_NAS_CS_STATE_MONITOR 
ON CM_COMPUTER_SYSTEM 
FOR INSERT,UPDATE 
AS 
IF update(state) 
BEGIN 
update NAS_CS_STATE_MONITOR set change_ts=getdate() 
END 
GO 

 

3. Activate the discovery_server probe

You should then begin to see data flowing in the discovery_server queue.
It may take some time for the data to get to the database and then populate UMP.

 

Additional Information:

 

This issue has only been seen in a few environments - it's very rare.

The steps above provide a permanent resolution.