Commit Graph

19560 Commits

Author SHA1 Message Date
Tony Murray
66790e7e8f Increase minimum version to PHP 8.1 (#14378) 2022-09-26 08:52:15 -05:00
Tony Murray
e990dfcb35 Disable plugins that have errors (#14383)
* Disable plugins that have errors
Disable plugin if a hook throws an error and set a notification
Move notification code to class, so we can access it
Clear notification when plugin is attempted to be enabled again

* fix style and lint fixes

* another lint fix and handle if property is missing
2022-09-25 22:47:58 -05:00
Félix Bouynot
333ba7c2cd Fix oxidized web requests unclosed connections or responding fast enough (#14370)
* Fix oxidized web requests not closing connections or responding fast enough

* Update showconfig.inc.php

* Add method to get the text content of an oxidized page

* Use Oxidized getContent method instead of file_get_content

* Too much brackets with copy paste

* Fix carriage return errors because of copy paste

* Fix copy paste error again

* Fix indent

* PHPStan is waiting for a return even outside of the if loop

* Single quotes

* Variabilize timeout in baseapi

* Set Oxidized Api class timeout var to 90 because oxidized is slow and to be sure not to break half the installs here

* fix typo

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Spacing

* Remove timeout type because of this error

Unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in app/ApiClients/BaseApi.php on line 34

* Lint needs type finally

* Use contruct instead of setting variable

* Type hinting instead for php7.3

* Type hinting fix

* Set property value instead of calling parent constructor

* Typo

* Remove unneededconstructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Typing not casting

* Typing not casting

* Cannot type variables outside of a class

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2022-09-24 14:24:11 -05:00
Kayck Matias
64dcfcb8cc Alert map location fix (#14380)
* Update devices in alert-logs to init_select2

* Fix function ->exists

* Add init_select2 to location filter in ports

* fixes

* Fixed alerts rule system not filtering by location
2022-09-23 14:15:46 -05:00
electrocret
b993f38903 Fix Inventory table for Dark theme (#14377) 2022-09-21 23:35:24 +02:00
Tony Murray
dbcee24749 Bump version to 22.9.0 22.9.0 2022-09-21 01:51:22 -05:00
Tony Murray
1e2fbcff87 Changelog for 22.9.0 2022-09-21 01:51:21 -05:00
Tony Murray
fd6fdeeb5b Fix ports list exists (#14372) 2022-09-19 15:47:36 -05:00
sembeek
4e1f958e16 Fix ping.php skipped results (#14368)
* Update PingCheck.php

* Update PingCheck.php

* Update phpstan-baseline.neon

* Update PingCheck.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-19 15:10:26 -05:00
Jellyfrog
27a19039dc Defer loading cli option defaults (#14363)
* Defer loading cli option defaults

Also allows passing args to functions

* Update DynamicInputOption.php
2022-09-19 16:03:55 +02:00
Tony Murray
fb489f61ed Fix cipsec-tunnels ftd bad data causes error (#14366)
fixes #12393
2022-09-18 12:15:38 +02:00
huntr.dev | protect open source software
9f0b1cafff Add SECURITY.md (#14359) 2022-09-18 01:00:38 -05:00
Jellyfrog
be4f39a2b4 Remove call to Config from artisan (#14362)
Defers the loading of Config a bit
2022-09-17 23:44:45 -05:00
Tony Murray
0805002086 Fix scheduled maintenance xss (#14360)
Fix for fields title, notes, and maybe recurring_day. Other fields can't store html.

https://huntr.dev/bounties/bcb6ee68-1452-4fdb-932a-f1031d10984f/
2022-09-16 11:59:48 -05:00
Tony Murray
15fd7d0653 Handle null in unix-agent (#14358) 2022-09-16 15:44:41 +02:00
Kayck Matias
1e80780dd3 Load device selection dynamically on Ports page (#14353)
* Add search in real-time to Ports page

* Update to init_select2 and remove old query

* fixed styleci

* fixed styleci

* fixing email

* Finish up

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-16 08:40:03 -05:00
Quentin Schoemaker
d0bcf0a4da Added status checks for (BWCC) battery status and condition for onboa… (#14349)
* Added status checks for (BWCC) battery status and condition for onboard and PCIe RAID-controllers.
Added SNMPsim testfiles for iLO 4 and iLO5 with these changes.

* Added JSON test files.

* Masked serial numbers in SNMPrec files.

* Updated discovery description for battery condition.

* Updated masked SNMPrec file.
2022-09-16 12:03:43 +02:00
Tony Murray
67ad0726b0 Defer loading cli option values (#14354)
* Defer loading option values
Otherwise it causes a cli command to be run every single application boot.

* style and lint

* Just return whatever we have it isn't callable
2022-09-16 11:58:22 +02:00
Skylark
7aeb238b7f Oxidized "allow purpose and notes" (#14352)
error:
  "The value.group contains invalid keys: purpose,notes. Valid keys: hostname,sysName,sysDescr,sysObjectID,hardware,os,location,ip"

when running:
  lnms config:set oxidized.maps.group.purpose.+ '{"regex": "/^lon-sw/", "value": "london-network"}'
  lnms config:set oxidized.maps.group.notes.+ '{"regex": "/^lon-sw/", "value": "london-network"}'
2022-09-15 11:20:25 +03:00
Félix Bouynot
8dabf4e2ef Fix the case of 'Ungrouped' (#14351) 2022-09-14 20:14:31 +02:00
Tony Murray
4afc188cad Cache astext for 1 day (#14303)
* Cache astext for 1 day
Prep AS util to hold other code too
Fix code bugs (and hopefully not introduce new ones)

* Update AutonomousSystem.php
2022-09-14 02:00:30 +02:00
Félix Bouynot
76b46e8bf7 Fix for smokeping integration with ping-only devices (#14341)
* Fix for smokeping integration with ping-only devices

* Change for simple quotes

* Update Smokeping.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-14 01:58:10 +02:00
bp0
384e0449c1 API: allow delete location by id (#14334)
* API: allow delete location by id

Otherwise impossible to delete location "".

* docs/API: location can be name or id for edit and delete
2022-09-13 09:03:55 -05:00
Félix Bouynot
9cff8acb29 Match displayname source for graylog (#14339)
* Match displayname source for graylog

* Update GraylogApi.php

* Reorder addresses
2022-09-13 07:44:19 -05:00
Jellyfrog
a22be00c66 Ignore CommandNotFoundException from reporting (#14342)
Prevents user typos from bubbling up to error reports
2022-09-13 07:24:01 -05:00
Jellyfrog
a5b1ef61bc Check dot1dBasePortIfIndex exists before using it (#14337)
* Check dot1dBasePortIfIndex exists before using it

Fixes: array_flip(): Can only flip STRING and INTEGER values!

* Update vlans.inc.php

* Update vlans.inc.php
2022-09-12 15:18:43 +02:00
Tony Murray
881d581448 Fix existing, oops (#14332) 2022-09-09 15:12:02 -05:00
Tony Murray
6b1ae1dbf0 Do not allow sysDescr to be fetched in os module yaml (#14331)
It has already been fetched, use sysDescr_regex
2022-09-09 15:05:37 -05:00
Tony Murray
d2c6016d27 mib module is long gone 2022-09-09 14:42:56 -05:00
bp0
94830fe47e API update_device, make location field work (as does location_id) (#14325)
* update_device, add location to list of bad_fields

The field 'location' can't be changed using API update_device_field, even when used with 'override_sysLocation'. It should not return success, with the "Device fields have been updated" message that is untrue.

* Actually make it work

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-09 11:40:55 -05:00
Tony Murray
ad8580d694 Cleanup and optimize the availability widget (#14329)
* Cleanup and optimize the availability widget
Default sort is display name
Sort applies to services too (services always last)
May need to refresh the page to get new css

* style

* We don't need request (lint fix)

* Wrong service field name
2022-09-09 18:22:58 +02:00
Tony Murray
fbcaccdbd4 Update dependencies (#14319)
* Update dependencies
 hpdocumentor/reflection-docblock (5.3.0)
 hpspec/prophecy (v1.15.0)
 ymfony/debug (v4.4.41)
 barryvdh/laravel-debugbar (v3.6.7 => v3.7.0)
 composer/ca-bundle (1.3.2 => 1.3.3)
 composer/class-map-generator (1.0.0)
 composer/composer (2.3.7 => 2.4.1)
 doctrine/annotations (1.13.2 => 1.13.3)
 doctrine/event-manager (1.1.1 => 1.1.2)
 doctrine/inflector (2.0.4 => 2.0.5)
 fakerphp/faker (v1.19.0 => v1.20.0)
 graham-campbell/result-type (v1.0.4 => v1.1.0)
 guzzlehttp/guzzle (7.4.5 => 7.5.0)
 guzzlehttp/promises (1.5.1 => 1.5.2)
 guzzlehttp/psr7 (2.4.0 => 2.4.1)
 laravel/dusk (v6.24.0 => v6.25.1)
 laravel/framework (v8.83.16 => v8.83.23)
 laravel/serializable-closure (v1.2.0 => v1.2.1)
 laravel/socialite (v5.5.2 => v5.5.5)
 maximebf/debugbar (v1.18.0 => v1.18.1)
 mews/purifier (3.3.7 => 3.3.8)
 mockery/mockery (1.5.0 => 1.5.1)
 monolog/monolog (2.7.0 => 2.8.0)
 nesbot/carbon (2.58.0 => 2.62.1)
 nikic/php-parser (v4.14.0 => v4.15.1)
 paragonie/constant_time_encoding (v2.6.1 => v2.6.3)
 phpmailer/phpmailer (v6.6.0 => v6.6.4)
 phpoption/phpoption (1.8.1 => 1.9.0)
 phpseclib/phpseclib (3.0.14 => 3.0.16)
 phpstan/phpstan (1.7.12 => 1.8.5)
 phpunit/php-code-coverage (9.2.15 => 9.2.17)
 phpunit/phpunit (9.5.20 => 9.5.24)
 psy/psysh (v0.11.5 => v0.11.8)
 sebastian/type (3.0.0 => 3.1.0)
 seld/phar-utils (1.2.0 => 1.2.1)
 seld/signal-handler (2.0.1)
 symfony/console (v5.4.9 => v5.4.12)
 symfony/css-selector (v5.4.3 => v5.4.11)
 symfony/deprecation-contracts (v2.5.1 => v2.5.2)
 symfony/error-handler (v5.4.9 => v5.4.11)
 symfony/event-dispatcher-contracts (v2.5.1 => v2.5.2)
 symfony/filesystem (v5.4.9 => v5.4.12)
 symfony/finder (v5.4.8 => v5.4.11)
 symfony/http-foundation (v5.4.9 => v5.4.12)
 symfony/http-kernel (v5.4.9 => v5.4.12)
 symfony/mime (v5.4.9 => v5.4.12)
 symfony/options-resolver (v5.4.3 => v5.4.11)
 symfony/process (v5.4.8 => v5.4.11)
 symfony/routing (v5.4.8 => v5.4.11)
 symfony/service-contracts (v2.5.1 => v2.5.2)
 symfony/string (v5.4.9 => v5.4.12)
 symfony/translation (v5.4.9 => v5.4.12)
 symfony/translation-contracts (v2.5.1 => v2.5.2)
 symfony/var-dumper (v5.4.9 => v5.4.11)
 symfony/yaml (v4.4.37 => v4.4.45)
 tecnickcom/tcpdf (6.4.4 => 6.5.0)

* changes

* try again

* Fix some issues because the message is changing between versions, just avoids it.
2022-09-09 09:55:59 -05:00
Jellyfrog
152497a098 PHPStan: Enable more checks (#14318)
* PHPStan: Enable more checks

* Fixes

* Fixes

* Deprecation fixes
2022-09-09 07:08:06 -05:00
bp0
6cc9694780 docs/API: Move list_locations from devices to locations (#14328)
* Remove list_locations from devices

Moving to locations

* Add list_locations to locations

Moved from devices
2022-09-08 22:16:52 -05:00
Jellyfrog
8692abb830 Prevent errors when hrStorageTable doesn't exist (#14327)
Prevents Illegal string offset 'hrStorageDescr'
2022-09-08 21:52:33 -05:00
PipoCanaja
7970a7f9c7 Tests - cleanup names (#14322)
* remove underscores

* TooMuch
2022-09-08 19:26:20 -05:00
PipoCanaja
a9441c17fe rename mibs (#14323) 2022-09-08 19:18:14 -05:00
Maikel de Boer
bd02df14b6 Added support for UHP VSAT modems (#14317)
* Started UHP VSAT support

* continue uhp

* end of day

* uhp  support

* fixed icon / logo

* cleanup

* added test data

* Delete Uhp.php

If the file is empty let's delete it

* added test data

* Update uhp.yaml

spacing fix

* Fixed identation

* New test data

* Fixed

* styling

* fix

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2022-09-08 15:27:51 +02:00
Tony Murray
fdbee0f5ee Revert "ZTE ZXA10 Update (Added dBm graphs) (#14049)" (#14320)
This reverts commit 6e98139cd1.
2022-09-08 09:04:37 +02:00
Marek Wobst
22f84ef3d8 Add additional sorting options for Availability Map (#14073)
* Fix IPv6 in service check host (#13939)

* Add hostName cleaning to Clean

* Apply RFC 5952 formatting to Clean::hostName output

* Use more liberal cleaning for hostnames

* Remove unwanted whitespace

* Apply Clean::hostName() to all relevant fields

* Fix docstring

* Use IP::isValid inline

* Update Clean.php

* Update services.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Add sorting support for additional columns + dual column

Additional columns are Display Name (display) and System Name (sysName)

Dual column means that first is sorted after status, then within
each status group another sort is done (every columns from single column
sorting is possible).

* Change code for styleCI

* Expand availability map sorting menu

Also change sysName to System Name – there is no real reason for
that short form.

* Add german translation for avail. map sorting/display options

* Adjust sorting behaviour in Availability Map

The dropdown now presents two options:

- Display Text: Sort by the selected value of the dropdown 'Display Text'
- Status: Sort by status, then by selected value of dropdown 'Display Text'

As the field 'display' (The display name) may contain template functions
etc., sorting is not done by SQL means; instead custom sorting is done
within the controller.

* Apply fix for styleCI

* Apply fix for styleCI, part 2

* Update availability-map.blade.php

* Update availability-map.blade.php

* Update availability-map.blade.php

* Update de.json

* Update AvailabilityMapController.php

* Update AvailabilityMapController.php

* Update availability-map.blade.php

* Update de.json

Co-authored-by: Sander Steffann <sander@steffann.nl>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-07 20:02:00 -05:00
PipoCanaja
53bfb24ef9 Migrate xDSL code to module, and add support for VDSL2 MIB (#14207)
* use component to discover if xDSL polling is needed

use component to discover if xDSL polling is needed

* Components OK, Polling in correct files, no DB for VDSL

* GUI

GUI_suite

* per port as well

* rename

* interface listing

* draytek_snmpsim

* fix arraymerge

fix names and max value

* schema

schema

style

* remove one dbFetchRows

remove 2x dbFetchCell

style

style

remove Legacy dbFetchRow

tests

tests

eloquent

more eloquent

more eloquent

one more gone

* fix properties access

eloquent_insert_update

style

tests

tests

tests

tests

* tests

tests

tests

* adslLineCoding

* Models

* fix not nullable cols in DB from code

default values

typo

rename

typo

schema

fix

fix

vdsl fix now

typo

typo

fix size

fix size

* Power values for VDSL

Power values for VDSL

Power values for VDSL

DB

* cleanup

* Rrd::checkRrdExists

* always enable DSL discovery

style

* xdsl module

* cleanup and move to Module

cleanup and move to Module

cleanup and move to Module

cleanup and move to Module

* Fix display

* fix polling and tenth

* remove legacy poller

* Style and Cosmetics

Cosmetics

Cleanup

* Translations

Translations

* exists

exists

* add test support for xdsl

* remove last component call

unused

* translations

* remove non standard onclick event on xdsl line

* Update Discovery Support.md

Update Poller Support.md

toner_gone

* Notification for removal of lnms config:set enable_ports_adsl true

* enable on devices with potential DSL interfaces

* tests are working now

fix teldat tests

* os_schema

* teldat

* move to new module structure

* move to new module structure

* wrong dump function

* wrong dump function

* laravel_through_key hidden

* Update notifications.rss

* Update notifications.rss

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-07 19:29:17 -05:00
Tony Murray
b44f1546a2 Improved Modern Modules (#14315)
* Improved Modern Modules
Modules now report module dependencies and can dump data for testing
This should serve to the process of building a module more obvious.
cleanup now only requires a device, not an os wrapped around a device
Helper to create a modern module (including the legacy adapter) from a name.

* return false correctly for dump and handle it.

* make sure test data is in the right format.

* wrong isis table name

* sort

* Fix style and lint issues
2022-09-07 23:53:16 +02:00
Tony Murray
6342d69b18 Do not include _token in legacy vars (#14313) 2022-09-07 16:17:08 -05:00
Tony Murray
ae15c8eb2a Port pages fixes and cleanups (#14310)
* Port pages fixes and cleanups
Fix mac display on device port page
Move ports query building into the graph page where it is used
Add the filter ui to the all ports graphs pages

* whitespace
2022-09-07 15:33:29 -05:00
Tony Murray
8a4d8037e8 Don't include null os when loading defs (#14312) 2022-09-07 09:27:06 +02:00
Tony Murray
dc050711ec 2fa not all routes have names (#14311) 2022-09-07 09:06:24 +02:00
Jellyfrog
36e9c5e0b9 PHPStan: Remove PHP version constraint (#14314) 2022-09-06 23:43:51 +02:00
Tony Murray
c3f31c14e0 Handle connection timed out errors in unix agent (#14286)
* handle connection timed out errors in unix agent

* Update unix-agent.inc.php
2022-09-06 12:00:35 -05:00
electrocret
e458f95bd8 Billing module fix/cleanup (#14309)
* Delete autoadd definitions

Never actually used. Inherited from Observium.

* Allow Billing API to set dir_95th (for agg bills)

Currently we're unable to set dir_95th via API to configure Aggregate bills. This should fix that.
2022-09-06 11:49:15 -05:00
Tony Murray
9fdc213f25 Return GraphImage to include more metadata (#14307)
* Return GraphImage to include more metadata
Allows things like including title.
Implements __toString for backwards compatability
getImageData to allow controlling the output through flags

* Style and Lint
2022-09-06 07:33:57 -05:00