Commit Graph

97 Commits

Author SHA1 Message Date
Oliver Gorwits
4ef5691bb5 allow pseudo devices to arpnip 2019-03-19 13:05:47 +00:00
Oliver Gorwits
46d8c52a08 Implement changes for API authentication and Swagger UI (#541)
* initial token-based-api login handler

* add token schema and validation

* initial import of pyro3d api code

* basic Swagger spec support

* Merge in working copy of API/Device.pm

* Fix some error handling for API/Device.pm

* Break out utility functions into separate file, to allow other api portions to use

* Add NodeIP support.

* Add nodeip plugin to config

* remove double define of "plugin:" (#448)

disclaimer: i did not test this is any way, came across it when looking for something else.

* only AuthZ header for api use, and alway regen key on login

* use RFC7235

* workaround for Swagger plugin weird response body

* do not autodiscover swagger routes

* code formatting only

* move api util to utils area

* initial full swagger spec for nodeip search

* add api user role and fix api auth failure response

* update version of swagger-ui to 3.20.3

* add more openapi defs

* fixes to SQL and api spec

* clean up subs

* improvements to login/logout for API

* make api logout work

* add openapi tags to group operations

* allow api params to be generated from DBIC schema spec

* remove API calls for nodes and devices

* remove some poor assumptions about api calls

* tidy up

* remove DDP

* make login and logout similar

* example of api call being handled by ajax call

* make the branch authonly
2019-03-17 20:27:19 +00:00
Oliver Gorwits
b5329d228b Add store phase and update Arpnip::Nodes to use it (#538)
* add store phase

* rework arpnip nodes to use store phase

* add late phase too so that users can still access content in db
2019-03-15 05:20:57 +00:00
Oliver Gorwits
9b39d1e452 rename CLI Transport to SSH 2019-03-13 22:23:38 +00:00
Oliver Gorwits
d44a8f56ea Integrate netdisco-sshcollector into Worker::Plugin architecture (#489) (#535)
* update changes and SNMP::Info dep

* Integrate netdisco-sshcollector into Worker::Plugin architecture (#489)

* Initial integration of sshcollector into Worker::Plugin architecture

 * add NodesBySSH.pm
 * update Build.PL and config.yml to integrate the new module

* Further integration of sshcollector into Worker::Plugin architecture

 * added App::Netdisco::Transport::CLI loosely based on ::SNMP counterpart
 * switched to the more prevalent two-space tabs style
 * removed various TBD items, some new ones

* Further steps to integration of sshcollector into Worker::Plugin architecture

 * cleaned up code
 * added various error handling
 * warning for bin/netdisco-sshcollector deprecation
 * device_auth allows passing master_opts to Net::OpenSSH
 * netdisco-do -D also toggles Net::OpenSSH debug

* Merged NodesBySSH.pm into Nodes.pm

 * see https://github.com/netdisco/netdisco/pull/489#pullrequestreview-205603516

* Further integration of sshcollector into Worker::Plugin architecture

 * add snmp_arpnip_also option to sshcollector device_auth
 * cleanup code

* Remove big TBD: comment from CLI.pm as doc is updated now

* add transport/cli.pm to manifest

* revert some changes to allow simpler merging

* silent exit legacy script unless explicitly requested

* move ssh code into Transport, part one

* rewrite the CLI transport to provide an API

* merge in og-get_external_credentials

Squashed commit of the following:

commit 3fe8f383a7
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Mar 11 17:07:42 2019 +0000

    add debug lines and tested

commit 3249739e42
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Mar 11 16:54:11 2019 +0000

    change config name to get_credentials

commit e78558397a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Mar 11 16:51:11 2019 +0000

    separate out generic device auth to DeviceAuth module

commit 249f05165f
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed Mar 6 18:43:31 2019 +0000

    release 2.040007

commit e3af64df77
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed Mar 6 18:42:47 2019 +0000

    #521-redux fix wifi date search

commit 48857ae300
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Mar 4 12:03:31 2019 +0000

    release 2.040006

commit e09dab5362
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Mar 4 11:39:12 2019 +0000

    #527 update List::MoreUtils version requirement

commit 6e7de3fff3
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon Mar 4 09:59:41 2019 +0000

    release 2.040005

commit 0c98318a45
Author: Oliver Gorwits <oliver@spike.local>
Date:   Mon Mar 4 09:57:18 2019 +0000

    #526 fix discover syntax bug

commit e9efc45182
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 14:56:48 2019 +0000

    release 2.040004

commit 6cdfd80d10
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 14:34:00 2019 +0000

    allow undiscovered neighbors report to use discover_{waps,phones} setting

commit ac381e0802
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 14:13:20 2019 +0000

    #506 was a red herring

commit b83e614c85
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 13:00:36 2019 +0000

    make discover_{phones,waps} work with LLDP capabilities as well

commit 189d234b55
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 12:47:38 2019 +0000

    check discover_no_type and friends earlier on in neighbors list build

commit 9c956466f3
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 12:32:07 2019 +0000

    also update default config for new discover_phones and discover_waps settings

commit 09d29954d2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 12:26:50 2019 +0000

    #512 fix regression in phone/wap discovery exclusion

commit 2bae91f1b6
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 12:01:34 2019 +0000

    rename match_devicetype() to match_to_setting()

commit 57cb6ddb70
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun Mar 3 09:19:39 2019 +0000

    fix for over-eager fix to #506

commit ef560fb59a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 22:41:40 2019 +0000

    #506 relax device renumber so it works for an alias

commit 7a8bcb094e
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 22:23:39 2019 +0000

    #521 Search Node Date Range not working

commit a643820a62
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 21:54:27 2019 +0000

    #428 Port-Channels not showing in netmap

commit 5ba5bcd295
Merge: e7aacddb a1f95028
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 20:04:11 2019 +0000

    Merge branch 'master' of github.com:netdisco/netdisco

commit e7aacddbc6
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 20:01:05 2019 +0000

    #498 Map with VLAN filter omits unconnected devices

commit a1f95028ca
Author: nick n <39005454+inphobia@users.noreply.github.com>
Date:   Sat Mar 2 19:54:22 2019 +0100

    catch up with changes

    noticed that rc-sshcollector-core received updates to changes, add them here as well.

    didn't mention #499 & #522

commit ce1b847cea
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 18:47:44 2019 +0000

    fix bug showing no nodes when only one matches in netmap

commit 78e30a7926
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 16:28:15 2019 +0000

    #500 filtering in device/ports on native vlan duplicates entries

commit 9952f0c6c7
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 15:02:12 2019 +0000

    #499 netdisco-do renumber reports wrong ip (inphobia)

commit ca3fd8f466
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 15:00:18 2019 +0000

    #505 device renumber should update device port properties and device skips

commit 1265bc8470
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 14:52:21 2019 +0000

    #520 catch slave ports defined without a master

commit d4c7579c10
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 14:47:49 2019 +0000

    #522 TypeAhead.pm can reference empty data (inphobia)

commit 77decc23b7
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 2 14:45:37 2019 +0000

    #514 inconsistent results in ip inventory (inphobia)

commit 3f211650b8
Author: nick n <39005454+inphobia@users.noreply.github.com>
Date:   Fri Mar 1 12:34:42 2019 +0100

    last pieces for db schema upgrade

    last piece of #510

* import legacy sshcollector config

* add default use_legacy_sshcollector config

* remove unneeded deps

* various fixes and now tested

* enable sshcollector platform tests
2019-03-12 18:50:24 +00:00
Oliver Gorwits
65f695410e test compilation of all scripts and modules (#537)
* test compilation of all scripts and modules passes

* try adding NetSNMP::default_store

* try adding NetSNMP::default_store

* travis test all branches

* make Configuration.pm safe for tests

* remove dep

* try adding net-snmp

* dist: xenial

* try building Net-SNMP locally

* no need for Try::Tiny

* allow test to pass for DPP:p

* better testing setup for session cookies

* yay! working compile tests for ALL!
2019-03-12 13:02:35 +00:00
Oliver Gorwits
0c98318a45 #526 fix discover syntax bug 2019-03-04 09:57:18 +00:00
Oliver Gorwits
b83e614c85 make discover_{phones,waps} work with LLDP capabilities as well 2019-03-03 13:00:43 +00:00
Oliver Gorwits
189d234b55 check discover_no_type and friends earlier on in neighbors list build 2019-03-03 12:49:17 +00:00
Oliver Gorwits
2bae91f1b6 rename match_devicetype() to match_to_setting() 2019-03-03 12:01:34 +00:00
Oliver Gorwits
57cb6ddb70 fix for over-eager fix to #506 2019-03-03 09:19:39 +00:00
Oliver Gorwits
ef560fb59a #506 relax device renumber so it works for an alias 2019-03-02 22:41:40 +00:00
Oliver Gorwits
1265bc8470 #520 catch slave ports defined without a master 2019-03-02 14:52:21 +00:00
ram
c2600ac550 Change location of ifindex to DevicePortProperties
* instead of DevicePort
* as requested by Oliver in PR #513 review
2019-02-23 15:26:38 +01:00
ram
24a7e80470 PR for #510 - store ifindex in device_port 2019-02-23 15:26:38 +01:00
nick n
e6d087ef5f fix for #491 (untested) (#492)
* move things to debug logging instead of info

* use message which was discussed

* merge master

* fix for #491. also use doublequotes in sprintf in portcontrol.pm line 59, else $device will not be printed
2019-01-24 14:12:06 +00:00
nick n
89b8f8c0ce allow snmp::info base class in netdisco-do (#486)
* allow the use of base snmp::info

* dont use .

* should have been: dont use $_

* also document some extra features

* reword
2019-01-14 22:02:08 +00:00
nick n
0205a11f01 makerancidconf overhaul
* Use the Fullname in top bar of Web interface and not the login

* Implement the following parameters:
 - add a rancid_conf parameter to retrieve the existing type for RANCID devices
 - add the default_group parameter to add devices in this group if they doesn't match the other parameters
 - add the hability to work with the RANCID version in https://github.com/earendilfr/rancid with subdirectory for the configuration files

* Fix following issues:
- Problem during the check of ACL when we have a negate character. The begate character is deleted during the first check
- The renumber function doesn't want to start

* Revert "Fix following issues:"

This reverts commit a8d9e8200a925b1a4d24374827d3fd5146f85b40.

* Revert "Implement the following parameters:"

This reverts commit aa29ca924cd92943490e4a2420a3972054e81e41.

* Add the following parameters to the MakeRancidConf:

 + Change the default delimiter character from ':' to ';' that is the default RANCID delimiter since
   RANCID 3.x
 + Add an option to define the rancid config directory.
   This directory will be used to extract the vendor defined in the RANCID configuration to avoid to extract
   unexisting vendor devices in RANCID configuration (by example, Ubiquiti AirOS devices).
 + Add an option to define a default_group.
   If a device doesn't match the defined group, it will add to this group
 + Add an option to defined a manually excluded ACL
   To permit to not export devices from Netdisco to RANCID based on an ACL.

* New version of the pull request to merge the makerancid improvment.
I have fixe some errors that have impact the revert for the PR #408

I have manually check on my instance and didn't see any warning on the result of the command netdisco-do makerancidconf

* Fix an issue if the by_ip group not exist in the RANCiD part of configuration

* Print the entry sorted in the router.db file

* testing if the sql in #436 can be integrated

* a bit of documentation cleanup

* a few more doc fixes

* minor docs changes

* rename rancid_home to rancid_cvsroot, which is how the setting is defined in rancid. this should make things clearer

* a bit more in-depth examples. allow for more device types (allow - in their name). use strict & warnings

* just to many caps
2019-01-14 01:56:32 +01:00
nick n
98a5e2c407 #479 part 2, use debug logging instead of info (#480)
#479 part 2, use debug instead of info logging.

2 whitespace cleanups also included, as well as rewording props -> properties like in the rest of portproperties.pm
2019-01-08 01:50:21 +01:00
Oliver Gorwits
7f1074ff84 #479 attempt better cache control for device ports 2019-01-07 22:47:13 +00:00
Oliver Gorwits
1dc3e70e37 fix to hopefully catch txrate and rate being scalar not list, as reported by inphobia 2019-01-03 22:59:33 +00:00
Oliver Gorwits
7811c32147 fix cached ports list which needs to be complete rows for Neighbors.pm to work 2019-01-03 22:56:17 +00:00
Oliver Gorwits
ccb0f0c78a #475 fix discover plugins do not respect ignore* config 2019-01-02 22:36:59 +00:00
Oliver Gorwits
3769b7b66b fix to the fix for ospf_routers discovery 2019-01-02 20:56:41 +00:00
Oliver Gorwits
6a986783e4 fix to the fix for ospf_routers discovery 2019-01-02 20:54:50 +00:00
Oliver Gorwits
505b7b5625 #471 fix bug in checking if there are OSPF router IDs to poll 2019-01-02 20:21:34 +00:00
Oliver Gorwits
b445d237e4 #471 OSPF Neighbor Discovery by router ID 2018-12-28 17:32:40 +00:00
nick n
8aed736925 ignore notpresent interfaces, with type filtering config item (set to [] to not filter). work done by postilion/nic bernstein, filter by me. also includes trailing space fix by nic. (#464) 2018-12-28 16:08:40 +00:00
Mohammad S Anwar
369590d17f Fixed pod error as reported by CPANTS. (#456) 2018-11-27 11:18:45 +00:00
Oliver Gorwits
ea2fde1e56 #439 add expire_userlog with default 365 days 2018-10-19 15:11:26 +01:00
Oliver Gorwits
13d5f04465 #419 "neigh - discrepancy in IP" due to differences in IPv6 formatting 2018-06-08 10:56:16 +01:00
Oliver Gorwits
a97780201d Revert "Squashed commit of the following:"
This reverts commit 232df96457.
2018-05-07 17:25:24 +01:00
Oliver Gorwits
232df96457 Squashed commit of the following:
commit 43a3729a206c8d04f9e156d1d811a1b7cfb84089
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 6 22:44:09 2018 +0100

    #408 improvements to MakeRancidConf (earendilfr)

commit 205911175ef52e0107ca59b96f51fee393120582
Author: Ambroise <earendil@toleressea.fr>
Date:   Thu Apr 26 17:44:15 2018 +0200

    Add the following parameters to the MakeRancidConf:

     + Change the default delimiter character from ':' to ';' that is the default RANCID delimiter since
       RANCID 3.x
     + Add an option to define the rancid config directory.
       This directory will be used to extract the vendor defined in the RANCID configuration to avoid to extract
       unexisting vendor devices in RANCID configuration (by example, Ubiquiti AirOS devices).
     + Add an option to define a default_group.
       If a device doesn't match the defined group, it will add to this group
     + Add an option to defined a manually excluded ACL
       To permit to not export devices from Netdisco to RANCID based on an ACL.
2018-05-06 22:46:57 +01:00
Oliver Gorwits
0d8cd3e764 #411 store_modules: false is ignored 2018-05-05 16:12:43 +01:00
Oliver Gorwits
fa6f70ac8a #413 manual retrigger of discovery does not work 2018-05-05 16:00:14 +01:00
Oliver Gorwits
cddbf44916 do not enqueue the same routed peer more than once 2018-04-28 11:40:58 +01:00
Eric A. Miller
8d1fb71c76 #401 Autodiscovery via EIGRP peers 2018-04-19 00:16:56 -04:00
Oliver Gorwits
b36a9e5699 #392 fix heuristic neighbour detection 2018-04-18 21:27:02 +01:00
Oliver Gorwits
2caae8a642 clean up check_mac() interface (ml-cms) 2018-04-18 19:24:08 +01:00
Oliver Gorwits
454ededa46 Revert "#380 attempt to resolve port name when it is given wrong"
This reverts commit f4a143612b.
2018-04-10 21:03:10 +01:00
Oliver Gorwits
08a5652ae0 Revert "save a device_port lookup"
This reverts commit d19b2fac93.
2018-04-10 20:58:07 +01:00
Oliver Gorwits
67ee1808b6 Revert "better way to construct short interface name"
This reverts commit 8bcfaf12d0.
2018-04-10 20:58:06 +01:00
Oliver Gorwits
00f3f2a796 Revert "work for shortening or lengthening ports"
This reverts commit 9d48c4a025.
2018-04-10 20:58:05 +01:00
Oliver Gorwits
52e14aeeeb Revert "no need for quotemeta"
This reverts commit 9339c1a2ce.
2018-04-10 20:58:02 +01:00
Oliver Gorwits
9339c1a2ce no need for quotemeta 2018-04-09 23:15:58 +01:00
Oliver Gorwits
9d48c4a025 work for shortening or lengthening ports 2018-04-09 23:05:17 +01:00
Oliver Gorwits
8bcfaf12d0 better way to construct short interface name 2018-04-09 22:58:23 +01:00
Oliver Gorwits
d19b2fac93 save a device_port lookup 2018-04-08 13:22:52 +01:00
Oliver Gorwits
87d42eacac enforce single row return 2018-04-07 23:24:53 +01:00
Oliver Gorwits
f4a143612b #380 attempt to resolve port name when it is given wrong 2018-04-07 23:17:23 +01:00