21010 Commits

Author SHA1 Message Date
ad6bbee24e Improve device ports loading speed (#16500)
* Improve device ports loading speed
Add port->vlans relationship index as discovered missing here:
https://community.librenms.org/t/device-ports-page-delay-loading-due-to-slow-db-query/26207

* update db_schema.yaml
2024-10-06 21:43:34 +01:00
4dd369294e Fix Discord Transport when Fields to Embed Left Empty (#16439)
* Add PHPUnit test for LibreNMS Discord transport

* Style

* Adding comments for methods and others.

* Refactor title, color, embedFields and footer to its own methods.
Renaming and comments.

* testDiscordDelivery includes img and html tags.

* testDiscordDelivery tests INI options

* renamed getter methods for clarity.
Refactor to includeINIFields() method.

* refactor attribute $discord_message;

* Discord.php: Bugfix "Error: Invalid Field" when discord-embed-fields is left empty.
Discord.php: Removed DEFAULT_EMBEDS (defaults are not working with text fields).

DiscordTest.php: transport config tests improved.

* Transport.md: Documented options, images and ebed fields. Better examples.

* typos

* styleCI and PHPStan

* StyleCI

* StyleCI
2024-10-06 21:40:08 +01:00
d0d7b0cf09 VLANs global page, missing changes (#16484)
I had some additional changes that got missed in the main merge.
They are included here.

fix #16472
2024-10-06 00:13:30 -05:00
8c6964adf9 Fixed sensor discovery issue for serverscheck os (#16499) 2024-10-06 00:04:38 -05:00
205c104f8e Updated Serverscheck temp sensor discovery (#16488) 2024-10-05 00:43:50 +02:00
a29b9b8ecc Snmpsim setup: fix python exe name (#16492)
call python3 like every other script
2024-10-05 00:41:04 +02:00
6c53701f14 Stop services from being checked when device is offline and service does not have an IP set (#16497) 2024-10-05 00:36:33 +02:00
031a7df9cb Add temperature sensors for RoomAlert3S (#16496) 2024-10-04 22:44:56 +02:00
45485e2955 Add missing graphs for the poudriere app page (#16495) 2024-10-04 14:18:43 +01:00
76050e3b3c Update docs for Opensearch for the newest version of the extend (#16482) 2024-10-03 08:12:22 +01:00
aa58140fef UI: Dark theme improvements (aesthetics and readability) (#16486)
* content centered in minigraph-div.
Removed white background to improve readability.

* comment removed

* Improved visibility of all ports in dark mode by removing bright grey background.

* Improved border color for dark and light theme.
2024-10-03 09:00:03 +02:00
f649f25892 Add circular loop detection to MaxDepth (#15579)
* Add circular loop detection to MaxDepth

* Formatting fixes

* Remove controversial bit

* Remove the recursion on the observer code updating max depth of child devices

* Update the fast ping code to keep track of device dependencies instead of using max_depth

* Style fixes

* Add circular loop detection to MaxDepth

* Formatting fixes

* Remove controversial bit

* Update the fast ping code to keep track of device dependencies instead of using max_depth

* Style fixes

* Fix the device list

* Remove some more old lines from the ping job

* Filter parents to those that have ping enabled to ensure child devices are always trigered for alerts

* Formatting fixes

* Added code to the ping check to order the hostnames so we try to ping parent devices before children

* Formatting fixes

* Add some types

* Refine host ordering code

* Fix output and simplify lnms poller:ping command

* a bit more cleanup

* Formatting fixes

* Fixed up type for waiting on list

* Formatting fix

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-10-02 21:24:22 -05:00
32f9effd8e Device overview: direct transceiver link (#16485) 2024-10-03 00:28:09 +02:00
e187eeb753 Avoid a redirect loop if we have a login error (#16366)
* Avoid a redirect loop if we have a toasts (login error)

* 1st try to a new approach

* Fix extra return

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-10-02 14:46:36 -05:00
e7864f39a4 Custom map - Make device text and links dark red when the connected device is offline (#16477)
* Make device text and links dark red when the connected device is offline

* Do not change the text colour if the request came from the editor
2024-10-02 08:12:19 +01:00
d4bd71a57b webui - fix exception in Oxidized page date handling (#16475)
* fix exception in date handling

* style
2024-10-01 23:40:46 +01:00
ba6aa2a687 Update eltek-webpower to add batteryQuality (#16188)
* Update eltek-webpower.yaml

Added the BatteryQuality value. Shows the battery quality percentage of the latest battery test.

* Update eltek-webpower.yaml

fixed the json format error

* Update eltek-webpower.json

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-10-01 23:00:06 +01:00
c7e0a14489 Avoid DivisionByZeroError (#16464)
* Avoid DivisionByZeroError

* Use match for entPhySensorPrecision

* Fix style

* Add zepto

* Update match condition
2024-10-01 10:51:40 -05:00
2531c8d314 FS centec switch transceiver temperature not showing (#16469)
Fix transceiver temperature discovery so it shows up with the transceiver
2024-10-01 01:39:15 +02:00
2726787f94 OcNOS transceiver tx not visible (#16468)
* OcNOS transceiver tx not visible

* add test data

* isset already checked
2024-09-30 19:32:24 +02:00
bb944b9a06 Improve OcNOS port breakout detection (#16466)
* Improve OcNOS port breakout detection
Old code required a transceiver to exist in one of the breakout ports

* Allow functionality without prots module running
2024-09-30 10:58:21 -05:00
dbfb0a6535 OcNOS transceiver temperature display fix (#16460)
* OcNOS transceiver temperature display fix
Temperatures were not displayed in the transceiver area.  Update the group to fix that issue.

* Update test data
2024-09-29 19:18:17 -05:00
615a5ab92c Fix popup javascript (#16459)
Breaking out the code to a script tab seems to have interacted poorly with some code.
Put it in librenms.js for now to avoid issues.
24.9.1
2024-09-29 18:40:22 -05:00
cf897d278e Bump version to 24.9.0 24.9.0 2024-09-29 16:47:37 -05:00
d2720d9d2b Changelog for 24.9.0 2024-09-29 16:47:36 -05:00
568ee86eb5 Fix double escaping sysname in device dependencies (#16458)
I double checked that we aren't missing any escapes elsewhere on sysname and it looks good.
2024-09-29 16:34:12 -05:00
763156ac6a Transceivers - Extend to more Cisco Containers (#16456)
* Extend to more Cisco Containers

* more
2024-09-29 16:33:57 -05:00
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
8d2bf6ceb0 Format Oxidized update time (#16455)
* Format Oxidized update time 
Format Oxidized update time to local timezone (instead of UTC)

* extra space removal
* and one more
---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2024-09-29 16:00:08 +02:00
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
36b38a50cc Fix device dependencies xss (#16447)
https://github.com/librenms/librenms/security/advisories/GHSA-rwwc-2v8q-gc9v

Create html programmatically to prevent printing user input out.
2024-09-29 14:06:52 +01:00
f259edc19b Fix alert template creation xss (#16446)
https://github.com/librenms/librenms/security/advisories/GHSA-gcgp-q2jq-fw52
2024-09-29 14:02:25 +01:00
6af12dbc45 Fix potential xss in edit alert transport (#16445)
Would need to be in php code, so not user editable
2024-09-29 14:00:36 +01:00
ee1afba003 Fix Alert transport details xss (#16444)
* Fix stored XSS in alert transport details

https://github.com/librenms/librenms/security/advisories/GHSA-7f84-28qh-9486

* Fix password double encode
2024-09-29 13:45:16 +01:00
7620d220e4 Fix alert rule name stored XSS (#16443)
https://github.com/librenms/librenms/security/advisories/GHSA-7f84-28qh-9486
2024-09-29 13:42:21 +01:00
0643bb5574 Use 2 decimal places for bps numbers (#16451) 2024-09-29 14:41:38 +02:00
8d793fdda8 Fix default config for custom map height and width (#16449) 2024-09-29 09:44:44 +02:00
d3b51560a8 Fix device group stored XSS (#16442)
https://github.com/librenms/librenms/security/advisories/GHSA-fc38-2254-48g7
2024-09-28 19:37:46 +01:00
ce89f5b410 APC - runtime discovery, apply divisor (#16441)
* fix for discovery

* snmpsim for sensors after #16435

* and tests

* fix RuntimeBattery
2024-09-28 11:05:44 -05:00
43df7f3810 Updated APC sensors to include upsAdvTestDiagnosticsResults state (#16435) 2024-09-28 00:18:30 +02:00
a6c195ee90 LLDP Discovery - LldpRemPortId convert to string when in HEX (#16438)
* Update discovery-protocols.inc.php

When using the LLDP-V2-MIB, the device may reply with lldpV2RemPortId as hexadecimal. To convert it to a string, this update checks if the lldpV2RemPortIdSubtype is '5' = "interfaceName(5)"; if so, the code removes the character ":" from the value of lldpV2RemPortId and tests if it is hexadecimal. If the test is positive, it translates it into a string.

* Update discovery-protocols.inc.php
Added lines 342 to 345 to convert the lldpRemPortId when is hex and lldpRemPortIdSutype is 5.

* Update discovery-protocols.inc.php
Importing lib StringHelpers.

* tabs + tests PANOS

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2024-09-26 20:39:25 +02:00
c4ca7acc4d Improve reset to default button on settings page (#16436) 2024-09-25 23:17:42 -05:00
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
2ffe314dc7 Fix custom sensors logic not being loaded in some cases (#16433)
https://community.librenms.org/t/arista-eos-dbm-power-values-are-not-calculated/23848
2024-09-25 16:07:04 +01:00
df84362804 Fix AdvaOSA OS naming (#16425)
* fix OS naming, FSP150CM exists but is not at all the same

* fix tests

* fix os underscore
2024-09-25 14:53:22 +02:00
b7bc6dec10 Stop showing bills that do not exist (#16423)
* Stop showing bills that do not exist

* Updated to a more efficient query

* Moved to use 404 page
2024-09-25 14:45:57 +02:00
9cddd7fd21 Fixed the issues with JetStream lldp discovery (#16414)
* Fixed the issues with JetStream lldp discovery

* Added is_array() check
2024-09-25 14:43:24 +02:00
52c96a6e79 Adva 150CC - Exclude nemihubshelf (150CM) (#16426)
The SysObject ADVA list is messy. "nemihubshelf" device is a 150CM, and crashes when discovered and polled as a 150CC. This PR excludes them from being discovered wrongly.
2024-09-25 12:47:09 +02:00
d23ecf551d Fixed normal users UI widget AlertLog Stats (#16363)
* Fix normal users UI widget AlertLog Stats

* Add phpstan-ignore
2024-09-24 22:18:55 +01:00
c250ffa8e9 Fix smokeping generator for TCP transport (#16421) 2024-09-24 08:12:23 +02:00