I am trying to pull all my interfaces - from specific devices (Fortigate)
but when I start combining table
Node → Interfaces → NodeIPAddresses to get:
VLAN ID
IP
SUBNETMASK
INTERFACE CAPTION
My work in progres query:
SELECT n.NodeID AS ID, n.Caption AS Device_Name, n.IP_Address AS Node_Management_IP, i.Caption AS Interface_Caption, ipa.IPAddress AS Interface_IP, ipa.SubnetMask AS Mask
FROM Orion.NPM.Interfaces i
INNER JOIN Orion.Nodes n ON n.NodeID = i.NodeID
LEFT JOIN Orion.NodeIPAddresses ipa ON ipa.NodeID = n.NodeID AND ipa.InterfaceIndex = i.InterfaceIndex
WHERE i.Caption IN ('VLAN1', 'VLAN2', 'VLAN3') AND i.Description LIKE '%l2vlan%' AND ipa.IPAddress IS NOT NULL AND ipa.IPAddressType = 'IPv4' AND i.Status = '1'ORDER BY n.Caption
For example on 1 node 860 with interface index 20
I get 2 IP's, one from the past and one from today
I cant figure out to only show the current/latest on. There is not date creation, or change field in the table
How do I get only my current IP?
example: