I'm working with the SWQL variables in the email Alert Message to try to do this. Here's the original code:
The Loopback IP is: ${N=SwisEntity;M=Node.IP_Address} Interface is: ${N=SwisEntity;M=InterfaceName} - ${N=SwisEntity;M=Alias} And is located at: ${N=SwisEntity;M=Node.Location} This is an: ${N=SwisEntity;M=Node.MachineType} IOS Version is: ${N=SwisEntity;M=Node.IOSVersion} The iOS Image is: ${N=SwisEntity;M=Node.IOSImage} Device last boot was: ${N=SwisEntity;M=Node.LastBoot;F=DateTime} |
What I need to do is add a fourth line that basically says this:
The Interface {i.caption} at IP Address {nip.ipadress} on Node {nd.caption} is no longer in an 'UP' state. |
There is not a variable that I can find for the Interface IP Address. I can find the Node's IP and the MAC address
I do have this SQL code that will find it
SELECT i.nodeid AS "NodeID", i.interfacename AS "Int Name", i.caption, i.interfacealias AS Description, i.ifname, i.status, nip.ipaddress AS "IP Address", nd.caption AS "Node Name" FROM [interfaces] AS i, [nodeipaddresses] AS nip, [nodesdata] AS nd WHERE i.nodeid = nip.nodeid AND nip.nodeid = nd.nodeid AND i.interfaceindex = nip.interfaceindex ORDER BY i.nodeid |
The code is sound and will work in Database Manager. It does pull the Interface IP Address
But how do I include that SQL Query in the Alert and then extract the information I need to place into the statement? Or is there a simpler way and I'm over thinking it?