Commit Graph

18797 Commits

Author SHA1 Message Date
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
Maikel de Boer
f28802bb2b Ericsson TN - Wireless MSE (#13328)
* Initial commit

* Removed unused function

* fixed style

* fixed style

* fixed test data

* Initial commit

* end of the day commit

* finish + test data

* Delete ericsson-tn_ericsson-tn.snmprec

* Added wireless MSE

* Delete ciena-saos.yaml

* Delete NORTEL-MIB

* Delete ciena-saos.yaml

* Delete NORTEL-OPTICAL-GENERIC-MIB

* Delete ciena-saos_saos.snmprec

* Delete ciena-saos_saos.json

* Delete NORTEL-OPTICAL-PM-MIB

* fixed style

* fixe
2021-10-06 23:37:10 +02:00
Tony Murray
e33ec8b390 Oxidized doc update, links and ignore groups (#13341) 2021-10-06 19:30:39 +02:00
Maikel de Boer
7883218cff Ciena 6500 (#13324)
* Initial commit

* Removed unused function

* fixed style

* fixed style

* fixed test data

* Initial commit

* end of the day commit

* finish + test data

* Delete ericsson-tn_ericsson-tn.snmprec
2021-10-06 07:50:16 -05:00
ottorei
114d1403e2 Update Dispatcher-Service.md (#13339) 2021-10-06 07:30:42 -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
dependabot[bot]
83f847d92d Bump composer/composer from 2.1.8 to 2.1.9 (#13336)
Bumps [composer/composer](https://github.com/composer/composer) from 2.1.8 to 2.1.9.
- [Release notes](https://github.com/composer/composer/releases)
- [Changelog](https://github.com/composer/composer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/composer/composer/compare/2.1.8...2.1.9)

---
updated-dependencies:
- dependency-name: composer/composer
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-05 23:06:44 +02:00
SourceDoctor
6288cb6edf alert detail fix (#13335) 2021-10-05 14:35:51 -05:00
Tony Murray
7fe8ddfb24 don't leak stderr (#13332)
nullable
2021-10-05 09:27:21 +02: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
681508f45b Fix device query when last_polled_timetaken is null (#13331)
Caused by recent bug
2021-10-04 16:04:44 -05:00
Nash Kaminski
3a0d4e60f1 Rename config var auth_redirect_handler -> auth_logout_handler (#13329)
This change addresses a typo introduced in the refactor of
d4325a2e9e
which makes the variable name inconsistent with the documentation.
2021-10-04 22:15:06 +02:00
Tony Murray
878e95ed40 restore accidentally removed code (#13330) 2021-10-04 14:34:35 -05: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
Tony Murray
d443d2b4b1 Use built in trusted proxy functionality (#13318)
* Use built in trusted proxy functionality
instead of fideloper/proxy

* my favorite style rule...

* hello braindead ide

* restore space
2021-10-03 14:13:20 -05:00
Tony Murray
d0f90bdf24 Send security researchers to Discord (#13319)
* Send security researchers to discord
The email is non-functioning

* fix brain-dead ide
2021-10-03 18:20:26 +02:00
Tony Murray
d022bd11c6 Restore trusted proxy package (#13317) 2021-10-03 09:56:58 -05:00
SourceDoctor
8e1b9e2989 Show Detail by default Option on Alert Widget (#13309)
* Show Detail by default on Alert Widget

* .

* change to row count length limitation

* .

* .
2021-10-03 01:12:18 +02:00
Jellyfrog
9ef94323f5 Update dependencies (#13310)
* Bump composer dependencies

  - Upgrading brick/math (0.9.2 => 0.9.3)
  - Upgrading composer/ca-bundle (1.2.10 => 1.2.11)
  - Upgrading composer/composer (2.1.3 => 2.1.8)
  - Upgrading composer/xdebug-handler (2.0.1 => 2.0.2)
  - Upgrading dapphp/radius (2.5.5 => 2.5.6)
  - Upgrading doctrine/annotations (1.13.1 => 1.13.2)
  - Upgrading doctrine/cache (2.0.3 => 2.1.1)
  - Upgrading doctrine/dbal (2.13.2 => 2.13.3)
  - Upgrading facade/flare-client-php (1.8.1 => 1.9.1)
  - Upgrading facade/ignition (2.11.0 => 2.14.0)
  - Upgrading fakerphp/faker (v1.15.0 => v1.16.0)
  - Upgrading filp/whoops (2.13.0 => 2.14.3)
  - Upgrading friendsofphp/php-cs-fixer (v2.19.0 => v2.19.2)
  - Upgrading graham-campbell/result-type (v1.0.1 => v1.0.2)
  - Upgrading laravel/dusk (v6.15.1 => v6.18.1)
  - Upgrading laravel/framework (v8.49.2 => v8.62.0)
  - Locking laravel/serializable-closure (v1.0.2)
  - Upgrading laravel/tinker (v2.6.1 => v2.6.2)
  - Upgrading league/commonmark (1.6.5 => 1.6.6)
  - Upgrading league/flysystem (1.1.4 => 1.1.5)
  - Upgrading league/mime-type-detection (1.7.0 => 1.8.0)
  - Upgrading maximebf/debugbar (v1.16.5 => v1.17.1)
  - Upgrading mockery/mockery (1.4.3 => 1.4.4)
  - Upgrading monolog/monolog (2.3.0 => 2.3.4)
  - Upgrading nesbot/carbon (2.50.0 => 2.53.1)
  - Upgrading nikic/php-parser (v4.11.0 => v4.13.0)
  - Upgrading nunomaduro/collision (v5.5.0 => v5.10.0)
  - Upgrading phar-io/manifest (2.0.1 => 2.0.3)
  - Upgrading php-parallel-lint/php-parallel-lint (v1.3.0 => v1.3.1)
  - Upgrading phpdocumentor/type-resolver (1.4.0 => 1.5.0)
  - Upgrading phpmailer/phpmailer (v6.5.0 => v6.5.1)
  - Upgrading phpoption/phpoption (1.7.5 => 1.8.0)
  - Upgrading phpseclib/phpseclib (3.0.9 => 3.0.10)
  - Upgrading phpspec/prophecy (1.13.0 => 1.14.0)
  - Upgrading phpstan/phpstan (0.12.92 => 0.12.99)
  - Upgrading phpunit/php-code-coverage (9.2.6 => 9.2.7)
  - Upgrading phpunit/phpunit (9.5.6 => 9.5.10)
  - Upgrading predis/predis (v1.1.7 => v1.1.8)
  - Upgrading ramsey/collection (1.1.3 => 1.2.1)
  - Upgrading ramsey/uuid (4.1.1 => 4.2.3)
  - Upgrading seld/phar-utils (1.1.1 => 1.1.2)
  - Upgrading symfony/console (v5.3.2 => v5.3.7)
  - Upgrading symfony/css-selector (v5.3.0 => v5.3.4)
  - Upgrading symfony/debug (v4.4.25 => v4.4.31)
  - Upgrading symfony/error-handler (v5.3.3 => v5.3.7)
  - Upgrading symfony/event-dispatcher (v5.3.0 => v5.3.7)
  - Upgrading symfony/filesystem (v5.3.3 => v5.3.4)
  - Upgrading symfony/finder (v5.3.0 => v5.3.7)
  - Upgrading symfony/http-foundation (v5.3.3 => v5.3.7)
  - Upgrading symfony/http-kernel (v5.3.3 => v5.3.9)
  - Upgrading symfony/mime (v5.3.2 => v5.3.8)
  - Upgrading symfony/options-resolver (v5.3.0 => v5.3.7)
  - Upgrading symfony/polyfill-intl-grapheme (v1.23.0 => v1.23.1)
  - Upgrading symfony/polyfill-mbstring (v1.23.0 => v1.23.1)
  - Upgrading symfony/polyfill-php80 (v1.23.0 => v1.23.1)
  - Locking symfony/polyfill-php81 (v1.23.0)
  - Upgrading symfony/process (v5.3.2 => v5.3.7)
  - Upgrading symfony/routing (v5.3.0 => v5.3.7)
  - Upgrading symfony/stopwatch (v5.3.0 => v5.3.4)
  - Upgrading symfony/string (v5.3.3 => v5.3.7)
  - Upgrading symfony/translation (v5.3.3 => v5.3.9)
  - Upgrading symfony/var-dumper (v5.3.3 => v5.3.8)
  - Upgrading symfony/yaml (v4.4.26 => v4.4.29)
  - Upgrading tecnickcom/tcpdf (6.4.1 => 6.4.2)
  - Upgrading theseer/tokenizer (1.2.0 => 1.2.1)

* Update npm dependecies

* Update phpstan ignores after laravel upgrades

* Merge laravel/laravel repo changes
2021-10-02 18:04:59 -05:00
SourceDoctor
30c20fa11f hrsystem write fix (#13314) 2021-10-02 18:03:24 -05:00
La
e5f540eed8 fix alert transport api with POST method (#13288) 2021-10-02 23:56:49 +02:00
Simon Smith
9f14740a91 Update Applications.md (#13312)
tiny fix to puppet snmp extend formatting
2021-10-02 15:16:55 +02:00
Nash Kaminski
cb56ae5f46 Improvements to SSO Authorization and logout handling (#13311)
* Improvements to SSO Authorization and logout handling

Changes:
* Adds support for a default access level in the SSO authorization
  plugin when group mapping is enabled.
* Restore functionality of the auth_logout_handler configuration option,
  allowing the user to be redirected to a configured URL to complete
  logout from an external IdP.
* Documentation and test coverage updates

* Set sso.static_level to 0 in AuthSSOTest:testGroupParsing()

* Simplify implementation to use default values in Config::get()
2021-10-02 08:02:42 -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
a828bb00c3 lnms snmp:fetch command and new SNMP code (#13303)
* SNMP WIP

* cleanup, more types

* Include my snmp:fetch command

* Fix Facade name conflict

* Command WIP
remove mib

* Ignore exit code
cleanups

* Doc blocks and style fixes

* forgot to use parseOid

* Hopefully final fixes

* missed on (:

* small changes
deviates from existing code, hopefully doesn't re-add too many corner cases.

* add some simple tests, will make it easier to add more in the future when we find corner cases.

* test numeric

* API refinements, try to avoid setting textual net-snmp options directly

* change numeric to a toggle makes for nicer usage

* make ci happy

* Some errors happen only in stderr, pass that to SnmpResponse for parsing.
Add error message access

* More consistent naming
2021-10-01 18:58:12 -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
8ffd573cf2 Remove text about report sql issues (#13307) 2021-10-01 14:03:53 -05:00
Tony Murray
c84b462ac0 Fix python config fetch disrupted by stderr output (#13295)
* Fix python config fetch disrupted by stderr output

I have no idea how to make command_runner not include debug output, so just use subprocess.check_output

* restore import
2021-10-01 07:58:17 -05:00
Jellyfrog
124e742518 Check if vlan->port exists (#13305) 2021-10-01 07:42:27 -05:00
Jellyfrog
0680dc8cd5 Use the same error message for different kind of authentiction errors (#13306)
This prevents usernames to be guess as the application confirms or denies their existence.
2021-10-01 14:12:48 +02:00
Tony Murray
65b385f0fe Workaround for dashboard widgets showing over popups. (#13257)
* Workaround for dashboard widgets showing over popups.
z-index is being set on the popup, and I verified it is applied, but for some reason the widget with a z-index of 2 still shows over top.
I don't think this has any side-affects, but I don't know for sure.
Could not find another work-around.  Gridster is dead, so unlikely we will update the js and override this fix.

* version file to make clients update
2021-09-30 20:13:21 -05:00
Maikel de Boer
b3c1d036b4 Ericsson Traffic Node support (#13299)
* Initial commit

* Removed unused function

* fixed style

* fixed style

* fixed test data

* Delete ericsson-tn_ericsson-tn.snmprec

* Update ericsson-tn.yaml
2021-09-30 08:29:31 -05: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
Tony Murray
fafb5a62c2 Fix port links (#13296)
yes is not a valid boolean
2021-09-30 09:41:12 +02:00
Cathal Mooney
50f766476c Update formatting of Prometheus extension doc (#13291)
* 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

* Formatting changes to doc for Prometheus extension.
2021-09-29 10:04:23 +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
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
Tony Murray
add06be809 Fix poller wrapper error (#13290)
* Fix poller wrapper error
trying to reference value from try block in catch block

* remove redundant item
2021-09-28 17:47:04 -05:00
SourceDoctor
708d1ebb87 API Call to set instant Maintenance mode (#13237)
* API Call to set instance Maintenance mode

* .

* remove unused code

* update query

* Use recent code

* remove accidental line return

* fix duration in success string

* style fix

* Try to fix bad code merge

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-09-28 21:54:52 +02:00
Tony Murray
b2ac547abb Quick fix for route discovery on PHP8 (#13284) 2021-09-28 16:22:17 +02:00
Tony Murray
5a0ed57514 Linkable graph component (#13263)
* Linkable graph component

* indentation change
2021-09-28 08:29:38 -05:00
Orsiris de Jong
bfa200f3f7 Full Python code fusion / refactor and hardening 2nd edition (#13188)
* New service/discovery/poller wrapper

* Convert old wrapper scripts to bootstrap loaders for wrapper.py

* Move wrapper.py to LibreNMS module directory

* Reformat files

* File reformatting

* bootstrap files reformatting

* Fusion service and wrapper database connections and get_config_data functions

* Moved subprocess calls to command_runner

* LibreNMS library and __init__ fusion

* Reformat files

* Normalize logging use

* Reformatting code

* Fix missing argument for error log

* Fix refactor typo in DBConfig class

* Add default timeout for config.php data fetching

* distributed discovery should finish with a timestamp instead of an epoch

* Fix docstring inside dict prevents service key to work

* Fix poller insert statement

* Fix service wrapper typo

* Update docstring since we changed function behavior

* Normalize SQL statements

* Convert optparse to argparse

* Revert discovery thread number

* Handle debug logging

* Fix file option typo

* Reformat code

* Add credits to source package

* Rename logs depending on the wrapper type

* Cap max logfile size to 10MB

* Reformat code

* Add exception for Redis < 5.0

* Make sure we always log something from service

* Fix bogus description

* Add an error message on missing config file

* Improve error message when .env file cannot be loaded

* Improve wrapper logging

* Fix cron run may fail when environment path is not set

* Add missing -wrapper suffix for logs

* Conform to prior naming scheme

* Linter fix

* Add inline copy of command_runner

* Another linter fix

* Raise exception after logging

* Updated inline command_runner

* Add command_runner to requirements

* I guess I love linter fixes ;)

* Don't spawn more threads than devices

* Fix typo in log call

* Add exit codes to log on error, add command line to debug log

* Add thread name to error message

* Log errors in end message for easier debugging

* Typo fix

* In love of linting
2021-09-27 14:24:25 -05:00
Tony Murray
9b5684da4e Missing config seeder docs (#13279) 2021-09-27 12:49:52 -05:00
Tony Murray
d11a6c6ebb Feature config seeder (#13259)
* Feature config seeder
Place yaml key value files in database/seeders/config to pre-populate the config database
This feature is primarily for docker images and other automation

example snmp.yaml
```yaml
snmp.community:
    - public
    - private
snmp.max_repeaters 30
```

* fix style

* include /data/config as used in docker

* respect --force option

* Confirm if re-import
Defaults to yes for --no-interaction
Don't confirm if there is nothing to do

* default to false

* typehints
2021-09-27 12:17:15 -05:00
Tony Murray
b934d0c927 cleanup device type override code (#13256) 2021-09-27 14:24:32 +02:00
Nick Peelman
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
ottorei
8ceebe7102 Fix outages table timezone (#13274) 2021-09-26 16:08:11 +02:00