Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Some ipfabric commands returns empty table #69

Closed
martin-networker opened this issue Jan 25, 2022 · 18 comments
Closed

Some ipfabric commands returns empty table #69

martin-networker opened this issue Jan 25, 2022 · 18 comments
Labels
status: accepted This issue has been accepted by the maintainers team for implementation

Comments

@martin-networker
Copy link

martin-networker commented Jan 25, 2022

Environment

  • Python version: 3.6.8
  • Nautobot version: 1.2.4
  • ipfabric version: 4.2.0

Following three ipfabric commands return empty table instead of data which is in IP Fabric application:
/ipfabric interfaces [device] [metric]
/ipfabric end-to-end-path [src-ip] [dst-ip] [src-port] [dst-port] [protocol]
/ipfabric routing [device] [protocol] [filter-opt]
All other commands are working correctly. Communicaions seems to be working even for those three commands as it receives the tables with header but there is no data in it.

Examples:
1)

/ipfabric routing device_name bgp-neighbors active
hostname   local As   src Int   local Address   vrf   nei Hostname   nei Address   nei As   state      total Received   
                                                                                                          Prefixes      
========================================================================================================================
/ipfabric interfaces device_name load
IntName   IN bps   OUT bps
==========================
/ipfabric end-to-end-path 10.1.1.1 10.1.2.1 1000 22 tcp
Hop   Fwd Type   Src Host   Src Type   Src Intf   Src Fwd   Dst Fwd   Dst Intf   Dst Type   Dst Host
====================================================================================================
@pke11y
Copy link
Contributor

pke11y commented Feb 1, 2022

@martin-networker did you set the correct snapshot with /ipfabric set-snapshot? Usually the table is only empty if there is no return data from the IP fabric server.

@martin-networker
Copy link
Author

@pke11y I have tried it with several snapshots and the response is the same. By default it use $last snapshot.
The data is in IP Fabric, only the response via chatops do not show anything.
Have you tested these commands on same version of IP Fabric and chatops as we have?

@pke11y
Copy link
Contributor

pke11y commented Feb 3, 2022

@martin-networker since you're using IP Fabric version 4 you'll need to be using v1.1.0 of the nautobot-plugin-chatops-ipfabric. They made breaking changes in IP Fabric v4 to the way diagrams are accessed using the API. So we implemented a new command to retrieve a diagram for the path trace instead of a table. The end-to-end-path command was deprecated in the most recent release and is intended for use in IP Fabric v3.

/ipfabric pathlookup 10.1.1.1 10.1.2.1 1000 22 tcp 

For the other two commands, be sure you're using the actual device name as it would be in IP Fabric.

/ipfabric routing rtr1 bgp-neighbors active
/ipfabric interfaces rtr1 load

@martin-networker
Copy link
Author

@pke11y we are already using v1.1.0 of the nautobot-plugin-chatops-ipfabric.

@pke11y
Copy link
Contributor

pke11y commented Feb 3, 2022

@martin-networker great, so /ipfabric pathlookup should work for you.

@martin-networker
Copy link
Author

@pke11y yes, but if you know this command does not work anymore do you intend to remove it?

Just to be sure we already were on 1.1.0 when I have created the ticket.

Do you have any idea why those two commands do return empty tables?
/ipfabric routing device_name bgp-neighbors active
/ipfabric interfaces device_name load

@pke11y
Copy link
Contributor

pke11y commented Feb 3, 2022

@martin-networker the end-to-end-path command still works for IP Fabric v3.

Can you confirm you're using the actual device name in the command e.g. rtr1 not device_name

/ipfabric routing rtr1 bgp-neighbors active
/ipfabric interfaces rtr1 load

@ghost
Copy link

ghost commented Feb 3, 2022

I have confirmed this is not working.

@ghost
Copy link

ghost commented Feb 3, 2022

So it seems that all the IP Fabric search are using eq which is a case sensitive search. When running the commands the hostnames are transformed to lowercase which will cause no matches.

I opened a feature request a couple weeks ago internally and we are working on a ieq function but this is not scheduled for release yet.

@pke11y
Copy link
Contributor

pke11y commented Feb 3, 2022

So if you run the command using the prompted drop-down lists does it work e.g. /ipfabric routing or /ipfabric interfaces?

@ghost
Copy link

ghost commented Feb 3, 2022

Currently the workaround would be using a regex.
eq 'l66exr1' -> reg '^[lL]66[eE][xX][rR]1$'

@martin-networker Can you try testing with uppercase HOSTNAME?

@ghost
Copy link

ghost commented Feb 3, 2022

So if you run the command using the prompted drop-down lists does it work e.g. /ipfabric routing or /ipfabric interfaces?

Using the dropdown it transforms hostname to lowercase:
devices = [ (device["hostname"], device["hostname"].lower()) for device in ipfabric_api.get_devices_info(snapshot_id) ]

image

@pke11y
Copy link
Contributor

pke11y commented Feb 3, 2022

Ok, so if we remove the .lower() we could resolve this issue?

@ghost
Copy link

ghost commented Feb 3, 2022

Ok, so if we remove the .lower() we could resolve this issue?

Only if they use the dropdown, if I type in the command and do 'L66exr1' it will not work

@ghost
Copy link

ghost commented Feb 3, 2022

Opened #76

Had this feature implemented in python-ipfabric so it was mainly copy/pasta

@martin-networker
Copy link
Author

If I run the command using the prompted drop-down lists does not work either. But @justinjeffery-ipf already confirmed that.

Entering the hostname in uppercase or lowercase does not help. I am not sure how this could help if the hostnames are really transformed to lowercase.

@pke11y
Copy link
Contributor

pke11y commented Feb 10, 2022

@martin-networker release 1.1.1 should fix this and will be published today.

@pke11y pke11y added the status: accepted This issue has been accepted by the maintainers team for implementation label Feb 10, 2022
@pke11y
Copy link
Contributor

pke11y commented Feb 10, 2022

Fix implemented in 1.1.1

@pke11y pke11y closed this as completed Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted by the maintainers team for implementation
Projects
None yet
Development

No branches or pull requests

2 participants