question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is Fortinet/Fortigate support broken?

See original GitHub issue

test_fortinet.debuglog.txt

  • OSX 10.11.6
  • Python 3.6.0
  • Netmiko 1.2.8
  • FortiGate-1500D v5.4.3,build1111,161220 (GA)

This is my example script:

#!/usr/bin/env python
# coding=utf-8
"""
    Fortinet Fortigate Test
"""
import logging

from netmiko import ConnectHandler

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('global')

devices = []

ips = ["10.10.10.1"]
for ip in ips:
    fortinet = {
        'device_type': 'fortinet',
        'ip':   ip,
        'username': 'admin',
        'password': 'xxxxx'
    }
    devices.append(fortinet)

for device in devices:
    net_connect = ConnectHandler(**device)
    output = net_connect.send_command('config global')
    output = net_connect.send_command('diagnose hardware deviceinfo nic')
    print(output)

Attached is a debug log.

After the config global command is issued by my script (not the one built into netmiko, the initial get system status seem to work, but as you can see I didn’t issue that) the console prompt is returned but not detected and falls into an endless loop of DEBUG:netmiko:read_channel:, as a result the diagnose hardware deviceinfo nic doesn’t execute.

Does anyone else see the same?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
linickxcommented, Mar 4, 2017

Yep, that’s all fixed now.

As you suggested, I did need to update my test script.

For the future reference of others, final debug attached - test_fortinet.debuglog-otherFW-3.txt - and updated script below.

@ktbyers Thank you.

#!/usr/bin/env python
# coding=utf-8
"""
    Fortinet Fortigate Test
"""
import logging

from netmiko import ConnectHandler

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('global')

devices = []

ips = ["10.159.75.204"]
for ip in ips:
    fortinet = {
        'device_type': 'fortinet',
        'ip':   ip,
        'username': 'admin',
        'password': 'xxxxx'
    }
    devices.append(fortinet)

for device in devices:
    net_connect = ConnectHandler(**device)
    output = net_connect.send_command_timing('config global', delay_factor=4)
    output = net_connect.send_command_timing('diagnose hardware deviceinfo nic', delay_factor=4)
    print(output)
1reaction
cpratherCSUcommented, Feb 10, 2022

= )

I only commented on it because someone w a similar issue had already commented. I only used Pv2 because I was in a hurry and my Pv3 was gen’ing an error w the import netmiko statement. I was in a hurry and moved on. I did briefly look for you email because the post was so old, I wasn’t sure that you’d actually respond. I didn’t find it after looking very briefly and moved on to the post. Sorry Kirk.

I think I found the solution to my problem by adding the 'expect_string = ‘[#?$]’ syntax to my send_command tuple.

Is there a class you offer w just the Netmiko, Paramiko stuff?

On Wed, Feb 9, 2022, 12:00 PM Kirk Byers @.***> wrote:

python2.7 Python 2.7 is dead. Netmiko has not supported it for a long time.

Also not really a good idea to comment on a closed issue that has been closed for almost five years.

— Reply to this email directly, view it on GitHub https://github.com/ktbyers/netmiko/issues/384#issuecomment-1034093663, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVNXZZ4LG5KFGLZUNUJHKATU2K2UDANCNFSM4DBQEDJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

FortiCare Technical Support and Services - Fortinet
FortiCare Technical Support Service is a per-device support service, and it provides customers access to over 1,400 experts to ensure efficient and effective ......
Read more >
Fortinet-tech-support - Reddit
Fortinet upgrade and user fortigate-tech-support created ... A glowing commendation for all to see Suffering from a broken heart 3
Read more >
Fortinet FortiGate 100F - security appliance - with 5 years ...
* Accidental Damage Service excludes theft, loss, and damage due to fire, flood or other acts of nature, or intentional damage. Customer must...
Read more >
How to fix broken Fortigate firmware / No firmware using TFTP ...
How to fix broken Fortigate firmware / No firmware using TFTP to flash firmware from the boot menu.
Read more >
Fortinet FortiGate-50E 1 Year Unified (UTM) Protection (24x7 ...
Buy Fortinet FortiGate-50E 1 Year Unified (UTM) Protection (24x7 FortiCare Plus ... New/Renewal License for FortiGate-60E; Fortinet designed support and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found