→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎05-08-2017 11:05 AM
‎05-08-2017 03:08 PM
‎05-08-2017 12:26 PM
‎05-08-2017 11:58 AM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
Coalesce(tblNetwork.IPAddress, tblLinuxNetworkDetection.Ipv4,
tblMacNetwork.Ipv4, tblAssets.IPAddress) As [All IPAddress'],
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Left Join tblLinuxNetworkDetection On tblAssets.AssetID =
tblLinuxNetworkDetection.AssetID
Left Join tblMacNetwork On tblAssets.AssetID = tblMacNetwork.AssetID
Where Coalesce(tblNetwork.IPAddress, tblLinuxNetworkDetection.Ipv4) != '' And
Coalesce(tblNetwork.IPAddress, tblLinuxNetworkDetection.Ipv4,
tblMacNetwork.Ipv4, tblAssets.IPAddress) Is Not Null And
tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName
‎04-30-2019 09:49 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblNetwork.IPAddress As ['All IPAddress'],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Where tblNetwork.IPAddress != '' And tblNetwork.IPAddress Is Not Null And
tblAssetCustom.State = 1
Union
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblLinuxNetworkDetection.Ipv4 As ['All IPAddress'],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Left Join tblLinuxNetworkDetection On
tblAssets.AssetID = tblLinuxNetworkDetection.AssetID
Where tblLinuxNetworkDetection.Ipv4 Is Not Null And
tblLinuxNetworkDetection.Ipv4 != '' And
tblLinuxNetworkDetection.Ipv4 != '127.0.0.1' And
tblAssetCustom.State = 1
‎04-30-2019 10:45 PM
RAA wrote:
Is there any other table keeping IP addresses information for my assets other than tblNetwork and tblLinuxNetworkDetection?
I'm running my query using a SQL UNION, which should be good enough to get all IPs but I'm missing some assets IPs (some of them for sure Linux boxes, firewalls and very likely some windows too)
Am I missing anything? this my current query:Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblNetwork.IPAddress As ['All IPAddress'],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Where tblNetwork.IPAddress != '' And tblNetwork.IPAddress Is Not Null And
tblAssetCustom.State = 1
Union
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblLinuxNetworkDetection.Ipv4 As ['All IPAddress'],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Left Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Left Join tblLinuxNetworkDetection On
tblAssets.AssetID = tblLinuxNetworkDetection.AssetID
Where tblLinuxNetworkDetection.Ipv4 Is Not Null And
tblLinuxNetworkDetection.Ipv4 != '' And
tblLinuxNetworkDetection.Ipv4 != '127.0.0.1' And
tblAssetCustom.State = 1
Thanks,
‎05-08-2017 11:44 AM
‎05-08-2017 11:15 AM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblNetwork.IPAddress As [All IPAddress'],
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Where tblNetwork.IPAddress != '' And tblNetwork.IPAddress Is Not Null And
tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now