Code Monkey home page Code Monkey logo

nautobot-plugin-chatops-ipfabric's Issues

Teams Images Does not work

Environment

  • Python version: 3.9
  • Nautobot version: 1.2.4
  • ipfabric version: 1.1.0

Expected Behavior

Image should be sent to Teams.

Need to ask permission before trying to send.
https://github.com/nautobot/nautobot-plugin-chatops/blob/da60e9594e29380a39dbab54679da9a8c39fbec2/nautobot_chatops/dispatchers/ms_teams.py#L119

Observed Behavior

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/nautobot_chatops_ipfabric/worker.py", line 530, in pathlookup
dispatcher.send_image(img_path)
File "/usr/local/lib/python3.9/site-packages/nautobot_chatops/dispatchers/ms_teams.py", line 180, in send_image
raise RuntimeError("send_image() called without permission being granted to send an image")
RuntimeError: send_image() called without permission being granted to send an image

Steps to Reproduce

Filtering by Site with the "get-inventory" command doesn't work correctly

Environment

  • Python version: Unknown
  • Nautobot version: . 1.2.8
  • ipfabric version: 1.1.1

Expected Behavior

When running the command /ipfabric get-inventory, and selecting Sites from the Filter dropdown, a list of existing sites should appear in the following dropdown.

Observed Behavior

Instead, a list of devices appears in the dropdown. The other 3 Filter options work correctly (Vendor, Platform, and Model).

Steps to Reproduce

  1. Run command /ipfabric get-inventory
  2. Select Sites from the first "Filter inventory by" prompt
  3. Observe presented options in second, more specific "Filter by" dropdown

Path simulation

Environment

  • Nautobot version: 1.0.3
  • ipfabric version: 1.0.0

Proposed Functionality

Provide a chatops command to run a path simulation between two devices via IP Fabric.

/ipfabric get-path $device1 $device2)

Use Case

As a network engineer, I want to be able to retrieve the path between two devices in IP Fabric via chatops.

Remove poor man Continuous Deployment

Environment

  • Python version:
  • Nautobot version:
  • ipfabric version:

Expected Behavior

Continuous Deployment should not be part of the opensource project, we should remove our poor man CD implementation.

Observed Behavior

Steps to Reproduce

v4.3 Diagrams

Environment

  • Nautobot version: 1.2.4
  • ipfabric version: 1.1.0

Proposed Functionality

IP Fabric is changing path lookup again in v4.3. I was suggested on our side to start working on updating it.

Use Case

Interface errors by device

Environment

  • Nautobot version: 1.0.3
  • ipfabric version: 1.0.0

Proposed Functionality

Provide a chatops command to retrieve interface errors by device

/ipfabric get-int-errors $device

Use Case

As a network engineer, I want to be able to retrieve the interface error of a device in IP Fabric via chatops.

Add SSL Verification environment variable

Environment

  • Nautobot version:
  • ipfabric version: 4.2

Cannot connect to self-signed IP Fabric instances

Proposed Functionality

Environment variable IPF_VERIFY

Use Case

Example error:
HTTPSConnectionPool(host='demo3.ipf.ipfabric.io', port=443): Max retries exceeded with url: /api/v1/tables/addressing/hosts (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)')))* ⚠️

BGP neighbors by device

Environment

  • Nautobot version: 1.0.3
  • ipfabric version: 1.0.0

Proposed Functionality

Provide a chatops command to retrieve BGP neighbors by device

/ipfabric get-bgp-peers $device

Use Case

As a network engineer, I want to be able to retrieve the BGP neighbor table of a device in IP Fabric via chatops.

Interface drops by device

Environment

  • Nautobot version: 1.0.3
  • ipfabric version: 1.0.0

Proposed Functionality

Provide a chatops command to retrieve interface drops by device

/ipfabric get-int-drops $device

Use Case

As a network engineer, I want to be able to retrieve the interface drops of a device in IP Fabric via chatops.

Rename Plugin

Environment

  • Nautobot version: 1.3.3
  • ipfabric version: 1.1.4

Expected Behavior

Plugin should be named 'Nautobot ChatOps IPFabric'

Observed Behavior

Plugins > Installed Plugins
Package is named 'IPFabric' with description 'Nautobot Chatops IPFabric'

Steps to Reproduce

  1. Go to Plugins > Installed Plugins

Need help with testing

I have no idea how to run any tests locally cause everything I try fails.

