‎07-30-2020 01:46 PM
Select Top 1000000 SwitchInformation.AssetID,
SwitchInformation.icon,
SwitchInformation.AssetName,
SwitchInformation.Name As Port,
tsysIPLocations.IPLocation As VLAN,
SwitchInformation.Vlan As VlanName,
Coalesce(tsysOS.Image, tsysAssetTypes1.AssetTypeIcon10) As icon2,
SwitchInformation.DeviceAssetID,
tblAssets.AssetName As ConnectedDevice,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.Firstseen
From (Select Top 1000000 tblAssets1.AssetID,
tsysAssetTypes.AssetTypeIcon16 As icon,
tblAssets1.AssetName,
tblSNMPInfo.IfIndex As [If],
tblSNMPInfo.ifName As Name,
tblSNMPInfo.Vlan,
tblAssetMacAddress.AssetID As DeviceAssetID
From tblSNMPInfo
Inner Join tblAssets As tblAssets1 On tblSNMPInfo.AssetID =
tblAssets1.AssetID
Inner Join tsysAssetTypes On tblAssets1.Assettype =
tsysAssetTypes.AssetType
Left Outer Join tblSNMPIfTypes On tblSNMPInfo.IfType =
tblSNMPIfTypes.IfType
Left Outer Join (tblAssetMacAddress
Right Outer Join tblSNMPAssetMac On tblAssetMacAddress.Mac =
tblSNMPAssetMac.AssetMacAddress) On tblSNMPInfo.IfIndex =
tblSNMPAssetMac.IfIndex And tblSNMPInfo.AssetID =
tblSNMPAssetMac.AssetID
Where tblAssets1.AssetID Is Not Null And tsysAssetTypes.AssetTypename =
'Switch'
Order By tblAssets1.AssetName,
[If]) As SwitchInformation
Left Outer Join tblAssets On SwitchInformation.DeviceAssetID =
tblAssets.AssetID
Inner Join tsysAssetTypes As tsysAssetTypes1 On tblAssets.Assettype =
tsysAssetTypes1.AssetType
Inner Join tblAssetCustom On tblAssetCustom.AssetID = tblAssets.AssetID
Inner Join tsysIPLocations On
tblAssets.LocationID = tsysIPLocations.LocationID
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblAssets.AssetName Not Like 'Uplink' And tblAssets.Lastseen < GetDate() -
90
Order By SwitchInformation.AssetName,
ConnectedDevice
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now