Commit Graph

718 Commits

Author SHA1 Message Date
Tony Murray
7d450345df
Fix sensor state translations (#16393)
* Fix sensor state translations

* Fix up lint/style

* Set state_index_id

* Apply fixes from StyleCI

* Wrong call

* just use a loop

* Wrong id column

* Missing fillable

* Handle sensors missing state translations

* Before making a state index

* Can't map to a state index if it doesn't exist

* Apply fixes from StyleCI

* ies5000 overflowing tinyint

* Accept state translations directly add that in the translation

* handle duplicate state names, but with different case (skip no way to work there)

* Apply fixes from StyleCI

* Fix type stuffs

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-09-15 02:13:11 +02:00
Tony Murray
35967dc98d
Remove CIMC custom inventory code (#16305)
No test data and it is too complex and strange to update without data.
If someone wants to update and re-submit it, they are welcome to.
2024-08-21 12:24:30 +02:00
Tony Murray
9d35fbc6a7
Entity Physical discovery: Rewrite to modern style (#16289)
* Initial entity-physical code

* Split out Entity-MIB trait

* Cisco Cellular inventory

* Fix bad test data

* alfo80hd - we now include all entPhysical entries

* Correct aos7 test data

* Add entPhysicalClass as last resort for label in ui

* aos add previously filtered data

* Fixup arista-eos data

* Update ariast_eos data

* Arris, clean garbage in Rev fields

* Aruba Instant custom inventory ported

* ArubaOS CX add vendor type mib

* aviat-wtm test data refresh

* axos add shelf fix data fields a bit

* ciena-rls

* ciena-sds

* Skip cimc for now... no test data

* Cisco updates

* Comware data update

* Update dnos

* Clean Edgeos garbage, make code from Arris shareable

* Relaxed ifIndex match, some devices cheat and send back static strings instead of formatted OIDs

* Regex refinement and updated edgeos with new clean data

* Update edgeswitch data

* Update eltex-mes21xx data

* eltex-mes23xx

* Guess at eltex-mes24xx since there is no test data

* Update eurostor, fix firmware version

* Apply fixes from StyleCI

* fixes

* Update fortigate data

* Update fortiweb, ftd, and fusion

* Update linux LSI

* Fix hexToAscii null removal with different seperator handling

* icotera add final snmprec data to avoid snmpsim bug

* Update IOS data

* Update mrv-od

* Add junos translation

* Generic data updates n-r

* ruijie workaround snmpsim bug

* Port saf-cfm

* Recode Schleifenbauer, and fix entPhysicalIndex values

* SmartAX fixes

* sm-os and tait-infra93

* timos inventory was not right, fix it up

* ubiquoss-pon

* VRP, has custom data collection on top of normal
adapt port ifIndex lookup to handle it

* VRP exceeded the string length specified in ENTITY-MIB...

* data updates

* Final data update and code cleanup

* Apply fixes from StyleCI

* Lint fixes

* Add missing SnmpResponse->pluck() code

* Update db_schema.yaml

* Fix bad test data

* Another instant-on update

* oops

* Remove some unused code

# Conflicts:
#	includes/html/pages/device/overview.inc.php

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-08-21 01:12:09 -05:00
Tony Murray
075ba4c932
Ports UI update (#16115)
* WIP Device Ports porting to Laravel

* WIP port links

* Port Links WIP

* Port Links

* in_array -> isset

* Add request to DeviceTab data

* Add initial Pagination

* Missing select component

* Collapsed and expandable port neighbors
New expandable component

* Port sorting

* Fix port transfer

* Use menu entries to filter ports

* Add translatable strings

* style fixes and cleanup

* update css

* graph views and tidy controller
basic port link view

* cleanup

* port row blade to reuse in legacy port view

* Legacy tab url handling
work properly in subdirectory
remove includes from sub tab directory to prevent oddity

* fallback to detail list when the view doesn't exist

* Use named variable to simplify

* Fix issue from file that was a symlink

* Submenu handle sub items and query string urls

* extract pageLinks to improve readability

* fix typo

* Apply fixes from StyleCI

* phpstan was not happy using the relationship HasMany query

* Don't allow *bps etc to be on a second line

* Improve table on small screens

* Fix sort

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-06-16 11:29:06 -05:00
Jellyfrog
071ca9bc2a
Apply fixes from StyleCI (#15698)
Co-authored-by: StyleCI Bot <bot@styleci.io>
2024-01-04 22:39:12 -06:00
jaannnis
28e817b7e9
Update renamehost include more logging (#15280)
Added logging output to renamehost() if an RRD Folder already exists for the new hostname.
Before: NOT renamed: Renaming of 10.4.0.146 failed
Now: NOT renamed: Renaming of 10.4.0.146 failed due to existing RRD folder forDEVICE
2023-11-02 00:09:59 -05:00
Tony Murray
7e0b41a05a
IP::fromHexString handle ascii (#15504)
* IP::fromHexString handle ascii
Some bad MIBs convert the hex to ascii on display.
Attempt to decode that if the situation is detected.

fixes #15501

* add ascii tests
2023-10-26 10:03:03 -05:00
Tony Murray
a5198d7d57
Remove some lightly used or unused dbFacile functions (#15418)
* Remove some lightly used or unused dbFacile functions
['NULL'] legacy behavior seems unsupported, replace with actual nulls

* Fix refactor mishap

* another

* update baseline

* these were very wrong... what happened?
2023-10-12 09:15:03 -05:00
Tony Murray
e6be5f777b
Use modern device attrib handling (#15429)
* Use modern attrib handling
Remove device attribs array.

fixes #15422

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-11 18:29:47 -05:00
Tony Murray
c87c6e8b8e
Remove legacy addhost code (#15376)
* Remove legacy addhost code
Update webui addhost
Update device snmp settings page
Update discovery protocols device discovery (no longer force full new device discovery in process)

* remove baseline exceptions

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-07 22:02:45 -05:00
Tony Murray
4211b1c46f
Remove unused functions (#15371)
* Remove unused functions
inline other legacy functions

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-04 10:17:34 -05:00
Tim de Boer
15fd452b8a
Added extra ASN-range comments, added Priv eBGP on host details, changed color to light-blue instead of red (#15372) 2023-10-04 10:07:14 -05:00
Tony Murray
47dfb34cf0
Print a useful error if logfile is not writable (#15233) 2023-08-19 09:09:00 -05:00
Tony Murray
6e4d124619
Misc fixes 2 (#15190)
* Fix error when missing poller data

* Apparently impossible to detect regex without error, so require regex always.  Update docs.

* Apparently this adva code is garbage :D

* Missing count sensor type

* Processor handle missing input

* Handle missing ifName a little better

* Yep, ports module is a dumpster fire.  Attempt to clean up some.

* apparently os yaml trying to replace on non-existent fields

* Might as well define all sensor type units

* revert previous fix, real issue was vlans module does not have polling.
2023-08-13 18:43:52 +02:00
Tony Murray
d1b7004fef
Severity Enum (#14620)
* Severity Enum
Replace old Alert constants

* Fix whitespace

* Additional uses

* style fixes

* Fix test too

* More missed locations

* More
2023-08-05 12:12:36 -05:00
Tony Murray
12f8bb2040
MAC Vendor OUI use scheduler (#15187)
* MAC Vendor OUI use scheduler
Add command to update `lnms maintenance:fetch-ouis`
Show vendor column in tables if mac_oui.enabled is set to true
Improve scheduler validation handle non-standard install directories and systems without systemd
Add index to table to improve speed and improve mac->vendor lookup speed
Scheduled weekly with random wait to prevent stampeding herd issues for upstream
drop oui update from daily

* MAC Vendor OUI use scheduler
Add command to update `lnms maintenance:fetch-ouis`
Show vendor column in tables if mac_oui.enabled is set to true

* Lint fixes and better prefix detection

* update schema file
2023-08-03 19:29:30 -05:00
Jellyfrog
5a56e9081e
Use Laravel schema migration command directly (#14039)
* Add new schema migration command

* Apply fixes from StyleCI
2023-08-03 19:26:48 -05:00
tarik
3541a582bb
fixing the mac/vendor database download from wireshark, updated file … (#15175)
* fixing the mac/vendor database download from wireshark, updated file location and format

* fixing the formatting issues
2023-07-31 22:16:52 -05:00
Andy Norwood
64c4650801
Add FDB table vendor search drop down (#15072)
* Add vendor search and related functions

* Add OUIDB cache for vendor lookup

* Add vendor drop down

* appy style CI changes

* Apply style CI and lint changes

* more styleCI changes

* update type hinting

* Edit mac_oui cache lock name and function

* Update MAC OUI message during daily

* Use DB for vendor lookup

* New vendor_oui table migration

* New MAC OUI to database function

* Update readbleOUI to use DB rather than cache

* Make StyleCI changes

* styleCI tweak

* Remove lock release to allow refresh timer

* change migration name to match table

* add schema dump

* update schema

* styleCI tweak
2023-07-21 11:30:13 -05:00
Jellyfrog
b14e2d4609
Apply fixes from StyleCI (#15101)
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-06-13 13:35:00 +02:00
Tony Murray
04bb75f5f3
Alert transport cleanup, no_proxy support and other proxy cleanups (#14763)
* Add no_proxy and other proxy related settings
Set user agent on all http client requests
Unify http client usage

* Style fixes

* Remove useless use statements

* Correct variable, good job phpstan

* Add tests
fix https_proxy bug
add tcp:// to the config settings format

* style and lint fixes

* Remove guzzle from the direct dependencies

* Use built in Laravel testing functionality

* update baseline
2023-05-23 09:25:17 -05:00
Jellyfrog
68e0b3df28
Apply fixes from StyleCI (#14899)
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-03-13 22:32:22 +01:00
Jellyfrog
71d740770b
Remove Log::event (#14526)
* Remove Log::event

Use the Eventlog class directly instead

* wip

* wip

* wip

* Apply fixes from StyleCI

* Update Eventlog.php
2022-11-09 09:47:19 +01:00
Tony Murray
6cbe6fde4f
Mock astext (#14581)
* Mock astext
avoid dns failures

* whitespace

* fix arista

* restore test data except astext

* restore test data except astext

* Full fresh run

* Move DI call into class
2022-11-05 01:18:52 +01:00
Jellyfrog
7207614437
Trim whitespaces from device data (#14429)
* Trim whitespace from sensor and ports data

* Update arista_eos_vrf.json

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update Os.php

* wip

* wip

* wip

* Update querybuilder.json
2022-10-11 12:50:38 -05:00
Tony Murray
4afc188cad
Cache astext for 1 day (#14303)
* Cache astext for 1 day
Prep AS util to hold other code too
Fix code bugs (and hopefully not introduce new ones)

* Update AutonomousSystem.php
2022-09-14 02:00:30 +02:00
Tony Murray
6f5cf7727a
Misc webui code cleanups (#14242)
* Misc webui cleanups

* Style

* More

* graphing fixes

* More graph cleanups

* more fixes, graphs and device pages

* style
2022-08-30 12:55:37 -05:00
Jellyfrog
797d73ad16
Misc errors cleanup (#14257)
* Misc errors cleanup

* Rename the variable in the loop to match

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-08-30 09:00:12 -05:00
Jellyfrog
835eac1233
Fix some ErrorExceptions (#14241)
* Fix some ErrorExceptions

* Use Config::get default value

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-08-25 10:03:06 +02:00
Tony Murray
465fa3986a
Fix Undefined variable/key warnings (#14134)
* Fix Undefined variable/key warnings

* massage for test data

* restore set_numeric, only generates noise

* Fix ucd storage used (apparently free is not stored in discovery...)
2022-08-21 16:23:43 -05:00
Tony Murray
10a25d709f
Fix Hytera error (#13909)
Divide by Zero
2022-04-12 08:27:31 -05:00
Tony Murray
75ba74fe5b
Migrate addhost.php to lnms device:add (#13870)
* Migrate addhost.php to lnms device:add
Have snmp-scan.py call lnms device:add (make exit codes line up so this works)
Fix issue with ping only devices trying to detect os via snmp
Reorder options in device:add help and improve formatting
Update docs to remove references to addhost.php
Fix a bit of code that was in functional code

* fixes

* fix snmp version message
2022-04-04 10:41:18 -05:00
Tony Murray
1bfd411995
New device:add code (#13842)
* New device:add code
pre-requisite for updating other code paths
includes option to set display name
separate validation code from device creation

* remove duplicate community and v3 creds

* style fixes

* some lint fixes

* fix phpstan

* Exception cleanup
improved messages and translations

* port association mode to enum
well, pseudo enum

* defaults and cleanups

* fixed/improved validation messages

* fix tests

* fix stupid ide refactor mistake

* lint fixes
2022-03-12 16:14:32 -06:00
Tony Murray
b6a8b602b8
Oxidized update and Device remove (#13730)
* Oxidized + Device remove
Was just working on oxidized, but then to properly update nodes after delete, updated delete_device()

* revert dumb style changes

* baseline update and no DI there...

* Fix OS first load and device deletion missing tables
2022-01-29 21:09:05 -06:00
Jellyfrog
7d0bbb98eb
Replace Requests with HTTP Client (#13689) 2022-01-26 16:04:26 -06:00
Josh Jameson
0b85bceb34
Fix Temperature Sensor for AirOS 8.7.4+ (#13655)
* Fix Temperature Sensor for AirOS 8

* Update airos_airos8.json

* Update airos.json

* Add new skip_values feature to deal with Ubiquiti nonsense.
Tweak test data to test the change
fix not_regex

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-01-26 16:02:57 -06:00
Peca Nesovanovic
e23ad7947d
q-bridge-mib, discover missing VLANs, v2 (#13569)
* q-bridge-mib, discover missing VLANs v2

* copy/paste typo fix

* Use SnmpQuery

* Switch from Vlan_x to VLAN x

* Cleanup
Revert accidental change
Incorrect table depth (even though the outcome is the same)
And test data that was explicitly Vlan_

* fix test data

* update routeros_vlans

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-12-01 07:24:35 -06:00
Tony Murray
c79b187d72
Poller rewrite (Try 2) (#13525)
* core WIP

* try to finish up

* trim space too
and a couple of cleanups

* update test data

* put escapes back

* another net-snmp difference

* correct copy paste error

* WIP

* Use new code YAY

* a tiny bit more

* Kind of working

* Handle manual modules correctly

* convert core to modern module

* Only save metrics if modules is not overridden

* correct module exists check

* database error handling

* debug handling

* restore bad changes

* Introduce Actions
 RunAlertRulesAction
 UpdateDeviceGroupsAction

* tweaks to output

* Fix some issues in outside code

* Style fixes

* fixes to module status checks

* typehints!

* Use logger only and DI

* OS module not named correctly

* Work on quiet output a bit more

* generically don't change output when disabling debug if the driver is already stack

* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction

* restore legacy os module shim

* use the new poller code for tests

* PollingDevice event

* Fix some issues and enable/disable error reporting around legacy modules

* typehints

* fully update baseline

* Use Process for version commands so we don't leak debug output.

* don't detect rrdtool version in ci every time

* style fixes

* Warning fixes

* more fixes

* re-update baseline

* remove diff noise

* fix up alerts

* Catch exceptions in device ip lookup

* Revert accidental snmp.inc.php poller target change
(should have been ?: not ??)
2021-11-17 19:23:55 -06:00
Tony Murray
f8764ddcb5
Revert "Poller command rewrite (#13414)" (#13524)
This reverts commit 1752d1efd4.
2021-11-16 21:40:29 -06:00
Tony Murray
1752d1efd4
Poller command rewrite (#13414)
* core WIP

* try to finish up

* trim space too
and a couple of cleanups

* update test data

* put escapes back

* another net-snmp difference

* correct copy paste error

* WIP

* Use new code YAY

* a tiny bit more

* Kind of working

* Handle manual modules correctly

* convert core to modern module

* Only save metrics if modules is not overridden

* correct module exists check

* database error handling

* debug handling

* restore bad changes

* Introduce Actions
 RunAlertRulesAction
 UpdateDeviceGroupsAction

* tweaks to output

* Fix some issues in outside code

* Style fixes

* fixes to module status checks

* typehints!

* Use logger only and DI

* OS module not named correctly

* Work on quiet output a bit more

* generically don't change output when disabling debug if the driver is already stack

* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction

* restore legacy os module shim

* use the new poller code for tests

* PollingDevice event

* Fix some issues and enable/disable error reporting around legacy modules

* typehints

* fully update baseline

* Use Process for version commands so we don't leak debug output.

* don't detect rrdtool version in ci every time

* style fixes

* Warning fixes

* more fixes

* re-update baseline

* remove diff noise

* fix up alerts
2021-11-16 16:59:46 -06:00
PipoCanaja
9eb3950546
[bug] Fix & extend MAC OUI table updates (#13479)
* get the OUIs from Wireshark CSV instead of macaddress.io which is not free anymore

* style

* optimize

* master wireshark repo

* fix Cache::get prefix ordering

* fix double cache get

Co-authored-by: Tony Murray <murraytony@gmail.com>

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-11-09 07:47:38 -06:00
Tony Murray
b979761cef
Don't use proxy for localhost (Oxidized and Prometheus) (#13450)
fixes #13382
2021-10-29 10:10:17 +02:00
Tony Murray
f94f7f23b8
Fully convert core to a modern module (#13347)
* Core module WIP

* update OS::make()

* core WIP

* try to finish up

* switch all core do os Model

* Mock WIP

* Working tests

* cleanup

* phpstan fixes

* style fixes

* fix agent

* trim space too
and a couple of cleanups

* corrected ios test data

* missed space

* update test data

* put escapes back

* another net-snmp difference

* Fix class description

* revert snmp.inc.php change, that can be a different PR

* revert snmp.inc.php change, that can be a different PR
2021-10-19 15:43:43 -05:00
Kevin Zink
98ed6bb9dc
New plugin system based on Laravel Package Development (#12998)
* use Blade view and Eloquent models for plugins

* move views

* fix style

* fix style

* revert mistake

* Update Plugin.php

delete test property "name"

* rename plugin function to settings

* last but not least - rename in Test.php

* Rename Test to Example

* fix typo

* fix style

* fix style

* fix style

* fix style - I hate tabs...

* Extract view calls

* fix method calls and style

* Move Models the the abstract class

* fix style

* Convert to traits

* Change the Example description

* Fix style

* Fix style

* Fix style

* Convert plugin function to Model static methods and delete .inc.php

* fix style

* fix style

* Use scope

* final methods blows up legacy code

* Config > \LibreNMS\Config

* convert the static string to a static method

* Correct placement in the page

* fix tabs

* fix style

* Rename from tait to hook

to make it easier to understand and be complient

* rename file

* Typo

* Started to change the docu

* change to a more usefully Device_Overview example

* and activate of course

* PluginManager

* fix .gitignore

* only php files in the root folder

* corrected .gitignore with all files :)

* Rename the Hooks and ExampleClass for better readability

* Fix style

* Fix style

* Exception handling (especially if DB is not present)

* Fix style and update schema

* fix indentation

* actually correct indent

* fix migration collation check include utf8mb4_bin

* stop phpstan whining

* A view lines documentation

* add typeHints

* Allow return null on handle

* lint

* fix return types

* fix logic of column collation check

* Fix MenuEntryHook

* switch to longtext instead of json type for now :D

* try phpstan on PHP 7.3

* set phpstan target version to 7.3

* all the typehints

* optional

* more

* Use namespace to prevent view collisions
disambiguate plugin and hook
no magic guessing of names in PluginManager, bad assumptions
remove unused plugins from the DB

* cleanup plugin menu

* cleanup on shutdown and ignore but log query error on cleanup

* instanceof must be called against an instance

* Allow multiple hooks per plugin

* Port plugin ui code to Laravel

* page instead of settings for v1 plugins

* actually working settings pages
a little url cleanup plugin/admin -> plugin/settings

* fix style

* Add page hook

* PHPstan

* Try to fix Illuminate\Http\RedirectResponse

* typehint

* Rewrite the doc

* Fix style

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-19 06:53:28 -05:00
Tony Murray
8d5bc3fc41
Use Measurements for all statistic collection (#13333)
* Use Measurements for all statistic collection

* fix space

* Use colors
cleanup

* fix style

* manually fix license notice

* add return times and new line

* add return times and new line

* fix mistake in copyright template

* fix style
2021-10-06 17:09:54 -05:00
Tony Murray
0b8b97bb68
Push Notifications (Mobile and PC) (#13277)
* Update manifest and add service worker
cleanup icons a bit

* Push notifications WIP

* navigate working

* cleanup

* acknowledge wired up

* Set VAPID keys on composer install

* Component to control notification permissions.

* Allow all user option to validate

* Enable on browser load if transport exists.

* Check for transport before showing user permissions
translations

* Documentation

* style fixes

* access via the attribute model

* fix alerting test

* update schema

* cleanup subscription on disable

* non-configurable db and table for webpush subscriptions (respect system connection)

* revert AlertTransport change
hopefully phpstan can figure it out

* phpstan fixes

* Support custom details display

* Match transport names to brand's preferred display

* less duplicate id errors

* Tests are done in Laravel code now so
remove legacy function usage... could be better, but ok

* Style fixes

* Style fixes 2

* Fix alert test

* Doc updates requires HTTPS and GMP

* unregister subscription when permission is set to denied

* cleanup after user deletion

* delete the right thing

* fix whitespace

* update install docs to include php-gmp

* suggest ext-gmp

* update javascript

* Update functions.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-10-06 07:29:47 -05:00
Tony Murray
aa35d2f0c0
Connectivity Helper to check and record device reachability (#13315)
* Fping WIP

* Update availability, move ping rrd update in the same place as db update.

* move classes around

* make device:ping command work

* use new code, remove legacy code

* save metrics boolean prevents all saves
style fixes

* update device array

* style fixes

* Update unit test

* fix whitespace

* Fix Fping stub

* fix backwards if

* fix phpstan complaining

* Fix return type

* add fillable to DeviceOutage model.

* device_outage migration to add id...

* missed line in db_schema.yaml

* 1 billion more comments on the brain damage up/down code

* tests for status and status_reason fields

* fix style again :D

* Duplicate legacy isSNMPable() functionality
but with only one snmp call ever 😎

* Remove unused variable

* fix migrations for sqlite
2021-10-03 22:45:10 -05:00
Cupid@zul
d63656c1e0
add eventlog on_create device
* add eventlog on_create device

* add snmpV3 vars

* styleci minor fix
2021-10-01 14:04:42 -05:00
Jellyfrog
258505ed44
Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Jellyfrog
26b95c0ccc
Apply fixes from StyleCI (#13208) 2021-09-08 23:35:56 +02:00