Send netdisco-users mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

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

   1. Re: question for rancid export users (Oliver Gorwits)
   2. Re: how does ignore_interfaces work (Oliver Gorwits)
--- Begin Message ---
Hi Nick

As of 2.39.29 I believe the default delimiter was already changed, as a
result of merging this PR:

https://github.com/netdisco/netdisco/pull/408

However do let me know if that's not the case! I do not use RANCID here
with Netdisco, so am not familiar with its operation.

regards,
Oliver.

On Tue, 1 Jan 2019 at 17:59, Nick Nauwelaerts <[email protected]>
wrote:

> heya,
>
> a question for all the users of makerancidconf:
>
> how many of you are still using rancid versions older as rancid 3.0 (which
> was released april 2014)?
>
>
>
> currently our default config.db delimiter is ':', while rancid 3.0
> switched this to ';' - mostly for ipv6 support.
>
>
>
> as such, i'd like to change the default delimiter to ';' for an easier out
> of the box experience. note that this is a default which you can override
> in the config file.
>
>
>
>
>
>
>
> appreciate the input.
>
>
>
> thx
>
>
>
> // nick
>
> ------------------------------
>
> *Volg Aquafin op Facebook <https://www.facebook.com/AquafinNV> | Twitter
> <https://twitter.com/aquafinnv> | YouTube
> <http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee> |
> LinkedIN <http://www.linkedin.com/company/aquafin/products> *
>
> In het kader van de uitoefening van onze taken verzamelen we bij Aquafin
> persoonsgegevens. Hoe we omgaan met deze gegevens en wat de rechten van de
> betrokkenen zijn, kan je nalezen in onze privacy policy
> <https://www.aquafin.be/nl-be/privacy-policy>.
>
>   P Denk aan het milieu. Druk deze mail niet onnodig af.
> _______________________________________________
> Netdisco mailing list
> [email protected]
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/

--- End Message ---
--- Begin Message ---
Hi Nick

What a good catch! Yes it's very clear from what you say, that repeated
calls to $snmp->interfaces() will of course bypass the ignore*
configuration.

I'll put some comments into the ticket in Github. In brief though, it may
be possible to only call $snmp once while the ports are refreshed, and then
afterwards refer to the set of ports in the DB as the canonical list. Also
I will direct you to ::DB::ResultSet::DevicePort.pm which I think contains
the delete() method where debug info can be added to show rows removed from
other tables.

regards
oliver.

On Wed, 2 Jan 2019 at 05:26, Nick Nauwelaerts <[email protected]>
wrote:

