Commit Graph

223 Commits

Author SHA1 Message Date
Oliver Gorwits
47c4226788 refactor CustomFields so with_custom_fields is available on backend 2023-07-20 16:51:04 +01:00
Oliver Gorwits
31489ba550 #1072 clean custom_fields keys on rediscover 2023-07-20 12:49:40 +01:00
Oliver Gorwits
f8222e7890 #1072 clean custom_fields keys on rediscover 2023-07-19 22:18:00 +01:00
Oliver Gorwits
0378e01af7 skip set tags if none to set 2023-07-19 17:46:20 +01:00
Oliver Gorwits
4b99f0bb9c #1064 implement setting of tags on discovery based on config 2023-07-19 11:24:41 +01:00
Oliver Gorwits
71aa261737 fix skip long SNMP timeout for initial discover 2023-07-15 10:14:01 +01:00
Oliver Gorwits
eac55a581d #1066 implement snmp_try_slow_connect and fast device discover from queue 2023-07-14 17:37:52 +01:00
Oliver Gorwits
2cbb68889a #975 RBAC for port control with new portctl_by_role setting 2023-06-27 22:52:04 +01:00
Oliver Gorwits
b89e8913b6 #843 redux - also refresh API token for getapikey 2023-06-26 16:54:40 +01:00
Ambroise
130fa4aebe Change the way to retrieve IP address of interface (#1026)
Use by default the ipTable MIB entry to retrieve the IP address of interfaces and fallback to the index method as previously.
Fixe the issue with the case where the index is not really an IP address (seen in Fortinet with VDOM).

Related to issue #1016
2023-05-31 14:06:00 +01:00
Oliver Gorwits
9355f5c2b9 Refactored ACL support with multi-object compare
Squashed commit of the following:

commit 4081e22202693bd7c4ea00e95daad8e628c6fd5a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 29 21:02:07 2023 +0100

    large rename of check_acl* to acl_matches*

commit 3cfa284ddd24d68765c255578cc5c184afbdcd83
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri May 19 20:39:03 2023 +0100

    update permission doc

commit 8c7bb93cc5e9fafb770f98f446e45cbd94b14894
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 17 21:50:07 2023 +0100

    migrate most check_acl_only to acl_matches_only

commit c47f699f2a22f08f2f3e093ed0f24c891e6f9a82
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 17 21:39:19 2023 +0100

    rename check_acl* to be acl_matches*

commit a884a22c3ab1f3262118c3a47ed8e25b0b0a7336
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 14 16:50:42 2023 +0100

    update macsuck_no_deviceports to use acl_matches

commit 8c256af728721329b64d071fa529dfc844073ac6
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 7 22:54:33 2023 +0100

    update hide_deviceports to use acl_matches multi @things

commit cd5d9978aba1da459be4fed4500f395df13f7784
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 7 22:53:38 2023 +0100

    check_acl fix to allow all @things to offer a property before fallback to missing as empty string

commit 1a3ab9a7646e9f994f03126d45fc36e9e5a13ed5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 2 15:31:17 2023 +0100

    add ignore_deviceports to portproperties discover; improve comments

commit 51385ce89458dc939587dae902fda431719c22c9
Merge: b97c07d2 3f8ffe78
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 2 15:21:48 2023 +0100

    Merge branch 'master' into og-acl_multidict

commit b97c07d237d750c1d9eb3095d8ff3908512eac2a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 25 14:37:53 2023 +0000

    add support for arrayref of items, and unblessed hash, to check_acl
2023-05-29 21:32:07 +01:00
Oliver Gorwits
3f8ffe787f hooks only queued if their trigger job is successful (done) 2023-04-30 22:59:20 +01:00
Oliver Gorwits
949aeb9eea delete hook (#1032)
* make log_message optional in delete_device

* add hooks support to delete job

* make delete job high prio

* web delete now queues job instead of inline delete

* move web logging into web package and remove userlog from device delete helper

* submit delete job for expire device instead of inline delete

* fixes to get web submit form for delete device to work

* enable delete hook functionality
2023-04-30 22:58:42 +01:00
Oliver Gorwits
5c1e753c14 #1013 undef error in Nodes interfaces 2023-03-29 11:17:06 +01:00
Oliver Gorwits
1d988bbf7c implement ignore_layers, force_macsuck, force_arpnip config settings (#1002)
* implementation of ignore_layers, force_macsuck, force_arpnip and macwalk

* use new WalkJobs view to get devices needing macsuck

* also new query for discoverall, arpwalk, nbtwalk

* faux record has a last_defer stamp so we can see when the backend started

* fix typo
2023-03-15 14:44:42 +00:00
Oliver Gorwits
062895df10 allow 3min for port last_change compare to uptime, do not assume wrapped 2023-03-15 08:07:45 +00:00
Oliver Gorwits
2848877d74 #977 add comment to netdisco-do renumber about device_identity 2023-03-07 20:15:54 +00:00
Oliver Gorwits
4bb9b25ae9 #901 node_ip time_last can be before time_first 2023-03-03 15:34:16 +00:00
Oliver Gorwits
d9a384d1d0 #949 replace other occurances of now() with LOCALTIMESTAMP 2023-03-03 14:17:38 +00:00
Oliver Gorwits
29402f0726 #949 replace now() with LOCALTIMESTAMP and cast to_timestamp() as ::timestamp 2023-03-03 14:08:10 +00:00
Oliver Gorwits
de1ec0dc67 #981 inspect ports lastchange for uptime wrap only after filtering ports 2023-02-27 18:00:21 +00:00
Oliver Gorwits
83b49f8ece add IEEE8023-LAG-MIB to snapshot retrieval 2022-12-13 15:29:10 +00:00
Oliver Gorwits
22210b26b7 keep port custom_fields in place across device discovery 2022-12-11 16:54:07 +00:00
Oliver Gorwits
97f40539e9 update num_ports to number of actually stored interfaces
also change update_or_insert to just update as the code never runs unless
in_storage anyway
2022-12-11 16:37:33 +00:00
Oliver Gorwits
9eb6aaebfc set layer2 support after successful macsuck, similar to arpnip does for l3 2022-11-25 21:54:03 +00:00
Oliver Gorwits
826e1db39d API Endpoints to submit arpnip and macsuck results (#942)
* Add macsuck worker to collect various PortAccessEntity (NAC) attributes

* Incorporate PAE feedback on #937

 * missing Result/Device.pm column added
 * pae_is... columns instead of pae_capabilities
 * moved most code to Util/PortAccessEntity.pm so the update can
   be done in discover and macsuck

* Refactor PAE attributes during discover as separate Plugin

* PortAccessEntity: don't use device->dns in log string

* Fix "Experimental keys on scalar is now forbidden" test failure

* Revamp pae_control and add missing attribute

 - device.pae_control (text) is now device.pae_is_enabled (bool)
 - also store pae_authconfig_port_control (port mode auto/force(un)Auth)

* Fix "Experimental keys on scalar is now forbidden" test failure

 - ... again because of botched merge
 - at least perlgolfed away a set of curly braces

* Update PortAccessEntity.pm

* Incorporate @ollyg PR feedback

* allow actions without transport to run when there are also no creds

* initial refactor for separate gather, process, store phases for macsuck

* factor out the vlan sanity check

* additional help with log of action workers

* cleanup logic in check macsuck

* refactor to make main phases only

* some fixes

* implement file slurp. amazingly the whole thing works

* remove outdated noop from test

* treat error as critical, use cancel to suppress further drivers

* big refactor to share mac sanity code to both paths

* fix inverted logic on vlan sanity filter

* some code tidy

* fix error in default value

* fix for vlan 0 nodes input from cli

* ensure imported MACs are IEEE format

* add api endpoint, no useful return status yet

* exit status if error from nodes PUT

* suppress other networked workers when direct workers are active

* better log showing worker

* fix status recording to get first error or last done message

* implement arpnip API PUT

* avoid package redeclaration error

* make sure write API methods require admin status

* add doc for passing JSON data to arpnip and macsuck

* update manifest

* remove option to do jobs in web handler; all by queue now

* use job entry timestamp for offline queued jobs

* fix store username and IP on api PUT

* never de-duplicate user-submitted jobs; never reset DeviceSkip for offline jobs

* myworker no longer needed

* make logic cleaner

Co-authored-by: Christian Ramseyer <ramseyer@netnea.com>
2022-11-25 15:24:23 +00:00
Oliver Gorwits
0e9ff81cf5 Add worker to collect various PortAccessEntity (NAC) attributes (PR #937, partially implements #887)
* Add macsuck worker to collect various PortAccessEntity (NAC) attributes

* Incorporate PAE feedback on #937

 * missing Result/Device.pm column added
 * pae_is... columns instead of pae_capabilities
 * moved most code to Util/PortAccessEntity.pm so the update can
   be done in discover and macsuck

* Refactor PAE attributes during discover as separate Plugin

* PortAccessEntity: don't use device->dns in log string

* Fix "Experimental keys on scalar is now forbidden" test failure

* Revamp pae_control and add missing attribute

 - device.pae_control (text) is now device.pae_is_enabled (bool)
 - also store pae_authconfig_port_control (port mode auto/force(un)Auth)

* Fix "Experimental keys on scalar is now forbidden" test failure

 - ... again because of botched merge
 - at least perlgolfed away a set of curly braces

* Update PortAccessEntity.pm

* Incorporate @ollyg PR feedback

Co-authored-by: Christian Ramseyer <ramseyer@netnea.com>
2022-11-04 10:03:26 +01:00
Oliver Gorwits
2cb2809dd9 #935 Macsuck forces ports up/up - but a forwarding table may be present on a port that is down 2022-10-18 12:49:24 +01:00
Oliver Gorwits
f9f06032f0 revert change as check_acl_only is the right way to go 2022-09-30 21:55:50 +01:00
Oliver Gorwits
d6d877a406 rename setting macsuck_no_deviceport to macsuck_no_deviceports 2022-09-24 22:35:23 +01:00
Oliver Gorwits
790c51b257 #925 implement ignore_deviceports and hide_deviceports 2022-09-20 20:32:35 +01:00
Oliver Gorwits
79f7febc16 fix import 2022-08-16 12:27:47 -04:00
Oliver Gorwits
f4dde980ff #914 change from silent_ports to macsuck_no_deviceport 2022-08-16 09:27:50 +01:00
Oliver Gorwits
6a27a2b3b1 #914 initial implementation of silent_ports 2022-08-15 22:26:38 +01:00
Oliver Gorwits
148e52adf2 fix remote_ip dns resolution 2022-08-15 08:32:58 -04:00
Oliver Gorwits
b01d0f08fd add a remote_dns port property 2022-08-14 21:36:50 +01:00
Oliver Gorwits
a004db2951 add discover_routed_neighbors setting default true 2022-08-10 17:31:04 -04:00
Oliver Gorwits
162925f6eb change for separate uncompressed oid maps in netdisco-mibs 2022-08-09 06:24:22 +01:00
Oliver Gorwits
6ea1a22499 fix filename for all_oids.gz 2022-08-07 23:19:08 +01:00
Oliver Gorwits
1e2d9f36bf #912 use new all_oids format with additional status,enum,descr 2022-08-07 23:03:45 +01:00
Oliver Gorwits
83996046ae explicit return 2022-08-05 17:08:33 +01:00
Oliver Gorwits
2ae86b9fcd make the SNMP Browser faster and colour branches with data 2022-08-04 22:56:23 +01:00
Oliver Gorwits
b57b03a060 make loop detection not as fatal 2022-08-03 13:23:11 +01:00
Oliver Gorwits
fd42aff447 #888 add 1.0.8802.1.1 and 1.3.111.2.802 to the SNMP browser 2022-08-03 13:03:55 +01:00
Oliver Gorwits
2451579a81 #888 add 1.0.8802.1.1 and 1.3.111.2.802 to the SNMP browser 2022-08-02 22:28:09 +01:00
Oliver Gorwits
37712961bd fix typo bug 2022-08-02 21:44:12 +01:00
Oliver Gorwits
a1aac2777d use i_subinterfaces to group vlan subinterfaces like link aggregates in device ports view 2022-08-02 18:22:36 +01:00
Oliver Gorwits
dc659641bd retry without BULKWALK automatically in snapshot 2022-08-01 21:55:10 +01:00
Oliver Gorwits
0d3a066c38 better check for missing -d on addpseudodevice 2022-07-12 09:15:04 +01:00
Oliver Gorwits
07e8520bac #881 new addpseudodevice worker action 2022-07-04 22:02:47 +01:00