Commit Graph

824 Commits

Author SHA1 Message Date
Tony Murray
e08571c38c Transceiver Support (#16165)
* Add transceivers module

Move os specific code to OS

Fix errors and updated connector names

Add RouterOS, a lot less data there.

Add Comware

Add Exa, required a transformer function (mw to dBm)

Add Junos, revision was too short

Just starting on ui

Graphs, and more ui
some polling fixes

collapse header for small screens

refactor a bit

Missed graphs

Transceivers icon inline

Use @once on popup javascript

update db_schema.yaml

Don't show transceivers in basic view
basic view could use a review

Apply fixes from StyleCI

API functions

Comware don't fail if port is missing

Apply fixes from StyleCI

Add alert rules to collection

Device Overview

Attempt to fix bad alert rule, probably needs more

Fix up Comware and remove old sensors

Mark transceiver metrics without thresholds as Unknown

Routeros cleanup

Exa cleanup

Handle missing port

Graph allow filter by channel

More translations

Add transceiver graphs to port graphs

Add Cisco support, use entPhyscial module data if available

Fix OcNos divisors

Labels on transceiver page

Show encoding if available

Hacky OcNos port mapping

Fix up Junos optics and remove old sensors

FS switch support
Metric casts to prevent thrashing
Extra transform_function support

Add link to transceivers page from overview

Change default sort to group by type, then channel
move some code out of overview blade template
Fix bad type ocnos

Apply fixes from StyleCI

Add scales to graphs

Add some test data

Default sort order for metrcis in SQL applied by default

Transceiver metrics threshold manual settings via WebUI and API

Fixes to channels verbiage

Fix severity calculations

Add cable field for SM/MM/Copper

Apply fixes from StyleCI

update test data

Show DDM

Update DB schema file

Extend serial field to 32, even though devices shouldn't be able to have one longer than 16

Missing import

Add status field to database, that way we can support snmp implementations that only return an enum

Add missing files

Fix db_schema

Fix style

Fixes

Style fix

Work around phpstan issue

Update transceivers.blade.php

Missed getStatus() call

Prevent extra dots when channels are not changed

Update module to match upstream

Save ocnos metrics as sensors

Move to regular sensors

add entity physical index

Update UI to sensors WIP

Apply fixes from StyleCI

Forgot one change

Update ui to use sensors

Remove transceiver metrics

Remove metric os discover code
fs-switch pending

Remove transceiver metrics for fs-centec

Exa link up

Revert all test data

Fix up transceiver module interface

Remove unused Convert class

comware cache and transceiver type

Fix some transceiver metrics filtering and formatting issues

Consolidate display formatting

Coalesce commare hh3cTransceiverTable walks to prevent double walk

Use group to identify transceiver sensors

Fixup routeros

Fix up cisco

update db_schema

Small addition to docs

Improve overview layout and add graph popup

Update Junos

update css files

ddm should be nullable

Increase the field length for type and model

Cisco Improve detection when there is an intermediary container

Add transceiver test data

Apply fixes from StyleCI

Fix incorrect test data

Improve display formatting

Fix test data

Apply fixes from StyleCI

Fix up more data

Fix up more data

Fix incorrect return type in routeros

Update ocnos data

* Remove some remaining references to transceiver_metrics table
2024-09-29 11:05:44 -05:00
Tony Murray
d959bf1b36 Sanitize custom map SVGs (#16448)
https://github.com/librenms/librenms/security/advisories/GHSA-x8gm-j36p-fppf

Will only sanitize new SVGs. If you have existing backgrounds, they will not be sanitized.
XSS cannot be triggered within the LibreNMS UI, to trigger, you must directly visit the background image URL.
2024-09-29 14:17:21 +01:00
eskyuu
0643bb5574 Use 2 decimal places for bps numbers (#16451) 2024-09-29 14:41:38 +02:00
Tony Murray
d2fb66d3d5 Added global VLAN ports page (#16415)
* Global VLAN ports page

* Show a list of devices too

* Fix a little theme color issues

* oops

* Just put css in the theme

* Apply fixes from StyleCI

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
Co-authored-by: Neil Lathwood <gh+n@laf.io>
2024-09-25 16:14:13 +01:00
Daniel Preussker
c250ffa8e9 Fix smokeping generator for TCP transport (#16421) 2024-09-24 08:12:23 +02:00
Tony Murray
0a5c174f4f Fix test regressions introduced while tests were broken (#16399)
* AuthSSOTest: clear roles cache

* PollingJob: When a poller module doesn't exist, return null instead of false.  Skip all other checks and disable polling in that case.

* Sensors: Guess high and low limits separately as needed

* Sensors: drac test psu current data was wrong, referencing the snmprec, 8 / 10 and 0 / 10 should be the values
NOTE: drac is messed up and runs a billion snmp queriess for no reason

* please phpstan

* Sensors: limits reference old code
move to "creating"

* Fix gw-eydfa accidental assignment

* Fix ies5000 test data now that the bad state is removed

* Fix ies5000 test data part 2

* Move sensor discovery reset into discover_device()

* infinera remove duplicate sensor (also a lot of trailing whitespace apparently)

* Fix innovaphone bad yaml discovery

* module tests should be using null when test data doesn't exist, not an empty array

* When discovery or polling is not supported, dump null instead of an array.
Account for nulls in testing

* update ISE serial

* Janitza was seemingly wrong before

* Remove some private data

* bgp-peers requires ipv4-addresses and ipv6-addresses for bgpPeerIface

* fix polycomLens broken state sensor discovery

* Raritan pdu and pdu2 test data was combined in one test file, split it out

* scs-ks duplicate temperature sensor indexes

* sentry3 someone tried to avoid breaking stuff but just broke things more

* smartos-dcp-m fix incorrect numeric oids

* ssu2000 apparently test data was wrong, must have fixed a bug in the code.

* timos remove duplicate dbm sensor definitions

* bgpPeerIface is working in tests now

* Fix moxa-etherdevice when mibs are a bit different

* xw_to_dbm negative values should return null

* Update cisco test data due previous fixes/changes

* One more bgpPeerIface

* Add orderBy to ospf module db dumps

* Remove links test data for now

* Improve handling of bad data in ipv6-addresses module
2024-09-23 10:11:05 -05:00
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
a6b69c9c4d Save guessed limits (#16396)
* Save guessed limits
Previous code was guessing, then not saving the guess

* Move to creating, which revealed that limits were swapped

* Apply fixes from StyleCI

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-09-13 17:50:37 -05:00
Tony Murray
a0587154c4 Sensors move can skip and output into singleton (#16392)
* Sensors move can skip and output into singleton

* style

* rrd_type

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2024-09-13 10:23:17 -05:00
Tony Murray
00d6fc64d6 Fix sensor discover when device_id is omitted (#16389) 2024-09-12 11:20:50 -05:00
Jellyfrog
77fa7573cf Revert "Convert Config to a singleton (#16349)" (#16382)
This reverts commit f1e7a218f0.
2024-09-10 09:59:20 +02:00
Tony Murray
f1e7a218f0 Convert Config to a singleton (#16349)
* Convert Config to a singleton
Continuation of #14364 by @Jellyfrog
This time, make the old class a shim for the facade.  Will update references in a separate PR.

* Remove logging config call

* Apply fixes from StyleCI

* Fix bad Git constructor call

* Fail on config table does not exist instead of throw exception

* Inline LibrenmsConfig::isRegistered()

* Debug call in case there are more issues,
remove before merge.

* Fix up config tests

* Allow config cache controlled by CONFIG_CACHE_TTL (disabled by default for now)

* Enable config cache for tests

* Remove debug statement and deprecation phpdoc

* Apply fixes from StyleCI

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-09-09 18:48:07 +02:00
Tony Murray
071076149a Improved module controls (#16372)
* Improved module controls
Ability to clear device module overrides from webui
Ability to clear all database data for a module (helpful for module you have disabled that still have data)

Database reset only works for modern modules.

* Update functions.php
2024-09-09 09:09:19 +02:00
Tony Murray
3da691277a Sensor: Only post to eventlog when specific columns change (#16370) 2024-09-06 20:49:56 -05:00
Tony Murray
c561efdc8f Fix sensor custom limits being reverted (#16364) 2024-09-05 20:07:30 -05:00
Tony Murray
f15f8fa63a Sensors remove reliance on global variable (#16344)
* Sensors remove reliance on global variable

* Apply fixes from StyleCI

* Clear the instance instead of reset.
Remove $valid['sensors'] from docs

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-09-03 21:04:34 -05:00
Tony Murray
9e4b2fa3a3 Reject API device_add that are missing snmp info (#16314) 2024-08-27 07:08:19 -05:00
Tony Murray
e875461846 cli show string enums in snmp commands (#16317) 2024-08-26 23:06:25 -05:00
PipoCanaja
61ad4bfbbf Plugins v2 cleanup (#16298)
* cleanup

* use Illuminate\Support\Facades\Auth;

* style

* add route:cache and revert

* add route:cache and revert

* fix   in pluginExample

* fix Example plugin

* style

* fix other Hooks with Illuminate\Contracts\Auth\Authenticatable

* style

* whitespace

* whitespace2

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-08-26 19:45:12 +02:00
Tony Murray
db5fdf705d Poll device job (#16306)
* Split out single device polling to a Laravel Job
Probably totally broken :)

* Add dispatch option to device:poll

* Fix up submodules

* Add missing logger parameter

* Apply fixes from StyleCI

* Update module format in test helper

* Apply fixes from StyleCI

* Use Log facade to match other code

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-08-25 19:56:50 -05:00
PipoCanaja
2face4bc4a bug - Component "error" length issue (#15918)
* truncate component error in F5 LTM code

* sanity check in COmponent

* style

* mutators

* mutators moved

* moving

* Mutators OK, removing check from F5

* style

* fix LibreNMS/Component.php

* remove protected and see if it fixes issues

* nullable

* nullable

* nullable
2024-08-25 16:32:59 -05: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
5748ada02d Allow syslog hooks to be set by lnms config:set (#16302)
Also allow --ignore-checks to work for os settings
2024-08-19 19:52:49 +02:00
Tony Murray
70c2c543f3 Plugin Update (#16291)
* Plugin Update
Extract interfaces for use in plugin packages

# Conflicts:
#	composer.lock

* Fix some issues
settings_view -> content_view
2024-08-15 15:26:47 -05:00
Ferris-0815
520e44b0ed F5-Loadbalancer module to support an expiration check of the installed certificates (#16217)
* On branch f5-cert-expiration-check
Changes to be committed:
	modified:   app/Http/Controllers/Device/Tabs/LoadBalancerController.php
	modified:   includes/discovery/loadbalancers/f5-ltm.inc.php
	modified:   includes/html/pages/device/loadbalancer.inc.php
	new file:   includes/html/pages/device/loadbalancer/f5-cert.inc.php
	modified:   includes/polling/loadbalancers/f5-ltm.inc.php

These patches extend the F5-Loadbalancer module to support an expiration check of
the installed certificates.

* some minor corrections to (hopefully) pass the style-check

* a few more impovements to pass the style-chek

 On branch f5-cert-expiration-check
 Your branch is up to date with 'origin/f5-cert-expiration-check'.

 Changes to be committed:
	modified:   includes/discovery/loadbalancers/f5-ltm.inc.php
	modified:   includes/polling/loadbalancers/f5-ltm.inc.php

* more style-check adaptions...
2024-07-29 14:57:37 -05:00
Michael
9f4e6cbf01 add in/out erros to port table (#16073) 2024-07-26 09:09:38 -05:00
Tony Murray
b41d1b7ffb Fix Port Channels take 2 (#16246)
* Resubmit of #16227

* Add missing new files
2024-07-26 08:45:34 -05:00
Jellyfrog
e45dd59f77 Revert "Fix Port Channel (#16227)" (#16245)
This reverts commit 0d201c44c9.
2024-07-26 15:26:04 +02:00
Tony Murray
0d201c44c9 Fix Port Channel (#16227)
* Fix expandable sizing

* Temp fix: port_id_{low,high} is actually ifIndex

* new PortsStack discovery module, store actual port_ids

* Show 4 rows of ports by default

* Add test data

* Fix up the single port view too

* Apply fixes from StyleCI

* Update db_schema.yaml

* Update base migration because sqlite cannot add primary keys

* Fix phpstan failures

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-07-25 23:39:36 -05:00
Markus Viitamäki
5fc7055d54 set default_role when registering instead of at every login (#16235) 2024-07-22 16:58:34 +02:00
Tony Murray
a81a9f3cfc Fix custom map default settings error (#16236)
and config order
2024-07-22 09:24:56 -05:00
Tony Murray
cf7b025fb1 Custom Maps configurable new map defaults (#16212) 2024-07-17 16:05:44 -05:00
Tony Murray
1cceafb887 Improve Snmpsim usage to ease testing (#15471)
* Snmpsim use python venv
Patch to enable listening while minimizing output
Update lnms dev:simulate, tests, and ./scripts/save-test-data.php
removed old option to start snmpsim from older scripts, use lnms dev:simulate

* Apply fixes from StyleCI

* various fixes

* Remove patch official package is updated

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2024-07-17 16:05:07 -05:00
PipoCanaja
56b5eff952 Maps - Keep edge black when link is 0 bps (#16192)
* Black when link is 0bps

* style
2024-07-11 10:02:11 -05:00
Tony Murray
1baf8f4a1f lnms snmp:translate always show textual and numeric translations (#16187)
* lnms snmp:translate always show textual and numeric translations
accept os name as device spec for translate
values output tidy up for translate and one result

* ingore phpstan
2024-07-09 12:04:18 -05:00
Peca Nesovanovic
ba8d7338a3 [webui] Ports: correct sorting order when using ifName (#16170)
Signed-off-by: Peca Nesovanovic <peca.nesovanovic@sattrakt.com>
2024-07-04 14:34:13 -05:00
Tony Murray
5ab2f685b4 Fix device ports VRF display (#16146)
impossible to display before
2024-06-28 08:45:50 -05:00
Tony Murray
108727c500 Handle missing device when linking (#16164)
* Handle missing device when linking
Sometimes a device is gone, but data still points to it. Prevent error when that happens (even though it should not)

* Handle more gracefully

* Remove original work around

* Allow unsaved devices, we just need device_id really
2024-06-28 08:48:11 +02:00
Tony Murray
afba58cb29 Fix for lnms snmp:translate (#16159)
Wasn't handling things correctly
Disable numeric if the oid is already numeric and add ALL mibs
2024-06-27 13:04:06 -05:00
Tony Murray
6bd55dce25 Port link component easier graphs (#16147)
Allow type variable to pass into graphs of graph row
default 4 graph display so caller doesn't have to specify timeframes if they just what the default
2024-06-24 19:49:08 -05:00
Tony Murray
98fbfca027 Fix graph row lazy loading (#16145) 2024-06-19 09:20:23 -05:00
Tony Murray
a37efd2876 Device Ports settings (#16132)
* Device Ports settings

* Save port settings per user

* style

* Delete user pref if it matches the defaults

* Because we are saving settings now, we must explicitly set to make the links work
2024-06-18 23:58:10 -05:00
Tony Murray
592ea1c263 Change port pagination default to 32 (#16131)
* Change port pagination default to 32
that way this includes all ports for most switches.
Most port counts are base 2, so change pagination options to match

* ignore upstream missing closure type

* Fix style again

* more
2024-06-17 09:09:33 -05:00
Tony Murray
8c4caab81a Fix port pagination (#16127)
* Fix ports pagination

* Style fix
2024-06-17 02:28:36 -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
PipoCanaja
105fb1748e Bug - Sorting FDB table by devices (#16116)
* fix

* Fix the issue

The left join with the device was pulling in a "port" field which then caused Eloquent to think the port relationship was already loaded.

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-06-14 22:34:55 -05:00
Tony Murray
fa16c025ba Fix popup toast messages (Remove Flasher) (#16090)
* Remove flasher
Just use a bit of custom code to interface with toastr js
This is able to retain our custom theme and work properly

* Fix style issues

* Missed reference rename

* Remove test code :)

* Fix a missed rename

* Fix one more missed reference

* Fix typo
2024-06-05 08:07:42 -05:00
Tony Murray
cf422b834c Fix duplicate maps in relationship (#16081)
When a device is added to a map multiple times, it caused the map to show multiple times in the device overview.
2024-05-30 23:32:22 -05:00
Tony Murray
f0966f4d23 Widget hot refresh & worldmap cleanup (#16053)
* Iterate in javascript and separate processing

* Widget refresh/destroy events

* Remove old dom and unbind events

* fix whitespace

* Fix up bootgrid tables, they inserted a div before the first div breaking event propagation
switch to regular js function to scope variables instead of jquery

* Handle settings the same way as the normal widget

* Use standard init_map and add layer control

* May need L.Control.Locate now

* Set maxZoom for marker cluster

* Try setMaxZoom

* worldmap size 100 and resize on refresh/widget resize

* Add resize event (and throttle it a bit)

* Further worldmap cleanup

* Move most javascript to common js, will cause js errors until page is reloaded, but better in the long run
2024-05-22 21:23:39 -05:00
Tony Murray
6c6bdf26d0 Fix downtime in corner cases (#16040)
If somehow device outage wasn't recorded, fall back to last_polled (or now)
This should not happen in normal operation

fixes #15634
2024-05-19 09:46:16 -05:00