> (resending since mail was to large it seems)
>
>
>
> long story short (spent 4 hours or so investigating & rewriting this mail).
>
>
>
> only worker::plugin::discover::properties honors the ignore_interfaces
> setting, none of the other discover plugins which use device_port_* tables
> honor ignore_interfaces. same goes for ignore_notpresent_types which was
> recently added, which makes things even more complicated. the base of the
> issues lies in the part that all discover plugins use $snmp->interfaces to
> get their interfaces list, which does not take into account any ignore
> settings. snmp::info has some support for this back in 3.21/22 (
> https://github.com/netdisco/snmp-info/commit/0793ff31f520e5e1ac53439c0dd38376ff5e3faf)
> but no longer does (which is the correct way, since ignore_* are netdisco
> settings so imo snmp::info should not take that into account to much).
>
>
>
> we can either duplicate the ignore code for interfaces & notpresent in all
> discover plugins, which is easy but lazy, or find some other option -
> perhaps a device_port_ignore table, having $snmp->interfaces return a
> filtered list (if_ignore() is part of base snmp::info, which could be a
> target) or another function to get all ignored interfaces per device (using
> device_port as base perhaps, but i feel that's not quite in line with the
> spirit of discover, where you can also run subclasses).
>
>
>
>
>
> for example to fix plugin/discover/portproperties.pm i added the
> following, but then it still doesn't take into account
> ignore_notpresent_types:
>
>
>
> --- a/PortProperties.pm      2018-12-19 18:20:12.150492891 +0100
>
> +++ b/PortProperties.pm     2019-01-02 05:50:53.889394182 +0100
>
> @@ -77,6 +77,14 @@
>
>    return Status->info(" [$device] no port properties to record")
>
>      unless scalar keys %properties;
>
>
>
> +  foreach my $idx (keys %$interfaces) {
>
> +    if (scalar grep {$interfaces->{$idx} =~ m/^$_$/}
> @{setting('ignore_interfaces') || []}) {
>
> +      debug sprintf ' [%s] portproperties - ignoring %s
> (config:ignore_interfaces)',
>
> +        $device->ip, $interfaces->{$idx};
>
> +      delete $properties{$interfaces->{$idx}};
>
> +    }
>
> +  }
>
> +
>
>    schema('netdisco')->txn_do(sub {
>
>      my $gone = $device->properties_ports->delete;
>
>      debug sprintf ' [%s] props - removed %d ports with properties',
>
>
>
>
>
>
>
> bonus issue is that discover::properties deletes all interface references
> from device_port & all device_port_* tables, which is correct. however,
> when using the -D option for netdisco-do it only reports that it deletes
> the interfaces (from device_port) but fails to mention it also deleted
> everything from the other device_port_* tables. this is confusing since
> later steps like device_port_power etc report 0 interfaces deleted while
> they add x amount of interfaces (since they were deleted in
> discover::properties).
>
>
>
> i'll open an issue for this on github.
>
>
>
> // nick
>
>
>
> *From:* Oliver Gorwits [mailto:[email protected]]
> *Sent:* Friday, December 28, 2018 15:31
> *To:* [email protected]
> *Cc:* Pavel Skovajsa <[email protected]>; Nick Nauwelaerts <
> [email protected]>
> *Subject:* Re: [Netdisco] how does ignore_interfaces work
>
>
>
> If device_port_properties has rows that are not going away, then it's a
> bug, I think. The table should be wiped out and reinitialised on each
> rediscover.
>
>
>
>
> https://github.com/netdisco/netdisco/blob/master/lib/App/Netdisco/Worker/Plugin/Discover/PortProperties.pm#L81
>
>
>
> There has not been a feature, yet, to record why interfaces are ignored.
> Other than debugging (one-off and not something for permanent db storage),
> is there a use case for not ignoring the ignored interfaces?
>
>
>
> Thanks,
>
>
>
> regards
>
> oliver.
>
>
>
> On Wed, 19 Dec 2018 at 17:07, Nick Nauwelaerts <
> [email protected]> wrote:
>
> well, the table device_port_properties keeps all interfaces it seems, so i
> can just diff those against device_port.
>
>
>
> perhaps i'll just extend device_port_properties with 'ignore_reason' or
> something....
>
>
>
>
>
> // nick
>
>
>
> *From:* Pavel Skovajsa [mailto:[email protected]]
> *Sent:* Monday, December 17, 2018 10:23
> *To:* Nick Nauwelaerts <[email protected]>
> *Cc:* [email protected]
> *Subject:* Re: [Netdisco] how does ignore_interfaces work
>
>
>
> Nick,
>
> As an idea - Add debug flag to your .yml config file and grep it later?
>
>
>
> -pavel
>
>
> ------------------------------
>
> *Volg Aquafin op Facebook <https://www.facebook.com/AquafinNV> | Twitter
> <https://twitter.com/aquafinnv> | YouTube
> <http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee> |
> LinkedIN <http://www.linkedin.com/company/aquafin/products> *
>
> In het kader van de uitoefening van onze taken verzamelen we bij Aquafin
> persoonsgegevens. Hoe we omgaan met deze gegevens en wat de rechten van de
> betrokkenen zijn, kan je nalezen in onze privacy policy
> <https://www.aquafin.be/nl-be/privacy-policy>.
>
>   P Denk aan het milieu. Druk deze mail niet onnodig af.
>

--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
[email protected]
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to