KBI 310878 Issue Addressed: Node Is Not Deleted From Monitoring Group When Deleted From CMDB-X

Version

Argent Advanced Technology 3.1A-1401-E or below

Date

Monday, 10 Mar 2014

Summary

When a node is deleted from CMDB-X, though it is unlicensed from Argent AT products, it is NOT deleted from Monitoring Groups that use it explicitly

As a result, if a Relator using these Monitoring Groups containing nodes no longer in CMDB-X, it might not be put into production

This issue does not affect the Monitoring Groups using ODBC query

Technical Background

N/A

Resolution

Upgrade to Argent Advanced Technology 3.1A-1401-T3 or later

For customer who cannot upgrade immediately, he can either recreate the Monitoring Groups or take following steps to manually correct the issue:

  1. Start SQL Server Management Studio and connect to database used by Argent AT
  2. Run SQL script to identify the Monitoring Groups which contain nodes that have been deleted from CMDB-X
  3. 
    
    
    CREATE FUNCTION iter_charlist_to_tbl
    
                     (@list      nvarchar(MAX),
    
                      @delimiter nchar(1) = N',')
    
          RETURNS @tbl TABLE (listpos int IDENTITY(1, 1) NOT NULL,
    
                              str     varchar(4000)      NOT NULL,
    
                              nstr    nvarchar(2000)     NOT NULL) AS
    
    
    
    BEGIN
    
       DECLARE @endpos   int,
    
               @startpos int,
    
               @textpos  int,
    
               @chunklen smallint,
    
               @tmpstr   nvarchar(4000),
    
               @leftover nvarchar(4000),
    
               @tmpval   nvarchar(4000)
    
    
    
       SET @textpos = 1
    
       SET @leftover = ''
    
       WHILE @textpos <= datalength(@list) / 2
    
       BEGIN
    
          SET @chunklen = 4000 - datalength(@leftover) / 2
    
          SET @tmpstr = @leftover + substring(@list, @textpos, @chunklen)
    
          SET @textpos = @textpos + @chunklen
    
    
    
          SET @startpos = 0
    
          SET @endpos = charindex(@delimiter COLLATE Slovenian_BIN2, @tmpstr)
    
    
    
          WHILE @endpos > 0
    
          BEGIN
    
             SET @tmpval = ltrim(rtrim(substring(@tmpstr, @startpos + 1,
    
                                                 @endpos - @startpos - 1)))
    
             INSERT @tbl (str, nstr) VALUES(@tmpval, @tmpval)
    
             SET @startpos = @endpos
    
             SET @endpos = charindex(@delimiter COLLATE Slovenian_BIN2,
    
                                     @tmpstr, @startpos + 1)
    
          END
    
    
    
          SET @leftover = right(@tmpstr, datalength(@tmpstr) / 2 - @startpos)
    
       END
    
    
    
       INSERT @tbl(str, nstr)
    
          VALUES (ltrim(rtrim(@leftover)), ltrim(rtrim(@leftover)))
    
       RETURN
    
    END
    
    GO
    
    
    
    DECLARE @Tmp TABLE (NAME VARCHAR(256), DISPLAY_GROUP VARCHAR(256), NODE VARCHAR(256)) 
    
    
    
    INSERT INTO @Tmp 
    
    SELECT m.NAME, m.DISPLAY_GROUP, LTRIM(t.str) AS NODE
    
    FROM   ARGSOFT_AT_SERVER_GROUP m
    
    CROSS  APPLY  iter_charlist_to_tbl(REPLACE(CAST(m.NODES AS NVARCHAR(max)), CHAR(13)+CHAR(10), ','), ',') AS t
    
    where CUSTOM_QUERY is null AND t.str <> ''
    
    ORDER  BY m.NAME, t.str
    
    
    
    SELECT * FROM @Tmp tmp
    
    WHERE not exists (SELECT NAME FROM ARGSOFT_AT_NODE where NAME = tmp.NODE)
    
    ORDER BY NAME, tmp.NODE
    
    GO
    
    
    
    DROP FUNCTION iter_charlist_to_tbl
    
    GO
  4. Open any Argent AT main GUI, select a Monitoring Group found by above SQL script
  5. Type something into description field then delete the changes so that no actual change is made to the definition

    But the ‘Save‘ menu item on right click context menu is now enabled

  6. Click on the ‘Save‘ menu item and save the Monitoring Group
  7. Repeat step 2-4 for each Monitoring Group returned by the SQL script
  8. Re-run the SQL script and verify that no Monitoring Group is returned