Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20616

Re: SWQL query across Cirrus and Orion objects

$
0
0

I have a report that has the SQL that works in it that runs correctly under the reportWriter.

I converted that into SWQL and references the SWIS tables in the query (because I want to use the returned values in a program to monitor interfaces)

 

the two queries I pasted in above were copied from the InformationService logfile, and show what it received, and what it converted it into.

 

it is obvious that SWIS does not not take care of getting the data from the tables and joining them in memory -- that is a hard task and

 

it botched the SWQL to SQL conversion by not fully qualifying the table's names; the following is the correct SWQL->SQL translation

 

SELECT [T1].[IP_Address] AS C1, [T2].[InterfaceIndex] AS C2, [T2].[InterfaceName] AS C3, [T3].[RemoteSystemName] AS C4

FROM [SolarwindsOrion].[dbo].[NodeLldpEntries] AS T3

INNER JOIN [SolarwindsOrion].[dbo].[Nodes] AS T1 ON ([T3].[NodeID] = [T1].[NodeID])

INNER JOIN [SolarwindsOrion].[dbo].[Nodes] AS T6 ON ([T3].[RemoteSystemName] = [T6].[SysName])

INNER JOIN[ConfigMgmt].[dbo].[Nodes] AS T7 ON ([T7].[CoreNodeID] = [T1].[NodeID])

INNER JOIN[ConfigMgmt].[dbo].[Interfaces] AS T8 ON (([T8].[InterfaceIndex] = [T3].[LocalPortNumber]) AND ([T8].[NodeID] = [T7].[NodeID]))

INNER JOIN[ConfigMgmt].[dbo].[Interfaces] AS T2 ON (([T8].[MACAddress] = [T2].[MACAddress]) AND ([T2].[PhysicalInterface] = N'Y'))

LEFT JOIN [SolarwindsOrion].[dbo].[Interfaces] AS T4 ON (([T4].[InterfaceIndex] = [T3].[LocalPortNumber]) AND ([T4].[NodeID] = [T3].[NodeID]))

LEFT JOIN [SolarwindsOrion].[dbo].[Interfaces] AS T5 ON (([T5].[InterfaceIndex] = [T2].[InterfaceIndex]) AND ([T5].[NodeID] = [T3].[NodeID]))

WHERE (((([T4].[InterfaceID] IS NULL) AND ([T5].[InterfaceIndex] IS NULL)) AND ([T1].[Caption] NOT LIKE N'%@%')) AND ([T3].[LocalPortNumber] <> 0))


Viewing all articles
Browse latest Browse all 20616

Trending Articles



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