Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVI showing None for InAveragebps #52

Open
ajwillo opened this issue Jul 1, 2020 · 5 comments
Open

SVI showing None for InAveragebps #52

ajwillo opened this issue Jul 1, 2020 · 5 comments

Comments

@ajwillo
Copy link

ajwillo commented Jul 1, 2020

Weve recently noticed that under an SVI interface, "Vlan10" for example is showing None for InAveragebps, this happens for all our SVIs, OutAveragebps does not have any issues, but all InAveragebps do

Thanks

Sample showing None under SVI

>>> print(query)

SELECT
n.NodeID,
n.NodeName,
n.Interfaces.Name,
n.Interfaces.InterfaceID,
n.Interfaces.Caption AS InterfaceName,
n.Interfaces.Traffic.InAveragebps,
n.Interfaces.Traffic.OutAveragebps,
TOLOCAL(n.Interfaces.Traffic.DateTime) as DateTime
FROM
Orion.Nodes n
INNER JOIN (SELECT
nn.NodeID,
nn.Interfaces.Name,
max(nn.Interfaces.Traffic.DateTime) as most_recent
FROM
Orion.Nodes nn
WHERE
(nn.NodeID = '1895' AND nn.Interfaces.Name = 'Vlan10')
GROUP BY
nn.NodeID,
nn.Interfaces.Name
) most_recents
ON n.NodeID = most_recents.NodeID
AND n.Interfaces.Traffic.DateTime = most_recents.most_recent

>>> results = swis.query(query)
>>> results = results["results"]
>>> results
[{'NodeID': 1895, 'NodeName': 'Edge-01', 'Name': 'Vlan10', 'InterfaceID': 5504, 'InterfaceName': 'Vlan10 · *** VLAN10 ***', 'InAveragebps': None, 'OutAveragebps': 29591578.0, 'DateTime': '2020-06-29T11:33:14.6630000'}]

Sample showing correct values under a regular portI

>>> query="""
... SELECT
... n.NodeID,
... n.NodeName,
... n.Interfaces.Name,
... n.Interfaces.InterfaceID,
... n.Interfaces.Caption AS InterfaceName,
... n.Interfaces.Traffic.InAveragebps,
... n.Interfaces.Traffic.OutAveragebps,
... TOLOCAL(n.Interfaces.Traffic.DateTime) as DateTime
cents
ON n.NodeID = most_recents.NodeID
AND n.Interfaces.Traffic.DateTime = most_recents.most_recent
"""

results = swis.query(query)
results = results["results"]... FROM
... Orion.Nodes n
... INNER JOIN (SELECT
... nn.NodeID,
... nn.Interfaces.Name,
... max(nn.Interfaces.Traffic.DateTime) as most_recent
... FROM
... Orion.Nodes nn
... WHERE
... (nn.NodeID = '1895' AND nn.Interfaces.Name = 'TenGigabitEthernet1/0/2 ')
... GROUP BY
... nn.NodeID,
... nn.Interfaces.Name
... ) most_recents
... ON n.NodeID = most_recents.NodeID
... AND n.Interfaces.Traffic.DateTime = most_recents.most_recent
... """
>>>
>>> results = swis.query(query)

>>> results = results["results"]
>>>
>>> results
[{'NodeID': 1895, 'NodeName': 'Edge-01', 'Name': 'TenGigabitEthernet1/0/2', 'InterfaceID': 6369, 'InterfaceName': 'TenGigabitEthernet1/0/2 · *** L3 - Uplink ***', 'InAveragebps': 28587964.0, 'OutAveragebps': 213409248.0, 'DateTime': '2020-06-29T13:04:34.8300000'}]
@mrxinu
Copy link
Contributor

mrxinu commented Dec 29, 2020

This one is pretty stale - are you still having the problem or did you work it out?

@ajwillo
Copy link
Author

ajwillo commented Jan 1, 2021

Hi, haven't been able to work it out, bug seems to still be there

@mrxinu
Copy link
Contributor

mrxinu commented Jan 7, 2021

@ajwillo Do you have any working code showing the good result and the bad result that you can share? It looks like some of the code above was pasted oddly.

results = swis.query(query)
results = results["results"]... FROM

@ajwillo
Copy link
Author

ajwillo commented Jan 7, 2021

that was just a typo in copying I think, the data that it outputted is as working code, the good result and the bad result are the same code, just one of the interfaces is a an SVI (Vlan10) and the other a interface (TenGigabitEthernet1/0/2)

@mrxinu
Copy link
Contributor

mrxinu commented Jan 8, 2021

Do both queries return the same results in SWQL Studio as you're seeing here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants