Commit Graph

34 Commits

Author SHA1 Message Date
Oliver Gorwits
8ac13fa7d4 do not use 'DISTINCT' when a 'GROUP BY' is present (DBIx::Class dies) 2023-11-24 20:46:58 +00:00
Oliver Gorwits
82ae76e7b7 when searching for device always prefer matching on device to alias 2023-11-01 21:58:31 +00:00
Oliver Gorwits
21bc8cf63e backend field in jobqueue (#1114)
implements #969
2023-10-24 21:49:37 +01:00
Oliver Gorwits
791e97b746 #1099 missing join to device_port when searching for device using mac address 2023-08-29 17:56:40 +01:00
Oliver Gorwits
cbc32eb032 #949 replace other occurances of now() with LOCALTIMESTAMP 2023-03-03 14:21:18 +00:00
Oliver Gorwits
a9b0d58b79 #897 port free should only apply to physical interfaces 2022-07-25 17:42:38 +01:00
Oliver Gorwits
dc1f76c1aa Feature to gather SNMP Walk, use as Pseudo Device, and Browse Objects
* fix anomalous name

* add gather worker

* fix encoding of binary storage

* store results back to job

* now parsing mbis report to translate

* fix the broken report parser

* rename gather to snapshot

* implement walk code copied from SNMP::Info

* can now bulkwalk and parse mibs report and store resolved walk in cache

* add func/glob aliasing broken

* better aliasing

* implement aliasing from globals and funcs

* fix regexp for matching netdisco-mibs report

* fake cache entry for all ND2 methods called, add comments

* also save to logs/snapshots/IP

* add doc for netdisco-do

* add is_pseudo column to device table

* support for loading cache for pseudo devices

* check for hrSystemUptime as well as sysUpTime for snmp connect

* display pseudo devices with yellow pill for name

* color all cells for layers for pseudo

* no need to b64 encode binary data in scalars as we b64 whole thing after

* tweaked uptime check

* store snapshot to database instead of Job

* expose snapshots in device details tab

* small ux improvements on snap download

* fixes for errors in subnet mask searching

* hide snapshot management for pseudo devices

* update to use new netdisco-mibs object cache

* update for new format oids file

* start of work on loading walk into db for browsing

* store values and meta

* add auto increment col and oid index to browser

* start web plugin for browser

* add virtual search for oid children

* have all oid in separte table (60 seconds load on my laptop)

* rename table and add relation

* store oid as int array

* fix sql for children

* make jstree start working

* working very slow tree expand

* fix to work when first displaying tree

* store both oid and oid_parts

* simplify SQL to speed up (more complicated perl)

* fix sql bug, add better index, prettify tree

* render the snmp node detail

* add node template, make scrollable, pretty print data values (insecure)

* store munge hint

* some dubious code to munge the data

* make sure to filter by IP on device_browser

* make safer the rendering of value data (but need to come back to key ordering)

* fix sorting on object values

* limit the opening of child nodes to keep response good and unclutter

* factor out the munge and make safer

* reject unknown mungers

* show the munger and option (not working) to change

* additional js for munge select

* complete custom munge

* change so that saving to database is only at CLI and on request

* hide snmp tab if no browser rows in the db

* add helpful message when no browser rows for the device

* stub handler for search and add recurse control

* working search

* minor ui fixes

* implement typeahead for leaf search

* limit rows in typeahead

* make sure device_browser is visited in delete and renumber

* add requirements for this branch

* update manifest

* make sure node search and typeahead are restricted to current device only
2021-11-06 07:47:29 +00:00
Oliver Gorwits
d8a9ad9007 #808 avoid dns for fuzzy search on IPish thing 2021-10-06 08:28:56 +01:00
Oliver Gorwits
a040e8ae38 #814 when deleting device, avoid deleting jobs running on the device 2021-10-04 19:35:42 +01:00
Oliver Gorwits
2498d9766b #800 gather and report SNMP Chassis ID http://oid-info.com/cgi-bin/display?oid=1.3.6.1.4.1.9.3.6.3&a=display 2021-08-14 13:28:13 +01:00
Oliver Gorwits
d206b9ccbf a bunch of logic changes to allow tests to run standalone 2021-08-12 10:58:55 +01:00
nick n
83a946d36e replace unicode nonbreaking space with ascii space (#794) 2021-06-23 22:00:33 +01:00
Oliver Gorwits
2b72233738 release 2.046004 2020-10-17 14:28:53 +01:00
Oliver Gorwits
c7b8c3bcbd #748 always call NetAddr::MAC->new() with named mac param 2020-10-17 13:05:46 +01:00
Oliver Gorwits
3aeed20b78 #735 Slow web search for devices 2020-08-06 21:25:01 +01:00
Oliver Gorwits
f882f98319 #721 redux - better MAC address support in searching 2020-06-30 09:46:19 +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
Oliver Gorwits
db6e89607d #696 complete implementation of #688 2020-01-25 18:07:43 +00:00
Oliver Gorwits
c282a5a565 #688 Amend vlan search to show number of ports actually using the vlan 2019-12-22 08:33:11 +00:00
Oliver Gorwits
1b89d20dc7 #624 device layers search should be OR (not AND) 2019-08-18 11:19:34 +01:00
nick n
bf789cb57b typos 2019-08-17 10:25:49 +02:00
Oliver Gorwits
2c138a5690 #581 skip storing and displaying fabricated vlan 0 2019-05-30 06:58:34 +01:00
Oliver Gorwits
416cffe52a #577 fix bug related to hostnames comprised a-f only 2019-05-27 13:25:58 +01:00
Oliver Gorwits
e7aacddbc6 #498 Map with VLAN filter omits unconnected devices 2019-03-02 20:01:05 +00:00
Oliver Gorwits
23a87f19fd be less strict about finding the IP for logging 2019-01-03 23:29:14 +00:00
Oliver Gorwits
5bc0afa2f5 #476 log on delete for rows from related tables 2019-01-02 21:44:36 +00:00
Oliver Gorwits
d89c25b60a fix device search SQL error (reported by bhuddah) 2018-03-23 09:53:57 +00:00
Oliver Gorwits
a2269c469f #24 Show device age in device search view 2018-03-10 11:09:04 +00:00
Oliver Gorwits
6a43842ea9 #372 fix inventory doesn't work with only one device 2018-03-02 15:59:47 +00:00
Oliver Gorwits
dfa298a55b revert change to Device ResultSet which breaks search_for_device() 2017-07-14 13:50:40 +01:00
Oliver Gorwits
4e5b544b9c #325 significant speed-up to Device > Ports tab (thx to T. Teräs) 2017-07-09 10:03:52 +01:00
Oliver Gorwits
9a72d7e74a Avoid lock/defer of jobs deined via ACL
This commit adds a table 'device_skip' that is used to restrict job queue
searches to avoid jobs that are not permitted on this backend via *_no ACLs,
or jobs on devices that have previously encountered multiple SNMP timeouts.

When the backend loads or a device is added, a row is added to the table if
that device should not be polled on this backend (together with the job
actions which are to be skipped/denied). When a device SNMP connect fails a
counter in the same row (or a new row) is incremented.

There is also a new report 'SNMP Connect Failures' to show the devices with
non-zero SNMP connect failure counters. A configurable limit in the setting
'max_deferrals' is used to set the threshold of no longer polling the device.

To reset the deferrals/failures count, restart the Netdisco backend (which
regenerates 'device_skip' cache entries).

Squashed commit of the following:

commit b5e32c219d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 20:55:14 2017 +0100

    show all failed connections in report

commit ffce3cee84
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 20:12:39 2017 +0100

    only resolve fqdn once

commit cc4f680f01
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 20:10:20 2017 +0100

    Revert "only resolve fqdn once"

    This reverts commit 3d136a54de.

commit d8d082b30e
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 20:09:05 2017 +0100

    a report to show SNMP failures

commit 3d136a54de
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 19:37:58 2017 +0100

    only resolve fqdn once

commit 4550b8a84c
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 17:27:43 2017 +0100

    skipover now implicit from deferrals/actionset; fix sql where logic with better correlation

commit b51edbccd2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 16:11:29 2017 +0100

    only abort lock if action matches badactions

commit 415559b24f
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 13:56:42 2017 +0100

    set skipover true when adding to actionset

commit 1086f2c467
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 13:50:56 2017 +0100

    fix empty actionset

commit 31962580b8
Merge: 9b2e993e 6808133b
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 13:25:08 2017 +0100

    Merge branch 'og-device_skip' of github.com:netdisco/netdisco into og-device_skip

commit 6808133bdb
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 13:19:54 2017 +0100

    in-job checks for acls are required for netdisco-do foreground actions

commit 3944dd7813
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 13:18:30 2017 +0100

    avoid extra device lookup

commit 9b2e993e0f
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 12:31:36 2017 +0100

    also delete device_skip rows when deleting device

commit b55854e91d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 11:34:27 2017 +0100

    actions in device_skip table are now an array/set

commit 5e126eef07
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 09:36:33 2017 +0100

    typo

commit 44266f2767
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 09:14:25 2017 +0100

    *able checks within jobs should not be necessary with skiplist

commit e7c22e7d11
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 08:58:57 2017 +0100

    increment deferrals field when job is deferred

commit 88ae9c00ba
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 08:40:27 2017 +0100

    turn connect fail into defer

commit eac1857043
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 23 08:26:59 2017 +0100

    rename failures column to be deferrals

commit 96ed444bbb
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 22 22:52:51 2017 +0100

    set up list of jobs the backend instance should skip

commit 3a0019296d
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 22 22:01:50 2017 +0100

    separate out is_*able last_* checks

commit cf8589aba2
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 21 22:35:38 2017 +0100

    change from ignore to skip name

commit ed193356f8
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 21 14:52:33 2017 +0100

    device_ignore table to track devices to skip in polling
2017-05-27 08:50:08 +01:00
Oliver Gorwits
d1a7761fda #302 Device searching now searches on module serial numbers 2017-04-19 21:30:47 +01:00
Oliver Gorwits
d23b32500f relocate repo files so ND2 is the only code 2017-04-14 23:08:55 +01:00