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. nornir inventory (Eric W. Bates)
   2. Re: nornir inventory (Christian Ramseyer)
   3. Re: nornir inventory (Joseph Bernard)
   4. Re: nornir inventory (Michael Butash)
--- Begin Message --- Has anyone already written a script to generate a nornir hosts/groups file from netdisco?

Thank you.

--
Clark 159a, MS 46
508/289-3112




--- End Message ---
--- Begin Message ---

On 09.09.21 16:59, Eric W. Bates wrote:
> Has anyone already written a script to generate a nornir hosts/groups
> file from netdisco?

Hi Eric

Not directly, but I recently discovered this Netdisco to Ansible
inventory tool:
<https://github.com/adambaumeister/netdisco_ansible_inventory>

This is also creates a similar YAML file with Netdisco contents, maybe
you can us it to get started.

Cheers
Christian





--- End Message ---
--- Begin Message ---
At the end of July I started a thread "pulling out Inventory via Python for 
automation?" if you look in the mail archives.  I still haven't gotten around 
to getting something tested due to higher priority issues popping up, but the 
answers people gave may help you.

Thanks,
Joseph B.


On 9/9/21, 11:18 AM, "Eric W. Bates" <eba...@whoi.edu> wrote:

    Has anyone already written a script to generate a nornir hosts/groups 
    file from netdisco?

    Thank you.

    -- 
    Clark 159a, MS 46
    508/289-3112



    _______________________________________________
    Netdisco mailing list
    netdisco-users@lists.sourceforge.net
    https://sourceforge.net/p/netdisco/mailman/netdisco-users/


--- End Message ---
--- Begin Message ---
Exporting the data you want, hostname, dns or ip (or all), or anything else
like vendor/model/os is pretty easy with even some very rudimentary pgsql
and sql skill, and I use that term skill loosely at least for myself.  I'm
an old network monkey, not a developer.

Logging into the db with psql (sudo su postgres && psql), entering the
netdisco db (\c netdisco), describing tables (\dt), doing some "select *
from xxx" different tables you learn and shows what you're looking for
where with minimal skill.  Rest is modifying queries of the examples given
in the reporting part of docs to get out what you want, and in what
format.  That I spent a half a day figuring out roughly how sql joins work
via furious googling and examples everyone's done a 1000x times already
decently enough to generate some of my own custom reports from queries.  I
did this a few months ago, I've mostly already forgotten what I did, but
easy enough to pick back up if needed from examples I did of my own.

Using Nornir you should be able to invoke a python dbi to get the data out
easy enough if you learn to query what you want from where within the
netdisco db schema.

HTH!

-mb


On Thu, Sep 9, 2021 at 8:18 AM Eric W. Bates <eba...@whoi.edu> wrote:

> Has anyone already written a script to generate a nornir hosts/groups
> file from netdisco?
>
> Thank you.
>
> --
> Clark 159a, MS 46
> 508/289-3112
>
>
>
> _______________________________________________
> Netdisco mailing list
> netdisco-users@lists.sourceforge.net
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/
>

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

Reply via email to