scaleway / netbox-netprod-importer

Poll data from network devices in production and import it into netbox
GNU General Public License v3.0
101 stars 31 forks source link

ERROR: netbox_importer: Error when polling device ******. No real error #31

Closed JBaptisme33 closed 4 years ago

JBaptisme33 commented 4 years ago

Hello,

Thanks for your hard work regarding netbox and napalm integration Unfortunately, I have some issue regarding netbox_importer + napalm digineo_procurve (for hp - aruba switchs).

Test (https://github.com/digineo/napalm-digineo-procurve/blob/master/tests/test_queries.py) python script tool work fine, except for uptime, were 0 is issued since user is not autorized to run "show uptime" (not really serious).

Unfortunately, when netbox-netprod-importer import is lauched, in DEBUG mode, I don't really have error (except regarding show uptime) and unfortunately, script stop with ERROR ERROR: netbox_importer: Error when polling device *****

DEBUG: netmiko: write_channel: b'\n' DEBUG: paramiko.transport: [chan 0] EOF received (0) DEBUG: paramiko.transport: [chan 0] EOF sent (0) DEBUG: paramiko.transport: EOF in transport thread DEBUG: netmiko: read_channel: ERROR: netbox_importer: Error when polling device XXXXXXXX: 100%|████████████████

Regarding show uptime output is: DEBUG: netmiko: read_channel: DEBUG: netmiko: read_channel: DEBUG: netmiko: write_channel: b'show uptime\n' DEBUG: netmiko: rshow uptime: Invalid input: uptime XXXXXXXX> DEBUG: netmiko: repr = '\x1b[24;18Hshow uptim\x1b[24;18H\x1b[?25h\x1b[24;28H\x1b[24;28He\x1b[24;28H\x1b[?25h\x1b[24;29H\x1b[1;0H\x1b[1M\x1b[24;1H\x1b[1L\x1b[24;29H\x1b[24;1H\x1b[2K\x1b[24;1H\x1b[?25h\x1b[24;1H\x1b[1;24r\x1b[24;1HInvalid input: uptime\r\n\x1b[1;24r\x1b[24;1H\x1b[24;1H\x1b[2K\x1b[24;1H\x1b[?25h\x1b[24;1H\x1b[24;1HXXXXXXXX> \x1b[24;1H\x1b[24;18H\x1b[24;1H\x1b[?25h\x1b[24;18H' DEBUG: netmiko: new_output = show uptimeInvalid input: uptime XXXXXXXX> DEBUG: netmiko: repr = 'show uptimeInvalid input: uptime\r\nXXXXXXXX> ' DEBUG: netmiko: In strip_ansi_escape_codes DEBUG: netmiko: repr = 'show uptimeInvalid input: uptime\r\nXXXXXXXX> ' DEBUG: netmiko: new_output = show uptimeInvalid input: uptime XXXXXXXX> DEBUG: netmiko: repr = 'show uptimeInvalid input: uptime\r\nXXXXXXXX> ' DEBUG: netbox_importer: Get properties of each interface

Cmd lauched is: netbox-netprod-importer import netbox_import.yaml -u YYYYYYY -p -v debug

I'm pretty stuck since I have no idea where importer failed / is blocked

Thanks for help!

aruhier commented 4 years ago

Hi, Thanks for the bug report! It seems to be an issue with napalm/netmiko. Can you tell me which model of devices you're targeting?

JBaptisme33 commented 4 years ago

Hello, Thanks for your help :)

Model is Aruba 2930F

Regards,

aruhier commented 4 years ago

Sadly, I don't think it's supported by Napalm (that I'm using to interact with the network devices), that's probably why you have this error. Maybe you can open a bug to them to add support for Aruba?

JBaptisme33 commented 4 years ago

Hi @aruhier ,

Thanks for answer. Unfortunately, how to have a more verbose debug to troubleshoot "importer part" which fail ?

Thanks,

aruhier commented 4 years ago

You already enabled the verbose mode, and you should see everything that napalm is trying to do on the device. The log you pasted about the show uptime isn't the issue, as it just ignores the error if any, and the importer seems to continue here: https://github.com/aruhier/netbox-netprod-importer/blob/master/netbox_netprod_importer/importer.py#L125

I would recommend you to run it with pdb, and see where it fails. Maybe you can try to disable the specific parser for ios, here: https://github.com/aruhier/netbox-netprod-importer/blob/master/netbox_netprod_importer/vendors/__init__.py#L15. It's some functions that I wrote, specific to each platforms, to get more info that what napalm could fetch. If you just comment ios = IOSParser, it will restrict the importer to what napalm can do, what will maybe help.

I doubt that it will be sufficient, though, as it seems to fail on parsing an output.

aruhier commented 4 years ago

I wrote "ios" because I suppose you were trying to simulate that, but comment whatever driver you're using for Aruba if it's not IOS.