netbox-napalm-plugin icon indicating copy to clipboard operation
netbox-napalm-plugin copied to clipboard

napalm-panos driver

Open misho23-23 opened this issue 2 years ago • 5 comments

Hello,

Is your feature request related to a problem? Please describe. I have panos driver as a part of Napalm, used in Netbox v3.5.0 and direction to panos device is: "dcim/devices/5/status/" but there is table "Environment" with associated method get_environment. Unfortunately, napalm-panos doesn't support this getter method instead of table "Device Facts" with get_facts is working ok. How can I remove this table "Environment" for panos devices in Netbox?

also Device Config - dcim/devices/5/config/ is getting data but received config it's not formatted. image

Describe the solution you'd like remove table "Environment" with method get_environment "dcim/devices/5/status/" for all devices with platforms associated Napalm driver = panos.

format config output in XML

Thgank you!

misho23-23 avatar May 04 '23 09:05 misho23-23

@misho23-23 I was a little confused by the wording of this request, so let me repeat it back to you as I understand it and more generalized. To be more specific, you would like to check if a platform driver supports the getter used by a netbox-napalm feature. If it does not it should present the user with something like f"NAPALM driver for {<platform.} does not have support for getter{<getter_name>}.

The other way I sort of read it was that for drivers like panos, you want a way to specify another getter to use in place of the getters netbox-napalm uses.

Please verify my first understanding is correct.

ryanmerolle avatar May 05 '23 11:05 ryanmerolle

@misho23-23 I was a little confused by the wording of this request, so let me repeat it back to you as I understand it and more generalized. To be more specific, you would like to check if a platform driver supports the getter used by a netbox-napalm feature. If it does not it should present the user with something like f"NAPALM driver for {<platform.} does not have support for getter{<getter_name>}.

The other way I sort of read it was that for drivers like panos, you want a way to specify another getter to use in place of the getters netbox-napalm uses.

Please verify my first understanding is correct.

Hi @ryanmerolle,

I'd like to know if is possible to somehow customize page of the PANOS device where by /dcim/devices/5/status/ I'm receiving error: "Method get_environment not implemented for NAPALM driver <class 'napalm_panos.panos.PANOSDriver'>" what make sense because panos driver doesn't support get_environment. I want to remove Environment info from device where platform include NAPALM Driver = panos image

Sorry for explanation, I'm trying to describe as best as I can :)

Thank you for your time!

misho23-23 avatar May 05 '23 13:05 misho23-23

Yea That is what I was trying to say with the first write up.

If the getter is not valid for a driver show the tab, but say why it cannot be populated. If you remove the environment tab, people will think its another issue.

If the driver ever adds environment getter then nothing would need to be reverted for this approach. The approach also works with any other driver besides PANOS.

ryanmerolle avatar May 05 '23 13:05 ryanmerolle

Couple of options (although I like error trapping around a missing getter)... You can fork the napalm driver and add a get_environment method. Return an object with blank strings for the pieces (cpu, available_ram, used_ram, fans, temperature, power). Then (or second) find a way to get that data into a real function and submit it back upstream.

ekrichbaum avatar Sep 07 '23 18:09 ekrichbaum

Realizing that this has been a while.

https://github.com/ekrichbaum/napalm-panos

ekrichbaum avatar Apr 21 '24 01:04 ekrichbaum