This commit is contained in:
2025-11-27 14:57:15 +01:00
parent bd4bc7cb24
commit 2d2362815b
8 changed files with 1024 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ pyyaml = "*"
nornir-napalm = "*" nornir-napalm = "*"
nornir-netmiko = "*" nornir-netmiko = "*"
nornir-utils = "*" nornir-utils = "*"
flask-cors = "*"
[dev-packages] [dev-packages]

View File

@@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "4d947c85d832e63deaf3652f8245d778c586afc05cd61da7299f47e32e965e60" "sha256": "8a160178df2ab018e137bb2e0047666e852a705a22b9a93b793b5d3aa4c43b65"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
@@ -395,6 +395,15 @@
"markers": "python_version >= '3.9'", "markers": "python_version >= '3.9'",
"version": "==3.1.2" "version": "==3.1.2"
}, },
"flask-cors": {
"hashes": [
"sha256:c7b2cbfb1a31aa0d2e5341eea03a6805349f7a61647daee1a15c46bbe981494c",
"sha256:d81bcb31f07b0985be7f48406247e9243aced229b7747219160a0559edd678db"
],
"index": "pypi",
"markers": "python_version >= '3.9' and python_version < '4.0'",
"version": "==6.0.1"
},
"idna": { "idna": {
"hashes": [ "hashes": [
"sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea",

View File

@@ -0,0 +1,168 @@
!
upgrade fpd auto
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1-CPE-BAT-A
!
boot-start-marker
boot-end-marker
!
logging message-counter syslog
!
no aaa new-model
ip source-route
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
ip domain name r1.cpe.local
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
file prompt quiet
username cisco privilege 15 password 0 cisco
archive
log config
hidekeys
!
!
!
!
!
ip tcp synwait-time 5
ip ssh version 2
ip scp server enable
!
!
!
!
interface Loopback1
description Loopback pour R1-CPE-BAT-A
ip address 1.1.1.1 255.255.255.255
!
interface Loopback2
description Loopback2 pour R1-CPE-BAT-A
ip address 1.1.1.2 255.255.255.255
!
interface Loopback10
description created from config file uploaded from postman
ip address 10.10.10.10 255.255.255.255
!
interface FastEthernet0/0
ip address 172.16.100.62 255.255.255.192
duplex half
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 10.1.1.1 255.255.255.252
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface GigabitEthernet2/0
no ip address
negotiation auto
!
interface GigabitEthernet2/0.10
description "Gateway for teacher vlan"
encapsulation dot1Q 10
ip address 172.16.10.253 255.255.255.0
vrrp 10 ip 172.16.10.252
!
interface GigabitEthernet2/0.20
description "Gateway for student vlan"
encapsulation dot1Q 20
ip address 172.16.20.253 255.255.255.0
vrrp 20 ip 172.16.20.252
!
interface GigabitEthernet2/0.99
encapsulation dot1Q 99
ip address 172.16.100.125 255.255.255.192
vrrp 99 ip 172.16.100.124
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
passive-interface FastEthernet0/0
passive-interface GigabitEthernet2/0.99
network 10.1.1.0 0.0.0.3 area 0
network 172.16.10.0 0.0.0.255 area 0
network 172.16.20.0 0.0.0.255 area 0
network 172.16.100.0 0.0.0.63 area 0
network 172.16.100.64 0.0.0.63 area 0
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login local
transport input ssh
!
end

View File

@@ -1,10 +1,13 @@
from flask import Flask,jsonify,request,abort, make_response,send_file from flask import Flask,jsonify,request,abort, make_response,send_file
from werkzeug.exceptions import HTTPException from werkzeug.exceptions import HTTPException
from nornir import InitNornir from nornir import InitNornir
from flask_cors import CORS
import os import os
from werkzeug.utils import secure_filename from werkzeug.utils import secure_filename
import json import json
ALLOWED_EXTENSIONS = {'conf'} ALLOWED_EXTENSIONS = {'conf'}
UPLOAD_FOLDER = 'fastprod/upload_files/' UPLOAD_FOLDER = 'fastprod/upload_files/'
@@ -20,6 +23,8 @@ def allowed_file(filename):
app = Flask(__name__) app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
CORS(app)
from services.devices import ( get_inventory, add_device,get_device_by_name,delete_device,get_device_interfaces,get_device_interfaces_ip,get_device_technical_info) from services.devices import ( get_inventory, add_device,get_device_by_name,delete_device,get_device_interfaces,get_device_interfaces_ip,get_device_technical_info)
from services.config import (get_config_by_device,run_config_from_file_by_device) from services.config import (get_config_by_device,run_config_from_file_by_device)
@@ -75,7 +80,7 @@ def get_technical_info(device_name):
if request.method == 'GET': if request.method == 'GET':
device = get_device_by_name(device_name) device = get_device_by_name(device_name)
technical_info = get_device_technical_info(device) technical_info = get_device_technical_info(device)
return jsonify(interfaces_ip=technical_info) return jsonify(facts=technical_info)
@app.route("/devices/<device_name>/config", methods=['GET','POST']) @app.route("/devices/<device_name>/config", methods=['GET','POST'])
def get_config(device_name): def get_config(device_name):
@@ -109,15 +114,13 @@ def snapshot(device_name):
data = get_snapshots_by_device(device) data = get_snapshots_by_device(device)
return jsonify({ return jsonify({
"result": True, "result": True,
"data": data "snapshots": data
}) })
if request.method == 'POST': if request.method == 'POST':
snapshot_path = create_snapshot_by_device(device) snapshot_path = create_snapshot_by_device(device)
return jsonify({ return jsonify({
"result": True, "result": True,
"data": { "snapshots": snapshot_path
"snapshot_path": snapshot_path
}
}) })
@app.route("/snapshots/<path:filename>", methods=['GET']) @app.route("/snapshots/<path:filename>", methods=['GET'])

View File

@@ -0,0 +1,236 @@
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
no service dhcp
!
hostname ESW1-CPE-BAT-A
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
no ip icmp rate-limit unreachable
no ip cef
!
!
!
!
no ip domain lookup
ip domain name esw1.local
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
macro name add_vlan
end
vlan database
vlan $v
exit
@
macro name del_vlan
end
vlan database
no vlan $v
exit
@
!
vtp file nvram:vlan.dat
username cisco privilege 15 password 0 cisco
archive
log config
hidekeys
!
!
!
!
ip tcp synwait-time 5
ip ssh version 2
!
!
!
!
interface Loopback1
no ip address
!
interface FastEthernet0/0
description *** Unused for Layer2 EtherSwitch ***
no ip address
no ip route-cache
duplex auto
speed auto
!
interface FastEthernet0/1
description *** Unused for Layer2 EtherSwitch ***
no ip address
no ip route-cache
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/1
description "port vlan teacher"
switchport access vlan 10
duplex full
speed 100
!
interface FastEthernet1/2
description "port vlan student"
switchport access vlan 20
duplex full
speed 100
!
interface FastEthernet1/3
duplex full
speed 100
!
interface FastEthernet1/4
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/5
duplex full
speed 100
!
interface FastEthernet1/6
duplex full
speed 100
!
interface FastEthernet1/7
duplex full
speed 100
!
interface FastEthernet1/8
duplex full
speed 100
!
interface FastEthernet1/9
duplex full
speed 100
!
interface FastEthernet1/10
duplex full
speed 100
!
interface FastEthernet1/11
duplex full
speed 100
!
interface FastEthernet1/12
duplex full
speed 100
!
interface FastEthernet1/13
duplex full
speed 100
!
interface FastEthernet1/14
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/15
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet2/0
no ip address
no ip route-cache
shutdown
duplex auto
speed auto
!
interface Vlan1
no ip address
no ip route-cache
!
interface Vlan99
ip address 172.16.100.123 255.255.255.192
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
banner exec ^C
***************************************************************
This is a normal Router with a Switch module inside (NM-16ESW)
It has been pre-configured with hard-coded speed and duplex
To create vlans use the command "vlan database" in exec mode
After creating all desired vlans use "exit" to apply the config
To view existing vlans use the command "show vlan-switch brief"
Alias(exec) : vl - "show vlan-switch brief" command
Alias(configure): va X - macro to add vlan X
Alias(configure): vd X - macro to delete vlan X
***************************************************************
^C
alias configure va macro global trace add_vlan $v
alias configure vd macro global trace del_vlan $v
alias exec vl show vlan-switch brief
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login local
transport input ssh
!
!
end

View File

@@ -0,0 +1,236 @@
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
no service dhcp
!
hostname ESW1-CPE-BAT-A
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
no ip icmp rate-limit unreachable
no ip cef
!
!
!
!
no ip domain lookup
ip domain name esw1.local
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
macro name add_vlan
end
vlan database
vlan $v
exit
@
macro name del_vlan
end
vlan database
no vlan $v
exit
@
!
vtp file nvram:vlan.dat
username cisco privilege 15 password 0 cisco
archive
log config
hidekeys
!
!
!
!
ip tcp synwait-time 5
ip ssh version 2
!
!
!
!
interface Loopback1
no ip address
!
interface FastEthernet0/0
description *** Unused for Layer2 EtherSwitch ***
no ip address
no ip route-cache
duplex auto
speed auto
!
interface FastEthernet0/1
description *** Unused for Layer2 EtherSwitch ***
no ip address
no ip route-cache
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/1
description "port vlan teacher"
switchport access vlan 10
duplex full
speed 100
!
interface FastEthernet1/2
description "port vlan student"
switchport access vlan 20
duplex full
speed 100
!
interface FastEthernet1/3
duplex full
speed 100
!
interface FastEthernet1/4
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/5
duplex full
speed 100
!
interface FastEthernet1/6
duplex full
speed 100
!
interface FastEthernet1/7
duplex full
speed 100
!
interface FastEthernet1/8
duplex full
speed 100
!
interface FastEthernet1/9
duplex full
speed 100
!
interface FastEthernet1/10
duplex full
speed 100
!
interface FastEthernet1/11
duplex full
speed 100
!
interface FastEthernet1/12
duplex full
speed 100
!
interface FastEthernet1/13
duplex full
speed 100
!
interface FastEthernet1/14
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet1/15
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet2/0
no ip address
no ip route-cache
shutdown
duplex auto
speed auto
!
interface Vlan1
no ip address
no ip route-cache
!
interface Vlan99
ip address 172.16.100.123 255.255.255.192
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
banner exec ^C
***************************************************************
This is a normal Router with a Switch module inside (NM-16ESW)
It has been pre-configured with hard-coded speed and duplex
To create vlans use the command "vlan database" in exec mode
After creating all desired vlans use "exit" to apply the config
To view existing vlans use the command "show vlan-switch brief"
Alias(exec) : vl - "show vlan-switch brief" command
Alias(configure): va X - macro to add vlan X
Alias(configure): vd X - macro to delete vlan X
***************************************************************
^C
alias configure va macro global trace add_vlan $v
alias configure vd macro global trace del_vlan $v
alias exec vl show vlan-switch brief
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login local
transport input ssh
!
!
end

View File

@@ -0,0 +1,168 @@
!
upgrade fpd auto
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1-CPE-BAT-A
!
boot-start-marker
boot-end-marker
!
logging message-counter syslog
!
no aaa new-model
ip source-route
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
ip domain name r1.cpe.local
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
file prompt quiet
username cisco privilege 15 password 0 cisco
archive
log config
hidekeys
!
!
!
!
!
ip tcp synwait-time 5
ip ssh version 2
ip scp server enable
!
!
!
!
interface Loopback1
description Loopback pour R1-CPE-BAT-A
ip address 1.1.1.1 255.255.255.255
!
interface Loopback2
description Loopback2 pour R1-CPE-BAT-A
ip address 1.1.1.2 255.255.255.255
!
interface Loopback10
description created from config file uploaded from postman
ip address 10.10.10.10 255.255.255.255
!
interface FastEthernet0/0
ip address 172.16.100.62 255.255.255.192
duplex half
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 10.1.1.1 255.255.255.252
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface GigabitEthernet2/0
no ip address
negotiation auto
!
interface GigabitEthernet2/0.10
description "Gateway for teacher vlan"
encapsulation dot1Q 10
ip address 172.16.10.253 255.255.255.0
vrrp 10 ip 172.16.10.252
!
interface GigabitEthernet2/0.20
description "Gateway for student vlan"
encapsulation dot1Q 20
ip address 172.16.20.253 255.255.255.0
vrrp 20 ip 172.16.20.252
!
interface GigabitEthernet2/0.99
encapsulation dot1Q 99
ip address 172.16.100.125 255.255.255.192
vrrp 99 ip 172.16.100.124
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
passive-interface FastEthernet0/0
passive-interface GigabitEthernet2/0.99
network 10.1.1.0 0.0.0.3 area 0
network 172.16.10.0 0.0.0.255 area 0
network 172.16.20.0 0.0.0.255 area 0
network 172.16.100.0 0.0.0.63 area 0
network 172.16.100.64 0.0.0.63 area 0
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login local
transport input ssh
!
end

View File

@@ -68,3 +68,200 @@ TypeError: expected string or bytes-like object, got 'list'
2025-11-27 13:53:07,676 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts 2025-11-27 13:53:07,676 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts
2025-11-27 13:53:27,844 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts 2025-11-27 13:53:27,844 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts
2025-11-27 13:55:22,325 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts 2025-11-27 13:55:22,325 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts
2025-11-27 14:27:45,418 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces']} on 1 hosts
2025-11-27 14:27:45,421 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:27:45,425 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:27:58,534 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:28:03,171 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts
2025-11-27 14:28:26,673 - nornir.core - INFO - run() - Running task 'napalm_cli' with args {'commands': ['show ip int br']} on 1 hosts
2025-11-27 14:29:34,616 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:31:40,826 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:31:47,954 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:34:06,500 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:34:06,510 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces']} on 1 hosts
2025-11-27 14:34:06,526 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:34:09,203 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts
2025-11-27 14:34:19,454 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:34:20,018 - nornir.core.task - ERROR - start() - Host 'ESW1-CPE-BAT-A': task 'napalm_get' failed with traceback:
Traceback (most recent call last):
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir/core/task.py", line 98, in start
r = self.task(self, **self.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir_napalm/plugins/tasks/napalm_get.py", line 44, in napalm_get
result[g] = method(**options)
^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 1215, in get_interfaces
output = self._send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 208, in _send_command
output = self.device.send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 111, in wrapper_decorator
return_val = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/utilities.py", line 667, in wrapper_decorator
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1791, in send_command
new_data = self.command_echo_read(cmd=cmd, read_timeout=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1494, in command_echo_read
new_data = self.read_until_pattern(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 755, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: 'show\\ interfaces' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.
2025-11-27 14:34:20,648 - nornir.core.task - ERROR - start() - Host 'ESW1-CPE-BAT-A': task 'napalm_get' failed with traceback:
Traceback (most recent call last):
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir/core/task.py", line 98, in start
r = self.task(self, **self.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir_napalm/plugins/tasks/napalm_get.py", line 44, in napalm_get
result[g] = method(**options)
^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 3676, in get_config
output = self._send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 208, in _send_command
output = self.device.send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 111, in wrapper_decorator
return_val = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/utilities.py", line 667, in wrapper_decorator
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1791, in send_command
new_data = self.command_echo_read(cmd=cmd, read_timeout=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1494, in command_echo_read
new_data = self.read_until_pattern(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 755, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: 'show\\ running\\-config' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.
2025-11-27 14:34:26,321 - nornir.core - WARNING - run() - Task 'napalm_get' has not been run 0 hosts selected
2025-11-27 14:34:29,743 - nornir.core - WARNING - run() - Task 'napalm_get' has not been run 0 hosts selected
2025-11-27 14:35:36,177 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:35:36,181 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:35:36,182 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces']} on 1 hosts
2025-11-27 14:35:58,683 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts
2025-11-27 14:40:22,059 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:40:22,065 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:40:22,069 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces']} on 1 hosts
2025-11-27 14:40:30,793 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces']} on 1 hosts
2025-11-27 14:40:30,804 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:40:30,817 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:40:36,971 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_config']} on 1 hosts
2025-11-27 14:40:43,753 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:40:43,762 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:40:43,767 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces']} on 1 hosts
2025-11-27 14:43:35,049 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces']} on 1 hosts
2025-11-27 14:43:35,051 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_interfaces_ip']} on 1 hosts
2025-11-27 14:43:35,053 - nornir.core - INFO - run() - Running task 'napalm_get' with args {'getters': ['get_facts']} on 1 hosts
2025-11-27 14:43:45,140 - nornir.core.task - ERROR - start() - Host 'R1-CPE-BAT-A': task 'napalm_get' failed with traceback:
Traceback (most recent call last):
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir/core/task.py", line 98, in start
r = self.task(self, **self.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir_napalm/plugins/tasks/napalm_get.py", line 44, in napalm_get
result[g] = method(**options)
^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 1215, in get_interfaces
output = self._send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 208, in _send_command
output = self.device.send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 111, in wrapper_decorator
return_val = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/utilities.py", line 667, in wrapper_decorator
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1791, in send_command
new_data = self.command_echo_read(cmd=cmd, read_timeout=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1494, in command_echo_read
new_data = self.read_until_pattern(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 755, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: 'show\\ interfaces' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.
2025-11-27 14:43:45,145 - nornir.core.task - ERROR - start() - Host 'R1-CPE-BAT-A': task 'napalm_get' failed with traceback:
Traceback (most recent call last):
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir/core/task.py", line 98, in start
r = self.task(self, **self.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/nornir_napalm/plugins/tasks/napalm_get.py", line 44, in napalm_get
result[g] = method(**options)
^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 1316, in get_interfaces_ip
show_ip_interface = self._send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/napalm/ios/ios.py", line 208, in _send_command
output = self.device.send_command(command)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 111, in wrapper_decorator
return_val = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/utilities.py", line 667, in wrapper_decorator
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1791, in send_command
new_data = self.command_echo_read(cmd=cmd, read_timeout=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 1494, in command_echo_read
new_data = self.read_until_pattern(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpe/.local/share/virtualenvs/fastprod_backend-xSm6n0LL/lib/python3.12/site-packages/netmiko/base_connection.py", line 755, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: 'show\\ ip\\ interface' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.