Commit Graph

680 Commits

Author SHA1 Message Date
Oliver Gorwits
fc46384fc6 #227 Do not overwrite partially retrieved data with null or incorrect values
this and two related commits implements:
- setting snmp_field_protection which can be used to protect any
  database field from having a null value set
- extra device discover worker which prefetches SNMP interfaces and
  performs some sanity checks and comparison against the DB
the two checks will return job status ERROR with CANCELLED if they
see anything fishy.
2020-07-06 19:49:57 +01:00
Oliver Gorwits
fc4bd4b342 #732 Node Search via API for known node returns invalid or empty JSON
A few things going on here ... swagger submitting "false" query
params which intefered with truth testing by existence, and also the
Node search not using {results => {}} format response for template,
and also that response then containing DBIC objects which cannot be
translated to JSON without running HRI first.
2020-07-06 19:00:38 +01:00
Oliver Gorwits
650c419dc7 error out on discover failing to get good interfaces from SNMP 2020-07-03 09:32:58 +01:00
Oliver Gorwits
7e51fe2295 try to safeguard some snmp leaf gather failures 2020-07-01 21:21:09 +01:00
Oliver Gorwits
f882f98319 #721 redux - better MAC address support in searching 2020-06-30 09:46:19 +01:00
Oliver Gorwits
88ce0d7f9a #721 redux - Port Search handles VLAN and MAC addr properly 2020-06-29 19:00:05 +01:00
Oliver Gorwits
170ea64b7e #722 manual topology should not allow same left and right port/device 2020-06-29 14:42:06 +01:00
Oliver Gorwits
dc87a50076 #728 store SNMP Engine ID 2020-06-29 14:38:51 +01:00
Oliver Gorwits
83de59fcc0 #729 Discovery partially fails on invalid indexes 2020-06-29 14:05:44 +01:00
Oliver Gorwits
8ff595c321 release 2.045007 2020-06-05 09:10:46 +01:00
Ambroise
224bfbca52 - add a function to avoid to have two times the same device exported in rancid config (#725)
- avoid some strange warning message and add a default domain in makerancidconf plugin
2020-06-05 09:08:19 +01:00
Oliver Gorwits
b8eab54010 release 2.045006 2020-05-24 19:42:37 +01:00
Oliver Gorwits
3662899ede #721 search will trim whitespace and handle more MAC formats 2020-05-24 19:41:21 +01:00
Oliver Gorwits
ba32ba3f5d release 2.045005 2020-05-18 12:33:10 +01:00
Oliver Gorwits
24a6c88a60 release 2.045004 2020-05-15 13:10:03 +01:00
Oliver Gorwits
6d5d305a90 release 2.045003 2020-05-15 12:00:38 +01:00
Oliver Gorwits
0d3aec8c17 #715 fix crash on missing Accept Header 2020-05-15 11:53:09 +01:00
Oliver Gorwits
42bb6e548b #718 fix Node Search API endpoint 2020-05-15 11:44:01 +01:00
Oliver Gorwits
8acdb67346 minor bug fixes and cleanup 2020-05-15 11:35:12 +01:00
Christian Ramseyer
dcb45e4cad Fix previous commit
* revert unwanted commit of bogus Web/Plugin/Device/Modules.pm
 * commit actual fix for #710
2020-04-25 17:32:01 +02:00
Christian Ramseyer
5663f84917 Fix #710: overwrite invalid EntityMIB parents
Check the obtained EntityMIB tree for invalid parents, and
reassign these modules to the root of the tree so they don't
end up invisible
2020-04-25 17:21:21 +02:00
Christian Ramseyer
ec90e67ce5 Update IpInventory.pm
Remove superfluous oui.abbrev from IpInventory NodeIP vendor
2020-04-21 14:28:02 +02:00
Christian Ramseyer
4ae9b32973 Fix #704, allow delete without device_auth
* This typically comes up when using a deployment.yml generated from
   some inventory source, the device disappears and can then no
   longer be deleted since netdisco-delete unnecessarily insists on
   needing a valid device_auth
2020-04-21 00:43:59 +02:00
Christian Ramseyer
48996661ce Add vendor to IP Inventory report (#714)
* request on mailing list by Adrian Sevcenco, 08.04.20,
   "[Netdisco] how to modify report: add column to ip inventory"
2020-04-20 11:21:06 +01:00
Oliver Gorwits
b155be832d release 2.045002 2020-04-19 18:02:46 +01:00
Oliver Gorwits
b9c002477b allow swagger_path installed routes to be relocated 2020-04-19 18:00:15 +01:00
Oliver Gorwits
da33478504 try to make swagger safer with send_file 2020-04-19 11:22:28 +01:00
Oliver Gorwits
ed1cf3e2cd another swagger fix for non roothosting 2020-04-19 09:43:02 +01:00
Oliver Gorwits
4f0117e22c many fixes to swagger hosting to allow path relocation (part complete) 2020-04-18 17:26:04 +01:00
Oliver Gorwits
4f57a4d30a rename ports column in device table to be num_ports 2020-04-18 16:50:49 +01:00
Oliver Gorwits
11e8d7c001 release 2.045001 2020-04-18 09:48:33 +01:00
Oliver Gorwits
524f4792c3 restore port column needed for discovery 2020-04-18 09:47:05 +01:00
Oliver Gorwits
22edb6676f release 2.045000 2020-04-15 21:23:28 +01:00
Oliver Gorwits
dff26abc5c API implementation (#712)
* initial v0 creator

* working json api for generic reports

* add require login

* move report swagger into plugin, and set new default layout of noop

* require proper role and also use new util func

* start to tidy authn

* some work on cleaning up web authn

* clean up the authN checks

* fix bug

* fix the auth for api

* fixes to json handling

* set swagger sort order

* enable most reports for api endpoints

* fix doc

* add paramters to reports

* add missed report

* allow api_parameters in reports config

* reorganise api

* add vlan search

* add port search

* make sure to enable layout processing

* add device search

* add v1 to api paths

* add Node Search

* support api_responses

* add device object search; fix spurious ports field in device result class

* handle some plugins just returning undef if search fails

* errors from api seamlessley

* fix error in date range default

* more sensible default for prefix

* change order of endpoints in swagger-ui

* all db row classes can now TO_JSON

* add device_port api endpoint

* add device ports endpoint

* do not expand docs

* add swagger ui json tree formatter

* add all relations from Device table

* add port relations

* add nodes retrieve on device or vlan

* rename to GetAPIKey

* update config for previous commit
2020-04-15 21:15:52 +01:00
Christian Ramseyer
a8a77a2df1 Change SSHCollector::NXOS to use expect (#707)
* $ssh->capture() aka. directly executing a command via
   ssh <device> <command> does not seem to work on NXOS7, maybe
   also others

 * changed this module to use Expect, successfully tested on
   NXOS6 - NXOS9
2020-03-19 13:01:34 +01:00
Oliver Gorwits
8b42fb3774 fix pod 2020-02-13 14:23:27 +00:00
Oliver Gorwits
912a971a75 tidy the Clavister module 2020-02-13 10:24:10 +00:00
Henningen
2d849e60ce Create Clavister.pm (#674) 2020-02-13 10:20:24 +00:00
Oliver Gorwits
c3a995a476 release 2.044015 2020-02-12 16:56:19 +00:00
Oliver Gorwits
ab6305b4cf default access list for device_auth should be ipv4 and ipv6 2020-02-12 16:55:16 +00:00
Oliver Gorwits
2827d24f02 change from MCE::Shared to MCE::Queue after resolution of crash bug 2020-02-09 10:00:36 +00:00
Oliver Gorwits
d35a29931a change from MCE::Queue to MCE::Shared to better handle signals 2020-02-04 21:34:00 +00:00
Oliver Gorwits
7e489432d8 release 2.044012 2020-02-01 13:27:03 +00:00
Christian Ramseyer
031c3e6d95 Optimize PortMAC query
* We meant well but it turns out that the array unnest and join is
  actually very slow, as the join arguments do not get pushed down
  into the CTE (in Postgres 9/10 at least, later versions remove some
  of the optimization barriers in that specifc type of query)
* This caused a seq scan on both device and device_port, and the query
  is executed many times during macsuck
* The query is now rewritten to use ANY (macaddr[]) and without CTE,
  which seems to be around 20x faster
2020-01-31 10:32:02 +01:00
Oliver Gorwits
b032ebc18e prevent Template::AutoFilter taking action on CSV output 2020-01-30 19:21:02 +00:00
Christian Ramseyer
16e451c77c Change IOSXR Expect close method
* we noticed some hanging SSH connections with soft_close (probably due to fds not being closed properly), so switched to hard_close instead
2020-01-28 17:43:06 +01:00
Christian Ramseyer
8dc35a1b84 Merge branch 'master' of https://github.com/netdisco/netdisco
* 'master' of https://github.com/netdisco/netdisco:
  release 2.044011
2020-01-27 21:08:51 +01:00
Christian Ramseyer
0938cd1651 New version of the IOSXR module using Expect
* The previous module only worked for 32-bit IOSXR, and already
  there some fiddling with the STDIN of the process was required
  when being run from netdisco-backend
* In 64-bit IOSXR, the STDIN workaround stopped working and
  created a stuck ssh process on every arpnip
* This new version uses Expect instead of plain SSH, so a proper
  pty is provided under any circumstances
* Successfully tested on recent 32- and 64-bit variants
2020-01-27 21:03:23 +01:00
Oliver Gorwits
9e32c2a7f0 release 2.044011 2020-01-26 21:46:09 +00:00
Christian Ramseyer
f2f5d908bb Fix regression from PR #680
Hi @ollyg! Unfortunately I have found some issues with the code we
finally released in #680:

* get_port_macs expects an array ref but values() returns array,
  so the code was never called due to the return unless... check
* When fw_mac_list had exactly two entries, only the second value
  was bound as a scalar to the parameter. This is probably due
  to the shorthand bind formats described in
  https://metacpan.org/pod/DBIx::Class::ResultSet#DBIC-BIND-VALUES,
  but I'm not a 100% on this.
* return unless now checks for an entry in the list, with the old
  check the statement was also executed for empty lists

In cases where only the device(_port)?.mac lookup worked for uplink
detection, users of 02.044005 - 010 might get a lot of uplinks not
labeled as such.
2020-01-26 22:08:49 +01:00