276 Commits

Author SHA1 Message Date
790c4b3402 Configurable device display name (#13528)
* Configurable device display name
You can just set the display name in device settings.

It also accepts simple template format with  the variables: hostname, sysName, sysName_fallback, ip

Default controlled by device_display_default, (set from old force_hostname_to_sysname and force_ip_to_sysname settings

* remove second argument to format_hostname()

* Style fixes

* Update schema

* update phpstan baseline

* Improved settings strings (and add for translation)
2021-11-18 15:46:22 -06:00
b6240254b4 Billing fix a couple divide by zero errors (#13517)
* Billing fix a couple divide by zero errors
In probably an ocean.

* add missing space
2021-11-15 10:31:52 +01:00
0862496e26 Fix api transport mult-line parsing (#13469)
* API transport fix parsing
parse templates after parsing user options, not before

* API transport tests

* fix style and lint

* remove accidental item

* fix more type issues
2021-11-03 13:37:57 -05:00
5900edbf16 PHP-Flasher for toast messages (#13401)
* PHP-Flasher for toast messages
Allows customized template
removes dependency on unmaintained package using dev stability
no solution for javascript toasts yet

Use DI in places it makes sense

allow html in flashes

Use "template.librenms" as a default notification style

merge toast containers
toastr needs to be second because it will find the containr made by flasher, but the inverse is not true

upgrade php-flasher to add custom options and persistent notifications

Add dark theme

* update composer.lock
2021-10-29 09:13:56 -05:00
bc8efedc83 Show single quotes correcting for device configs (#13360)
* Added ENT_HTML5 decoding for device configs
Previously single quote/apostrophes weren't being decoded correctly from ', leading to configs being misrepresented in LibreNMS. ENT_HTML5 allows for proper decoding.

* Change to less risky flag

* Update showconfig.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-20 23:20:57 -05:00
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
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
fafb5a62c2 Fix port links (#13296)
yes is not a valid boolean
2021-09-30 09:41:12 +02:00
66dddbaa66 SNMP Capabilities (#13289)
* SNMP Capabilities
Allow all available auth algorithms to be set in global settings
cleanup other usages

* fix style
2021-09-28 18:35:59 -05:00
dda46447c3 Add ORDER BY to the ports query when showing the ports list on device overview (#13276) 2021-09-27 10:34:55 +02:00
1084bd6d1a Convert all ports backend to Laravel style ajax table (#13184)
* port ports to Laravel style ajax table

* fix style

* cleanups+fixes

* correct column name

* correct port formatter

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

* always filter deleted

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-09-19 18:26:33 -05:00
f3fa2ce1e2 Fix port minigraph (#13240)
missing div close
2021-09-14 11:36:21 -05:00
258505ed44 Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
26b95c0ccc Apply fixes from StyleCI (#13208) 2021-09-08 23:35:56 +02:00
94ee737f3d Allow device actions to appear in device list and improve docs (#13177)
* Improve Device menu links and documentation

* device list actions functionality

* phpstan :/
2021-08-27 22:48:57 -05:00
5a1988a4c9 Fix port zoom traffic, remove question mark accidentally left in (#13172) 2021-08-24 22:43:06 -05:00
8e409ba051 Rewrite ISIS Adjacency discovery/polling (#13155)
* Rewrite ISIS Adjacency discovery/polling
hopefully much faster now, do most work in discovery and just check up/down in poller.

* unused variable

* Implement option for OS override

* fix an incorrect typehint

* test data

* work around stupid migration name

* update schema

* better handling for the on-demand discovery

* more detailed phpdoc

* fix when adjacency is not found

* don't clear out data when adjacency goes away

* Adjust nullable fields

* fixes

* fix class name

* correct migration

* fix bug causing adjacency data to always be blank

* port popups for port links

* isisISAdjState does not need to be nullable

* remove extra space

* default off

* If port is missing return $text

* update schema

* Cleanup old components

* correc copy paste error
2021-08-23 21:19:55 -05:00
d74bb37971 Show port speed on port graphs, optionally set scale (#11858)
* Show ifSpeed on Graph
Drop ifHighSpeed, we really don't want to store that value.

* safer truth check

* Allow global setting and per-graph variable

* match surrounding case

* Style fixes

* Remove old function usage

* update schema

* remove some old usages

* cleanup more ifHighSpeed references

* update test data to remove ifHighSpeed

* fix down migration

* Add button on graph page
Change default
tweak wording
2021-08-23 06:47:44 -05:00
8bb6eec732 Dark mode improvements (#13141)
* Changes to dark theme.
- Tables with white background now has dark background.
- Listbox in searchbar now has dark background.

* Minor change to internal css to modify all tables without 'table' class applied. (view screenshot)

* -Transparency on mini graphs on ports

* bootgrid-table td.no-results now has dark background

* Changes suggested by @Talkabout
2021-08-21 20:06:13 +02:00
1fcf58a7a4 Fix layout width (#13115)
* Fix layout width

* Update services.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-08-21 00:25:13 -05:00
fcb1f2d6fa Revert to port description on port_link in Ports-Type pages after #13143 (#13149)
* Add Port description first to Ports-Type pages
Consistent with Customers pages.
For a port to be in a Ports-Type page it needs a parsed description
(Transit, Peering, Core, Custom, ...)

* make styleci.io happy

* Revert back to display Description like b4 #13143
2021-08-19 18:14:04 -05:00
f1dc4435e3 Cleanup Port hover minigraph description when using "Interface Description Parsing" (#13143)
* Cleanup Port hover minigraph description.
Use port_descr_descr if exists or ifDescr.
Use the same generate_port_link() in:
- Devices - Ports
- Ports - All/Errored/Ignored
- Ports - "Types"

* Port-Customers, using Ajax Controller,  Util/Url

* make https://styleci.io/ check happy
2021-08-18 13:02:01 +02:00
574eb1f0f0 Billing: add peak in and out (#13006)
* feat(api): added max in/out per bill_history period

* chore(Docs): updated docs to include in/out max values

* chore(formatting): style-ci

* chore(db): update db-schema

* fix(db): reverted wrong changes in schema

* fix: wrong table name in migration

* feat(billing-history-frontend): added max in/out values to frontend bill-history

* chore: renamed to peak instead of min/max
2021-07-26 10:37:52 -05:00
342900ee53 Poll current connections for F5 ltm (#12968)
* Poll current connections for F5 ltm

* Changed polling to a separate RRD-file

* Reverted old changes

* Remove stats not needed in this file

* Fixed typos and cleanup

* Updated copyright
2021-07-22 01:07:30 +02:00
ea8a5ba555 More sensor data on inventory page (#13057)
* new display

* style
2021-07-21 17:08:24 +02:00
f76cfb4374 Revert "Refractor health (#13022)" (#13029)
This reverts commit 16f5985f009ca55efcd4c085e6255a68d176f4ff.
2021-07-11 14:08:14 +02:00
16f5985f00 Refractor health (#13022)
* Add power consumed

* Revert "Add power consumed"

This reverts commit 424554ac04bd340de2fd962cb6808045024ef783.

* Refractor Device health sensors

* fix style

* fit style

* fix style
2021-07-10 14:31:43 +02:00
63b9896ac4 Leave it to generate_device_link for sysName/hostName/IP (#13000)
* avoid forcing displayed name, so generate_device_link decides according to LibreNMS config

* same fix for BGP display

* other generate_device_link occurences

* more

* more
2021-07-04 20:58:05 +02:00
7e2ce6179a Added VRP ICMP SLA (NQA in huawei naming) support (#12973)
* added VRP icmpAppl SLA (NQA in huawei naming) support

* style

* style

* remove unnecessary values in RRD

* enable SLA for VRP devices

* tests
2021-07-03 15:16:38 +02:00
6f7d0b2027 Fix typo in filename (#12996)
Was introduced 10 years ago by commit 63b25bb2f.
This page seems not used in any code but accessible by the URL:
https://libre.nms/device/device=1/tab=graphs/group=ipSytemStats/
2021-07-01 16:21:56 +02:00
0489382768 Fix "Sub-directory Support" in small steps (#12910)
* Fix "Sub-directory Support" in small steps

This fixes small parts from #12205 part 3
fixes #12205

Even someone knows a better way, for example to fix js with the url() function. In my case it works.

* Update oxidized.inc.php

* Update oxidized.inc.php

* Update oxidized.inc.php

* Update oxidized.inc.php

* Update oxidized.inc.php

* Update oxidized.inc.php

* Update oxidized.inc.php
2021-06-15 08:11:18 -05:00
672fe61b5e New module add juniper rpm support + reimplementation of cisco-sla module (#12799)
* Definition of a new SLA module to migrate from old cisco-sla and support other devices : Juniper RPM and Huawei

* Change wrong description name of module SLA

* Re implementing Juniper RPM support in a new module Slas (Cisco SLA to be added)

* Added Graphs for Juniper RPM types

* Tried to make discover and poller generic : to handle Cisco SLA and Juniper RPM and others

* Reimplementing Cisco SLA in the new Sla module and adding condition to manage both SLA and RPM

* Definition of a new SLA module to migrate from old cisco-sla and support other devices : Juniper RPM and Huawei

* Change wrong description name of module SLA

* Re implementing Juniper RPM support in a new module Slas (Cisco SLA to be added)

* Added Graphs for Juniper RPM types

* Tried to make discover and poller generic : to handle Cisco SLA and Juniper RPM and others

* Reimplementing Cisco SLA in the new Sla module and adding condition to manage both SLA and RPM

* Fix some error due to Elequent object replacing SQL request

* Fixing indentation

* Fixed continuous integrations errors

* Fixed continuous integrations errors part 2

* Fixed continuous integrations errors part 3 : missing last new lines

* Fixed PHP Static Analysis checks

* Fixed continuous integrations errors part 4

* Fixed PHP Static Analysis checks part 2

* Trying to convert existing cisco-sla to new slas one

* Trying to add slas to fix test failure (I am pretty sure this is not enough but I don't know how to do it)

* Switching old cisco-sla module declaration to new slas module in concerned OS files

* Fixing wrong sla module name instead of slas in concerned OS files

* Fixing wrong module name sla changed to slas (as is it in power-supplies reimplementation)

* Fixing some warnings shown in the Inspection CI but skipping some that are already present

* Adding tests files from virtual Juniper VMX and adding slas modules in /tests/module_tables

* Adding missing SNMP data files

* Module Slas modifications to use inheritance

* Fix CI errors

* Fix CI errors part 2

* Fix CI errors part 3

* Fixing no value on RTT graphs

* Fixing only last SLA to be polled : problem with loops

* Fix CI errors part 4

* Optimizing a little the Juniper RPM poller part

I wanted to query only the required values but it is complicated to query a specific OID
as Cisco-SLA does because the owner and tag are hardcoded in ASCII decimal with strange values.
So I use the function snmp_walk which gets the whole OID values in text.
And I index the Juniper MIB (because we want multiple values). But I changed the DISMAN MIB
requests to get only what we want.

* Fix CI errors

* Fix CI errors part 2

* Fix CI errors part 3

* Fixing PHP Static Analysis error 2/4

* Fix CI errors

* Implementing Interfaces to fix some errors that occurs with inheritance

* Adding missing Interfaces files

* Moving generic Sla discovery code into Junos Class

* Fix CI errors

* Fix CI errors part 2

* Fixing missing definition of SlaDiscovery in Cisco shared Class

* Fixing missing import for Illuminate\Database\Eloquent\Collection

* Fix CI errors part 3

* Fix PHP Static Analysis error

* change type strings to use translations instead of config

* IOSXR test data

* remove test data garbage

* simplify discovery

* Fix style

* Updating test files to adapt mock sla_nr ID starting from 0 and not 1 : CI tests should pass

* clean up polling
add rtt field in the db
cisco icmpjitter seems to have confused a lot of values

* rtt on discovery

* use crc32 for consistent sla_nr values

* revert snmprec

* Fix style

* correct schema

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-06-11 13:48:33 -05:00
69397ea70f ISIS-adjacency polling support (#12461)
* init

* Add adjacency polling support

* Format messages

* Fix prints

* Apply fixes from StyleCI

* Fix schema

* Schema fix

* Alert rule example

* Remove display format

* Change option order

* Add test data

* Add test data

* Test data

* Review fixes

* Remove duplicate MIB-file

* Add cleanup

* Fix

* Print fix

* Remove extra cleanup

* Revert "Remove duplicate MIB-file"

This reverts commit 4b3cf8127c2473e9919a56a051d4044e2e0f31aa.

* Remove unneeded MIB-files

* Add check for empty array

* Apply fixes from StyleCI

* Review fixes

* StyleCI

* StyleCI

* Apply fixes from StyleCI

* typo

* Update function calls on pages

* Linting fixes

* Apply fixes from StyleCI

* Discovery module

* Add discovery module

* Apply fixes from StyleCI

* Update example alert rule

Co-authored-by: ottorei <ottorei@users.noreply.github.com>
Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2021-06-10 19:42:34 -05:00
96479ab9b9 Filter unwanted data in Routes Ajax reply (#12847)
* filter unwanted data in AJAX reply

filter unwanted data in AJAX reply

filter unwanted data in AJAX reply

filter unwanted data in AJAX reply

cleaner fix now

* add tooltips, except when text contains 'overlib' calls

* readability

DestType lost in the game

DestType lost in the game
2021-05-25 15:39:20 +02:00
cb739fa2ce Fix port down alert toggle (#12884)
* Fix port down alert toggle

* Further JS fixes.
2021-05-18 07:42:15 -05:00
3d62be5003 Jquery upgrade (#12802)
* WIP js upgrades

* trying 3.0

* Event handler changes

* fix alert rule collection loading

* blur fix

* jQuery 3.5
homescreen no warnings

* actually 3.6 include js

* Update bootstrap to 3.4.1

* missed file

* Update and test install process

* cleanup

* attempt to version js files that were updated.
2021-05-11 08:08:06 -05:00
fff8b8e832 Collect OUI Database and do OUI lookups (#12842)
* first draft

refresh time

refresh time

* return codes

style

style

* presentation

* Exception details

more

fix

fix

* add tooltips

fixes for dns display

* create WebUI config option

languages

* refresh data every 7 to 11 days, keep it 15 days max

* 'Ports' and 'Port' ARP table

* Stp page support

style

style

* fix dnsname column finding when vendor is added/removed

fix dnsname column finding when vendor is added/removed

* nac vendor column

nac

* filter fields to reduce size of AJAX reply

filter fields to reduce size of AJAX reply

* fix typo on dns column detection

* default enabled
2021-05-10 14:56:48 -05:00
e40e1069d5 Fixes to Export CSV (#12830)
* fixes to port CSV Export

Signed-off-by: Patrik Forsberg <git@paddyonline.net>

* fix code-style issues

Signed-off-by: Patrik Forsberg <git@paddyonline.net>

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-05-04 21:51:19 -05:00
bb39b4ad83 Rrd graph optimizations (#12806)
* RRD Graph optimization
Do not use temporary files to generate graphs
Don't start up a process to pipe commands to, just run the command
Error image improvements

* fix style issues

* run the rrdgraph command in the rrd directory
2021-05-03 09:48:15 -05:00
76803c2acc Make applications work with rrdcached (#12807) 2021-04-28 22:00:32 -05:00
7de808a4e8 Revert "RRD Graph optimization (#12735)" (#12805)
This reverts commit 2833d935e0a8734b7f304b8cb652e27a7597b20f.
2021-04-28 09:07:31 -05:00
2833d935e0 RRD Graph optimization (#12735)
* RRD Graph optimization
Do not use temporary files to generate graphs
Don't start up a process to pipe commands to, just run the command
Error image improvements

* fix style issues
2021-04-28 05:28:07 -05:00
eab63ea220 webui - Services bootstrap enable + status (#12736)
* Services bootstrap enable + status

* style

* copyright

* generic create-service.inc.php to allow updates of some fields only

* generic create-service.inc.php to allow updates of some fields only
2021-04-22 19:13:39 +02:00
97d20dd09a Make docker app work with rrdcached (#12746)
* docker app rrdcached

* offset fix and formatting fix

* more fixes

* Update Rrd.php

* Update Rrd.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-04-21 07:40:48 -05:00
7c157c1577 Fix auth and crypto select options (#12769)
* Fix auth and crypto select options

Output no string vs the value of $snmpv3_sha2 and $snmpv3_aes256 as this would result in <option selected1> resulting in the proper option not being selected.

* Fix style issue
2021-04-20 23:26:01 +02:00
3a29198238 Fix mempool tags (#12745)
Does not affect rrd, only external tsdb
2021-04-13 21:33:07 +02:00
0e79413a5b escape user editable field (#12739) 2021-04-11 15:08:41 +02:00
6d40871395 Fix mempools divide by 0 (#12734) 2021-04-09 11:10:02 +02:00
40517f695a Cisco AES256 support (#12717)
* Add support for net-snmp AES-256-C option

* Add AES-256-C to tests and config definition
2021-04-06 22:07:41 -05:00
4b9e480118 Define Port Groups (#12402)
* Define Port Groups

* .

* .

* .

* API Calls

* .

* .

* .

* minor changes

* .

* update forms

* remove link

* .

* change column settings

* change migration

* change update position

* db migration fix

* .

* .

* .

* add missing doc reference

* update test data

* update test data

* update test data

* .

* .

* .

* .

* .

* .

* .

* .

* port group association in seperate table

* .

* .

* show all found groups on port

* select multiple Portgroups per Port

* change on migration file

* change query to eloquent

* Code changes

* move port group menu to ports main menu

* port group update to eloquent

* .

* .

* update to new setting way

* add missing merge parameter

* Use select2 and port some things to Laravel
some fixes, hopefully no new added bugs

* schema

* don't use on update restrict unfortunately

* remove unused import and revert changes

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-04-06 17:25:08 -05:00