Quantcast
Channel: THWACK: All Content - Network Performance Monitor
Viewing all articles
Browse latest Browse all 21870

Report for Duplicate Names - Case Dependent?!

$
0
0

We recently built a custom SQL report and displayed the results using the web-based reporter in Orion 2014.2 (NPM 11.0.1).  The report was intended to find possible duplicate nodes by isolating the node name where the nodes could be just the node name or FQDN.  We started off with this SQL logic.

 

ANd

 

SELECTSUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END)ASNodeName,

       SUBSTRING(caption,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)+1 ELSECHARINDEX('.',caption)+1 END, 1000)ASDomainName,

          Caption,

          IP_Address,

          OwnerGroup,

          Comments

FROMNodesWITH (NOLOCK)

WHERESUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END)IN(

       SELECTSUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END)

       FROMNodesWITH (NOLOCK)GROUPBYSUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END)

       HAVINGCOUNT(*)> 1)

ANDSUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END)NOTBETWEEN'1'AND'255'

ORDERBYCaption


And we configured the table to Group results by NodeName from the query above.  The resulting data looked like the following (minus the redacted part) -- notice that the nodes are not distinctly grouped.


2015-06-19 12_46_16-Web-based Reporting - Case Matters - Message (HTML)v2.png


Puzzled, I decided to force the capitalization on the NodeName to allow lowercase.  SQL isn't case dependent but maybe the grouping on the web-based reports was!


SELECTLOWER(SUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END))ASNodeName,

       SUBSTRING(caption,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)+1 ELSECHARINDEX('.',caption)+1 END, 1000)ASDomainName,

          Caption,

          IP_Address,

          OwnerGroup,

          Comments

FROMNodesWITH (NOLOCK)

WHERELOWER(SUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END))IN(

       SELECTLOWER(SUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END))

       FROMNodesWITH (NOLOCK)GROUPBYLOWER(SUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END))

       HAVINGCOUNT(*)> 1)

ANDLOWER(SUBSTRING(caption, 1,CASECHARINDEX('.',caption)WHEN 0 THENLEN(caption)ELSECHARINDEX('.',caption)-1 END))NOTBETWEEN'1'AND'255'

ORDERBYCaption


2015-06-19 12_47_19-Lost Sheep - Nodes - Possible Duplicatesv2.png

Notice that the nodes are now grouped together by the common NodeName.  The change was the LOWER() function in the query.


Has anyone else run into this before?  Does the newer version of Orion and/or NPM resolve this issue?


Viewing all articles
Browse latest Browse all 21870

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>