Poetry install fails:
Command C:\Users\jjeffery\AppData\Local\pypoetry\Cache\virtualenvs\nautobot-chatops-ipfabric-ptI20pwq-py3.9\Scripts\pip.exe install --no-deps file:///C:/Users/jjeffery/AppData/Local/pypoetry/Cache/artifacts/69/ad/39/bfae9012d3f13c8d1abb2b33844bcb23c35ab4c06dc228d4e31a3e929b/pyuwsgi-2.0.20.tar.gz errored with the following return code 1, and output:
Processing c:\users\jjeffery\appdata\local\pypoetry\cache\artifacts\69\ad\39\bfae9012d3f13c8d1abb2b33844bcb23c35ab4c06dc228d4e31a3e929b\pyuwsgi-2.0.20.tar.gz
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Users\jjeffery\AppData\Local\pypoetry\Cache\virtualenvs\nautobot-chatops-ipfabric-ptI20pwq-py3.9\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Use
rs\jjeffery\AppData\Local\Temp\pip-req-build-08qgg0py\setup.py'"'"'; file='"'"'C:\Users\jjeffery\AppData\Local\Temp\pip-req-build-08qgg0py\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"',
open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\jjeffery\AppData\Local\Temp\pip-pip-egg-info-n5jn02m8'
cwd: C:\Users\jjeffery\AppData\Local\Temp\pip-req-build-08qgg0py
Complete output (7 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\jjeffery\AppData\Local\Temp\pip-req-build-08qgg0py\setup.py", line 13, in
import uwsgiconfig
File "C:\Users\jjeffery\AppData\Local\Temp\pip-req-build-08qgg0py\uwsgiconfig.py", line 8, in
uwsgi_os = os.uname()[0]
AttributeError: module 'os' has no attribute 'uname'

Invoke fails:
C:\Users\justi\Desktop\nautobot-plugin-chatops-ipfabric-snapshot-handling>invoke tests
Starting Docker Containers...
Starting Nautobot in detached mode...
Running docker-compose command "up --detach"
ipfabric_redis_1 is up-to-date
ipfabric_postgres_1 is up-to-date
Starting ipfabric_nautobot_1 ...
Starting ipfabric_nautobot_1 ... done
Starting ipfabric_celery_1 ...
Starting ipfabric_worker_1 ...
Starting ipfabric_celery_1 ... done
Starting ipfabric_worker_1 ... done
Running black...
Running docker-compose command "ps --services --filter status=running"
Running docker-compose command "exec nautobot black --check --diff ."
You indicated pty=True, but your platform doesn't support the 'pty' module!

Invoke on Ubuntu 18.04 fails:
#> invoke tests
Starting Docker Containers...
Starting Nautobot in detached mode...
Running docker-compose command "up --detach"
Builds, (re)creates, starts, and attaches to containers for a service.

Unless they are already running, this command also starts any linked services.

The docker-compose up command aggregates the output of each container. When
the command exits, all containers are stopped. Running docker-compose up -d
starts the containers in the background and leaves them running.

If there are existing containers for a service, and the service's configuration
or image was changed after the container's creation, docker-compose up picks
up the changes by stopping and recreating the containers (preserving mounted
volumes). To prevent Compose from picking up changes, use the --no-recreate
flag.

If you want to force Compose to stop and recreate all containers, use the
--force-recreate flag.

Interface load by device

Environment

  • Nautobot version: 1.0.3
  • ipfabric version: 1.0.0

Proposed Functionality

Provide a chatops command to retrieve interface load by device

/ipfabric get-int-load $device

Use Case

As a network engineer, I want to be able to retrieve the interface load of a device in IP Fabric via chatops.

Publish to PyPi

Environment

pypi

Expected Behavior

Package to be published

Observed Behavior

Not in pypi

Steps to Reproduce

  1. Navigate to pypi.org
  2. Search ipfabric
  3. This is not found

Some ipfabric commands returns empty table

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
====================================================================================================

ssot-sync-to-nautobot command failing

Environment

  • Python version:
  • Nautobot version: 1.5.7
  • ipfabric version: Latest
nautobot==1.5.7
nautobot-capacity-metrics==2.0.0
nautobot-chatops==1.10.0
nautobot-chatops-ipfabric==3.0.1
nautobot-ssot==1.2.0
nautobot-ssot-ipfabric==2.0.0

Expected Behavior

To start SSOT

Need to debug more but ran out of time.

Observed Behavior

*Sync failed. Here is the link to your job: https://nautobot-demo.ipf.cx/plugins/ssot/history/330fa397-f1d8-4068-af93-a1752549c0e6/*

  File "/opt/nautobot/lib/python3.9/site-packages/nautobot_ssot/jobs/base.py", line 332, in run
    self.sync_data()
  File "/opt/nautobot/lib/python3.9/site-packages/nautobot_ssot_ipfabric/jobs.py", line 225, in sync_data
    self.client.snapshot_id = self.kwargs["snapshot"]
KeyError: 'snapshot'

Steps to Reproduce

  1. Run /ipfabric ssot-sync-to-nautobot True True True

Error when no ssids are returned

Environment

  • Python version: 3.7
  • Nautobot version: 1.3
  • ipfabric version: latest

When no wireless ssids are returned from the API the following stack trace appears in the worker:

[2022-05-18 12:23:51,172: ERROR/ForkPoolWorker-2] Task nautobot_chatops.utils.celery_worker_task[b567414b-a44c-4bd5-8b0f-014717d03220] raised unexpected: AttributeError("'NoneType' object has no attribute 'lower'")
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops/utils.py", line 40, in celery_worker_task
    return function(
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops_ipfabric/worker.py", line 66, in ipfabric
    return handle_subcommands("ipfabric", subcommand, **kwargs)
  File "<decorator-gen-1>", line 2, in handle_subcommands
  File "/usr/local/lib/python3.10/site-packages/prometheus_client/context_managers.py", line 81, in wrapped
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops/workers/__init__.py", line 298, in handle_subcommands
    result = registry[command]["subcommands"][subcommand]["worker"](dispatcher, *params)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops/workers/__init__.py", line 187, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops_ipfabric/worker.py", line 692, in wireless
    ssids = [(ssidi["wlanSsid"].lower()) for ssidi in ipfabric_api.get_wireless_ssids(snapshot_id)]
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops_ipfabric/worker.py", line 692, in <listcomp>
    ssids = [(ssidi["wlanSsid"].lower()) for ssidi in ipfabric_api.get_wireless_ssids(snapshot_id)]
AttributeError: 'NoneType' object has no attribute 'lower'

End-to-end path simulation fails when path data isn't in snapshot

If a snapshot doesn't contain data for the requested path, the user will see the following error in chat:

image

This issue occurs when the e2e path data returned is incomplete and doesn't contain a forwarding key:

>>> response = ipfabric_api.get_path_simulation("10.0.10.5", "10.0.20.7", "1000", "80", "tcp", 'a8aa600d-e2e8-497b-809a-8a3c93fc805f')
>>> response
{'graph': {'nodes': [{'id': '10.0.10.5', 'hostname': '10.0.10.5', 'devType': 'host'}, {'id': '10.0.20.7', 'hostname': '10.0.20.7', 'devType': 'host'}], 'lookup': {'state': 'ok', 'id': None}, 'edges': [{'tlabel': '', 'inAcl': None, 'source': '10.0.10.5', 'id': '10.0.10.510.0.20.7l3', 'target': '10.0.20.7', 'linkType': 'cef', 'outAcl': None, 'slabel': ''}], 'type': 'e2e'}, 'ad': []}
>>> ipfabric_api.get_parsed_path_simulation("10.0.10.5", "10.0.20.7", "1000", "80", "tcp", "$last")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/source/ipfabric/ipfabric.py", line 169, in get_parsed_path_simulation
    edge_id = node["forwarding"][0]["dstIntList"][0]["id"]
KeyError: 'forwarding'

Currently, both get_parsed_path_simulation and get_src_dst_endpoint rely on the forwarding key to exist.

We need to handle the case when this key doesn't exist and/or the # of edges == 1 (meaning the path can't be determined).

End-to-end path broken after refactor

The end-to-end path command is failing after the most recent refactor:

⚠️ An internal error occurred:
'function' object has no attribute 'get_parsed_path_simulation'
⚠️

View Diff of a Routing Table Between Two Snapshots

Environment

  • Nautobot version: 1.4
  • ipfabric version: 1.2

Proposed Functionality

As a user I would like to be able to view the routing table on A device and the differences between snapshots. The command should be VRF aware.

Use Case

Pre/Post Validation checks

Implement custom IPFabric API caching

Proposed Functionality

As a simple improvement, in the Ipfabric API, we could add some basic caching for some endpoints that don't change so ofter: devices, snapshots, etc.

Use Case

Improve speed and reduce external API load

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.