Hello all.
I am trying to create a report that shows me this breakdown:
I have a customer with various sites. At these sites they have equipment that load balances. So the devices at the sites have two or more interfaces for internet connectivity. 1 as primary, 1 as a secondary.
If one interface goes down, it switches to the other, so the 'site' or 'node' does not go down, as it is now running on the secondary interface.
I am trying to create an availability report that shows the following:
For that customer, a breakdown of Each Location, the nodes at that location, the interfaces on those nodes. We have a custom field for Each Location named CustID, the node field is NodeID, and the interfaces are InterfaceID.
The report needs to show a breakdown by month, for the last 12 months, by location, by node (with availability for that month), listing each interface (with availability for that month), including the up/down times showing how long that interface or node was down.
I see we have a report for availability (with interfaces), but that does not run quickly as it includes ALL nodes and I only want it for this one customer, and since it will never finish running because it times out (we have over 57k objects), I can't even see what detail that report provides. The report I download from Thwack and tried was Group+Member+Availability+Report+[Interfaces].xml. IT never finishes running.
If someone already has a report for this, please advise or share
Otherwise, can someone assist with adding the proper tables and detail to my sql query to get this info via SQL? OR help me convert it to SWQL?
Here's my SQL query as it stands now:
WITH NodeAvailability AS (
SELECT
YEAR(ia.Timestamp) AS Year,
MONTH(ia.Timestamp) AS Month,
ncp.Parent_Account_Number,
n.NodeID,
n.Caption AS NodeName,
'Node' AS ObjectType,
AVG(ia.Availability) AS Availability
FROM
Nodes n
INNER JOIN
NodesCustomProperties ncp ON n.NodeID = ncp.NodeID
INNER JOIN
InterfaceAvailability_CS_Detail ia ON n.NodeID = ia.NodeID
WHERE
n.Caption LIKE '%smoothie%'
GROUP BY
YEAR(ia.Timestamp),
MONTH(ia.Timestamp),
ncp.Parent_Account_Number,
n.NodeID,
n.Caption
),
InterfaceAvailability AS (
SELECT
YEAR(ia.Timestamp) AS Year,
MONTH(ia.Timestamp) AS Month,
ncp.Parent_Account_Number,
i.NodeID,
i.InterfaceID,
i.FullName AS InterfaceName,
'Interface' AS ObjectType,
AVG(ia.Availability) AS Availability
FROM
Interfaces i
INNER JOIN
Nodes n ON i.NodeID = n.NodeID
INNER JOIN
NodesCustomProperties ncp ON n.NodeID = ncp.NodeID
INNER JOIN
InterfaceAvailability_CS_Detail ia ON i.InterfaceID = ia.InterfaceID
WHERE
n.Caption LIKE '%smoothie%'
GROUP BY
YEAR(ia.Timestamp),
MONTH(ia.Timestamp),
ncp.Parent_Account_Number,
i.NodeID,
i.InterfaceID,
i.FullName
),
NodeAvailabilityTotal AS (
SELECT
Year,
Month,
Parent_Account_Number,
NodeID,
AVG(Availability) AS NodeAvailability
FROM
NodeAvailability
GROUP BY
Year,
Month,
Parent_Account_Number,
NodeID
)
SELECT
Year,
Month,
Parent_Account_Number,
NodeID,
'Node' AS ObjectType,
NULL AS InterfaceID,
NULL AS InterfaceName,
NodeAvailability AS Availability
FROM
NodeAvailabilityTotal
UNION ALL
SELECT
Year,
Month,
Parent_Account_Number,
NodeID,
'Interface' AS ObjectType,
InterfaceID,
InterfaceName,
Availability
FROM
InterfaceAvailability
ORDER BY
Year,
Month,
Parent_Account_Number,
NodeID,
ObjectType,
InterfaceID;