Commit Graph

352 Commits

Author SHA1 Message Date
Tony Murray
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
pepperoni-pi
4b572b9b31
Added migration file to change cpwVcID to unsigned integer (#13510) 2021-11-12 14:15:50 -06:00
Garcia MICHEL
e0443293a0
Add iDrac physical disk state (#13264)
* Add physical disk for iDrac

* Add alert rule for iDrac Physical Disk

* Add test data
2021-11-02 23:26:59 +01:00
SourceDoctor
8ea5a62b8e
Discovery on Reboot (#13422)
* Discovery on Reboot

* change default behaviour

* .
2021-10-25 13:22:23 +02:00
Stuart Henderson
48a12be4be
Don't hardcode index for Mikrotik LTE wireless statistics (#12976)
* don't hardcode index for Mikrotik LTE wireless statistics

* sync test data now that Mikrotik LTE index is no longer hardcoded

* sync tests data now that Mikrotik LTE index is no longer hardcoded

* fix whitespace

* sync test data now that Mikrotik LTE index is no longer hardcoded

* add test data for Mikrotik LtAP mini (aka RB912R-2nD)

* Re-write Routeros wireless code
It now works like most other devices

* fix style

* update baseline

* Remove station 60G rate

* use base unit of m, not km

* move interface stats name inside loop to avoid a walk when it does exist

* notification

* fix typo

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-20 20:50:59 -05:00
Mike Beattie
8d5d0b12c3
Increase length of devices_attribs.attrib_type column (#13395)
* Increase length of devices_attribs.attrib_type column

closes #13381

Signed-off-by: Mike Beattie <mike@ethernal.org>

* Update db_schema.yaml

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-20 19:50:15 -05:00
Ahmed Sajid
1f1c11ee32
Added Unpolled Devices rule to collection (#12896)
* Added Unpolled Devices rule to collection

* fixing the incorrect syntax

* Using different approach for determining if devices aren't polled

* Update alert_rules.json

* Update alert_rules.json

* Update alert_rules.json

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-19 09:43:24 -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
4685ea13cc
Port Speed degraded alert rule (#13371)
* Port Speed degraded alert rule

* don't include disabled ports either
2021-10-18 09:59:33 +02: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
b5b532fbc5
Automatically set rrdtool_version once (#13327)
* Automatically set rrdtool_version once
on first run if not already set

* In about controller too
2021-10-04 23:05:42 +02:00
Tony Murray
9d92cf19f5
Allow non-snmp modules to run when snmp disabled (#13321)
* Use the normal config to add availability module to the poller list
This also allows it to be disabled.

* Use the normal config to add availability module to the poller list
This also allows it to be disabled.
2021-10-04 13:33:40 +02:00
calvin_thefreak
fa658bba35
Added OneOS map for Oxidized (#13313)
* Added OneOS and Huawei SmartAX map for Oxidized

* Update config_definitions.json

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-03 23:45:15 -05:00
SourceDoctor
95932edc3b
hrSystem Columns have to be optional (#13316)
* hrSystem Columns have to be optional

* .

* update

* .

* .

* .

* .
2021-10-03 23:38:09 -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
SourceDoctor
f47410e426
log count of logged in users in Database (#13137)
* log count of logged in users in Database

* .

* rewrite Code

* create hrSystem Table

* .

* .

* db adjustments

* adjust db Table

* .

* adjust db Table

* table redesign

* .

* .
2021-10-02 01:58:26 +02:00
Tony Murray
6b779c3178
Cleanup config.php.default (#13297)
Comment out all lines.  This allows setting in webui and lnms config:set
2021-09-30 09:42:03 +02:00
Cathal Mooney
6bfe1555be
Modified Prometheus extension to support adding a prefix to metric names (#13272)
* Modified Prometheus extension to allow for a configurable prefix on metric names.

* Added reference in config_definitions.json and updated docs.

* Fixed whitespace in config_definitions.json.

* Added reference to prometheus.prefix in settings.php

* Defined prefix var as private in Prometheus.php
2021-09-28 19:30:28 -05:00
Tony Murray
d6fa206aa8
Fix html.device.links validation (#13269) 2021-09-23 21:28:54 +02:00
Negatifff
962e05ea6b
Add sysobjectid and hardware fields into oxidized maps (#13221)
* add sysobjectid and hostname field into oxidized maps

* add app.js
2021-09-16 19:00:06 -05:00
Orsiris de Jong
b561ebbc3f
Increase RestartSec time to a reasonable value (#13217) 2021-09-11 21:27:02 +02:00
SourceDoctor
ada7bae84c
default port group in Settings (#13175)
* default port group in Settings

* .

* wrap query with try catch

* update config schema

* change to select2

* .

* .

* inject no default port group choice

* Paginator

* .
2021-09-03 15:58:09 +02:00
Jellyfrog
4f50c3c05d
Rename nobulk -> snmp_bulk (#13098) 2021-09-01 19:01:41 -05:00
Tony Murray
e2822d7eaa
Increase config value length limit (#13178)
Up to 16MB of text now
2021-09-01 14:15:25 +02:00
Tony Murray
79de1ca28e
Select dynamic fixes (#13187)
* Fix select-dynamic changes
require validation for select-dynamic
allow 0 in config:set

* fix zero_or_exists

* validate, not validation :D
2021-08-31 20:43:02 +02:00
Tony Murray
d646562e4e
Dynamic Select setting (#13179)
* Dynamic Select setting
embeds select2 and uses ajax to call to backend for options
poller-group included

* fix validation a bit

* fix typehint

* move minProperties into the select schema

* Change dashboard-select to select-dynamic
Love deleting code

* Change dashboard-select to select-dynamic
Love deleting code
wire up a few select2 options

* fix whitespace

* Not a model, just an object

* Suggestion from @SourceDoctor autocomplete values of select and select-dynamic

Got a little creative with InternalHttpRequest...
2021-08-28 06:46:53 -05:00
Tony Murray
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
Tony Murray
676bb8c5a7
Change default graph view to zoom in on traffic. (#13173)
People like to see their tiny utilization.
2021-08-25 06:33:17 -05:00
SourceDoctor
1544eadd37
default port_group for new ports (#13166)
* default port_group for new ports

* .

* adding Docs, default Value, change keyname

* .

* Update Configuration.md

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-08-24 20:28:18 +02:00
Tony Murray
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
Tony Murray
dc1b5bd2d7
Update configuration docs to use lnms config:set (#13157)
* Update configuration docs to use lnms config:set
don't show slashes input
still need to test them all

* fixup broken commands
os array type a little broken

* bash

* fix lnms config:set os append

* enable os append test
(and small correction)

* fix whitespace
2021-08-23 19:07:26 -05:00
Tony Murray
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
M. Toups
1082373145
add two indices to syslog table, addresses librenms/librenms#12855 (#13105) 2021-08-05 10:15:15 +02:00
Bennet Gallein
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
Sean
747506172a
Update cleanup options document (#13026)
- Add missed units for config definition
  - And remove units from translate strings
- Change values in the document to the actual default value
- Sort configs in the document by order
- Replace redundant text with "please refer to"
- Add instruction to use Web GUI setting
2021-07-25 09:50:25 +02:00
rhinoau
ccb267bb4d
Two-factor UI config and status display (#13012)
* two-factor UI config and status display additions

* force test re-run

* removal of blade foreach via keyBy

* remove where clause against all()

* attempt where filtering with keyBy

* use @config and getPref in blade

* another forgotten @config changed

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2021-07-09 21:36:08 +02:00
martinberg
131f5c7e87
Option to filter Oxidized groups (#12966)
* Add support for Liebert humidity setpoint and UPS powerfactor

* Option to ignore groups so they are not sent to Oxidized

* Revert "Add support for Liebert humidity setpoint and UPS powerfactor"

This reverts commit c338528aba.

* Updated docs

* Added ignore_groups option

* Added descriptions and updated translations

* Update settings.php

* Fixed typo

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-06-28 12:53:16 +02:00
Tony Murray
50dd6c1685
Fix ldap/ad group webui settings (#12967)
* Fix LDAP groups UI WIP

* fix up ldap and ad group settings

* production compiled assets
2021-06-19 16:16:02 +02:00
djamp42
fb36f0bc60
Create Laravel Sessions Table (#12962)
* create laravel sessions table

* fixing last commit
2021-06-18 23:37:50 -05:00
geg347
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
ottorei
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 4b3cf8127c.

* 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
Thom Seddon
1066ee404a
Update device_component_down_junos macro (#12898)
Detect state changes in sensors in both jnxFruState and jnxFruTable
2021-06-09 09:47:59 +02:00
paulierco
4ee1abb1d4
Alcatel-Lucent Aos7 sensors nobulk (#12935)
* first commit

* fix style

* fix style

* fix style

* fix style

* fix style

* fix style

* fix style

* change local_port_id

* fix style

* fix style

* fix style

* first commit

* fid disc

* tests?

* fix "nobulk" test-check

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2021-06-09 00:39:21 +02:00
Tony Murray
143765ced8
Add 'nobulk' setting in sensors yaml (#12833)
* nobulk setting in sensors yaml
* silly python
2021-05-30 00:08:20 +02:00
Tony Murray
2d752925b0
Oxidized improvements (#12773)
* Oxidized API cleanup
Import more settings to the UI
use lnms config:set

* validate os and type exist

* map settings WIP

* oops

* editing working.  Needed to add new property to pass update state to child

* implement deleting and handle text overflow a little better.

* Update app/Models/Device.php

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

* Update app/Models/Device.php

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

* revert change

* fix style

* add return

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-05-11 08:08:59 -05:00
PipoCanaja
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
martinberg
33c7151763
Additional data collection for GAIA (#12713)
* Added support for GAIA logserver/firewall lograte, raid state and type, logserver state and testdata, firewall packet stats and connections stats

* Fixed typo

* Added testdata

* Fixed typo

* Changed some faulty strings to integers

* Added more sensors. License, HA states and Updates checks

* Added testdata

* Using snmp_get_multi. Cleaner code

* Fix rrd function usage

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-04-28 05:19:17 -05:00
SourceDoctor
ea75435990
Filter Ports out by Interface Type (#12590)
* Filter Ports +out by Interface Type

* style fix

* style fix

* .

* .

* change code

* .

* move filter to main filter function

* reduce to bad_iftype in settings
2021-04-27 21:43:52 +02:00
Tony Murray
027ff0ebee
Revert #12321 (#12786)
Revert #12321
You can't import raw SQL like that.
2021-04-23 08:17:51 +02:00
PipoCanaja
07900ccc08
Discovery - Refactor num_oid computing (#12576)
* Test the num_oid generation

* Refactor num_oid discovery

* cnt

* Cache the value to avoid unnecessary snmptranslate

* desc of function

* typo

* Negative caching as well

* Negative caching

* style

* Str::before

* Str::before

* Str::before

* Fix key,  and model Devices

* types

* types

* doc update

* re-run tests

* Use Cache class

* Simplify caching and do it into oidToNumeric

* Simplify caching and do it into oidToNumeric

* style

* Extend to 3 hours

* and not ->cache_time

* force re-run tests

* only one OID for num_oid test

* rerun tests

* typo in MD

* restore

* Exemple

* Exemple

* light change

* test

* test

* test

* back to PR

* phpstan + suggestions from Tony

* fix firebrick num_oid

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-04-22 14:40:45 -05:00