Send netdisco-users mailing list submissions to
        netdisco-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/netdisco-users
or, via email, send a message with subject or body 'help' to
        netdisco-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
        netdisco-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of netdisco-users digest..."
Today's Topics:

   1. Re: pulling out Inventory via Python for automation?
      (Michael Butash)
   2. Re: pulling out Inventory via Python for automation?
      (Jimmy Taylor)
   3. Re: pulling out Inventory via Python for automation?
      (Joseph Bernard)
--- Begin Message ---
I too am curious about this.

I have been working on creating a few custom reports in ND for my own
purposes, and learning where to find data across its sql tables (as well as
learning sql queries) is probably the main thing, still automation data is
my end goal too.  ND is a wealth of information to reuse if you can get all
the bits formatted and exported into expected sql columns/rows if nothing
else.

I am not a dev or sql dba, but lots of googling plus examples previously
posted got me some decent custom report output beyond what ND does.
Probably just need to dip directly into pgsql with a dbi to get what you
want, and work off that, at least my plan.

Biggest issue I'm having is trying to figure out how to combine/recognize
things like relations between port channels + physical ports, and just
figuring out what is an uplink with lack of cdp/lldp vs. endpoint ports,
that sometimes ala vm hosts have many macs learned as well.  These are just
challenges with any automation in general around making sense of snmp data
between vendors I suppose, and why devops is so hard with networking, at
least for my non-developer self.

There is the API as well, but not sure how better it might be to work with
that vs. raw sql queries for your needs.

HTH!

-mb


On Mon, Jul 19, 2021 at 8:25 AM Joseph Bernard <j...@clemson.edu> wrote:

> Has anyone done or found Python code that can pull out switch information
> from Netidsco for use with things like Nornir, Netmiko, or NAPALM?  Just
> wanted to check so I don’t reinvent the wheel.
>
>
>
> Thanks,
>
> Joseph Bernard
> _______________________________________________
> Netdisco mailing list
> netdisco-users@lists.sourceforge.net
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/

--- End Message ---
--- Begin Message ---
I have done this in the past with Netmiko using the Psycopg library.

https://www.psycopg.org/docs/index.html

Like Michael was noting, the key is to get your Psql queries so you can get
the data back in a dictionary that you can work with. I used PgAdmin to
refine my queries:

https://www.pgadmin.org/

Some example queries I've done (use at your own risk):

https://gist.github.com/consentfactory/3990cfc6c1b75eb65fcfe1fdccf013ff

All this said, Netdisco has since implemented the Swagger-UI, which I might
prefer to use at times.

On Mon, Jul 19, 2021 at 11:56 AM Michael Butash <mich...@butash.net> wrote:

> I too am curious about this.
>
> I have been working on creating a few custom reports in ND for my own
> purposes, and learning where to find data across its sql tables (as well as
> learning sql queries) is probably the main thing, still automation data is
> my end goal too.  ND is a wealth of information to reuse if you can get all
> the bits formatted and exported into expected sql columns/rows if nothing
> else.
>
> I am not a dev or sql dba, but lots of googling plus examples previously
> posted got me some decent custom report output beyond what ND does.
> Probably just need to dip directly into pgsql with a dbi to get what you
> want, and work off that, at least my plan.
>
> Biggest issue I'm having is trying to figure out how to combine/recognize
> things like relations between port channels + physical ports, and just
> figuring out what is an uplink with lack of cdp/lldp vs. endpoint ports,
> that sometimes ala vm hosts have many macs learned as well.  These are just
> challenges with any automation in general around making sense of snmp data
> between vendors I suppose, and why devops is so hard with networking, at
> least for my non-developer self.
>
> There is the API as well, but not sure how better it might be to work with
> that vs. raw sql queries for your needs.
>
> HTH!
>
> -mb
>
>
> On Mon, Jul 19, 2021 at 8:25 AM Joseph Bernard <j...@clemson.edu> wrote:
>
>> Has anyone done or found Python code that can pull out switch information
>> from Netidsco for use with things like Nornir, Netmiko, or NAPALM?  Just
>> wanted to check so I don’t reinvent the wheel.
>>
>>
>>
>> Thanks,
>>
>> Joseph Bernard
>> _______________________________________________
>> Netdisco mailing list
>> netdisco-users@lists.sourceforge.net
>> https://sourceforge.net/p/netdisco/mailman/netdisco-users/
>
> _______________________________________________
> Netdisco mailing list
> netdisco-users@lists.sourceforge.net
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/



-- 
Jimmy Taylor

*Network Engineer*

Office of Information Technology

Boise State University

--- End Message ---
--- Begin Message ---
I did find this:

https://github.com/adambaumeister/netdisco_ansible_inventory

Which also uses the Psycopg library.  I’ll look into Swagger-UI as well.


Thanks,
Joseph B.


From: Jimmy Taylor <jimmytay...@boisestate.edu>
Date: Monday, July 19, 2021 at 3:19 PM
To: "netdisco-users@lists.sourceforge.net" 
<netdisco-users@lists.sourceforge.net>
Subject: Re: [Netdisco] pulling out Inventory via Python for automation?

I have done this in the past with Netmiko using the Psycopg library.

https://www.psycopg.org/docs/index.html

Like Michael was noting, the key is to get your Psql queries so you can get the 
data back in a dictionary that you can work with. I used PgAdmin to refine my 
queries:

https://www.pgadmin.org/

Some example queries I've done (use at your own risk):

https://gist.github.com/consentfactory/3990cfc6c1b75eb65fcfe1fdccf013ff

All this said, Netdisco has since implemented the Swagger-UI, which I might 
prefer to use at times.

On Mon, Jul 19, 2021 at 11:56 AM Michael Butash 
<mich...@butash.net<mailto:mich...@butash.net>> wrote:
I too am curious about this.

I have been working on creating a few custom reports in ND for my own purposes, 
and learning where to find data across its sql tables (as well as learning sql 
queries) is probably the main thing, still automation data is my end goal too.  
ND is a wealth of information to reuse if you can get all the bits formatted 
and exported into expected sql columns/rows if nothing else.

I am not a dev or sql dba, but lots of googling plus examples previously posted 
got me some decent custom report output beyond what ND does.  Probably just 
need to dip directly into pgsql with a dbi to get what you want, and work off 
that, at least my plan.

Biggest issue I'm having is trying to figure out how to combine/recognize 
things like relations between port channels + physical ports, and just figuring 
out what is an uplink with lack of cdp/lldp vs. endpoint ports, that sometimes 
ala vm hosts have many macs learned as well.  These are just challenges with 
any automation in general around making sense of snmp data between vendors I 
suppose, and why devops is so hard with networking, at least for my 
non-developer self.

There is the API as well, but not sure how better it might be to work with that 
vs. raw sql queries for your needs.

HTH!

-mb


On Mon, Jul 19, 2021 at 8:25 AM Joseph Bernard 
<j...@clemson.edu<mailto:j...@clemson.edu>> wrote:
Has anyone done or found Python code that can pull out switch information from 
Netidsco for use with things like Nornir, Netmiko, or NAPALM?  Just wanted to 
check so I don’t reinvent the wheel.

Thanks,
Joseph Bernard
_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net<mailto:netdisco-users@lists.sourceforge.net>
https://sourceforge.net/p/netdisco/mailman/netdisco-users/
_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net<mailto:netdisco-users@lists.sourceforge.net>
https://sourceforge.net/p/netdisco/mailman/netdisco-users/


--
Jimmy Taylor

Network Engineer

Office of Information Technology

Boise State University

--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
netdisco-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to