Commit Graph

137 Commits

Author SHA1 Message Date
Jellyfrog
6ebcde3c04 Prepare for PHP 8.1 (#14156) 2022-07-28 22:09:09 -05:00
Nash Kaminski
d0503fbdef Fix 500 error in validation when UI containers and poller containers have differing node_ids (#14146)
* Fix 500 error in validation when UI containers and poller containers have unique node_ids

* Update DistributedPoller.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-07-27 03:08:17 -05:00
Jellyfrog
a214dbc8f3 Use --no-patch to support old git clients (#14137) 2022-07-26 01:21:19 +02:00
Tony Murray
0f13f2343f Fix more webserver validation issues (#14096)
IPv6 and undefined index errors
2022-07-08 23:36:48 -05:00
Tony Murray
c1a59e29e5 Git version validation fix (#14042)
Instead of erroring because the date is empty, print the error message from git.
2022-06-14 13:36:46 -05:00
Tony Murray
1d35d9391d server name validation, handle ports better (#14041)
Ignore standard ports and include non-standard ports in the base_url setting
2022-06-14 10:14:44 -05:00
Tony Murray
967c880d86 Fix rrd version check (#14036)
Remove hardcoded version
Add version display in error message
2022-06-13 11:20:13 -05:00
Tony Murray
7a0d604cdd Automatic fixes for validation failures (#13930)
* Automatic fixes for validations

* webui

* lint fixes

* Fix an install issue with ConfigSeeder requesting cli input in web page.

* Do not use c_echo in validate.php print_fail()
2022-06-10 16:25:33 -05:00
Tony Murray
7644c994ee Validate base_url and server_name (#13941)
* Validate base_url and server_name

* Fix style

* add return types
2022-06-07 20:53:39 -05:00
Nash Kaminski
4fe3b0fd57 Fix 500 error in validations when capabilities are not supported or set (#13991)
* Fix 500 error in validations when capabilities are not supported or set

* Update Programs.php

* Update Programs.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-06-04 15:38:09 -05:00
Tony Murray
d57b225d5d Improve lnms shortcut validation (#13982) 2022-05-14 08:11:13 -05:00
Tony Murray
014213680f Move Config loading to a service provider (#13927)
* Move Config loading to a service provider
That way other service providers can depend on it
Move various random listener registrations into the EventServiceProvider
Various startup cleanup

* Config::persist Set live variable before persisting incase db update fail

* Disable strict mode for legacy code (init.php)

* Disable debug after os test data is gathered

* remove Eloquent::boot it is never used

* remove Eloquent::version

* lint fixes

* style fixes

* there is no c_echo here
2022-04-22 19:12:07 -05:00
Tony Murray
0a84098211 Port Validation Page to Laravel (#13921)
* Revamp validate web page
 to load page then validate, instead of validate then load page

* style fixes

* lint cleanups

* fixes

* translations and a couple fixes

* style fixes

* move result serialization into the class.
2022-04-14 11:22:40 -05:00
Jellyfrog
fdebee86b4 Implement system for user packages in composer (#13718) 2022-02-02 17:33:23 +01:00
Jellyfrog
7c2af16541 Update recommended PHP version to 8.0 (#13687)
In preparation for Laravel 9
2022-01-20 08:07:29 -06:00
Tony Murray
c79b187d72 Poller rewrite (Try 2) (#13525)
* core WIP

* try to finish up

* trim space too
and a couple of cleanups

* update test data

* put escapes back

* another net-snmp difference

* correct copy paste error

* WIP

* Use new code YAY

* a tiny bit more

* Kind of working

* Handle manual modules correctly

* convert core to modern module

* Only save metrics if modules is not overridden

* correct module exists check

* database error handling

* debug handling

* restore bad changes

* Introduce Actions
 RunAlertRulesAction
 UpdateDeviceGroupsAction

* tweaks to output

* Fix some issues in outside code

* Style fixes

* fixes to module status checks

* typehints!

* Use logger only and DI

* OS module not named correctly

* Work on quiet output a bit more

* generically don't change output when disabling debug if the driver is already stack

* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction

* restore legacy os module shim

* use the new poller code for tests

* PollingDevice event

* Fix some issues and enable/disable error reporting around legacy modules

* typehints

* fully update baseline

* Use Process for version commands so we don't leak debug output.

* don't detect rrdtool version in ci every time

* style fixes

* Warning fixes

* more fixes

* re-update baseline

* remove diff noise

* fix up alerts

* Catch exceptions in device ip lookup

* Revert accidental snmp.inc.php poller target change
(should have been ?: not ??)
2021-11-17 19:23:55 -06:00
Tony Murray
31c9d9c307 Link for can't check Python dependencies validation (#13520)
* Link for can't check Python dependencies validation
Hopefully gives the user some direction

* Fix style
2021-11-17 17:23:37 +01:00
Tony Murray
f8764ddcb5 Revert "Poller command rewrite (#13414)" (#13524)
This reverts commit 1752d1efd4.
2021-11-16 21:40:29 -06:00
Tony Murray
1752d1efd4 Poller command rewrite (#13414)
* core WIP

* try to finish up

* trim space too
and a couple of cleanups

* update test data

* put escapes back

* another net-snmp difference

* correct copy paste error

* WIP

* Use new code YAY

* a tiny bit more

* Kind of working

* Handle manual modules correctly

* convert core to modern module

* Only save metrics if modules is not overridden

* correct module exists check

* database error handling

* debug handling

* restore bad changes

* Introduce Actions
 RunAlertRulesAction
 UpdateDeviceGroupsAction

* tweaks to output

* Fix some issues in outside code

* Style fixes

* fixes to module status checks

* typehints!

* Use logger only and DI

* OS module not named correctly

* Work on quiet output a bit more

* generically don't change output when disabling debug if the driver is already stack

* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction

* restore legacy os module shim

* use the new poller code for tests

* PollingDevice event

* Fix some issues and enable/disable error reporting around legacy modules

* typehints

* fully update baseline

* Use Process for version commands so we don't leak debug output.

* don't detect rrdtool version in ci every time

* style fixes

* Warning fixes

* more fixes

* re-update baseline

* remove diff noise

* fix up alerts
2021-11-16 16:59:46 -06:00
Orsiris de Jong
e57ec782f4 Install new python dependencies during daily maintenance (#13186)
* Improve check_requirements script to dynamically read requirements.txt

* Don't dynamically load requirements for python2

* Make sure we check python3 dependencies with python3 binary

* Quote variable to fix SC2086

* Add dynamic_check_requirements.py

* Use dynamic_check_requirements.py for python3

* Revert "Don't dynamically load requirements for python2"

This reverts commit 4485c8fcf9e0075fcf212e4f8bbc59ed75e144b5.

* Revert "Improve check_requirements script to dynamically read requirements.txt"

This reverts commit a9c83350d9de6b1b3b0a313dca23af749a08300a.

* Add LIBRENMS_DIR variable to exec, check for permission errors

* Make sure we check for permission errors on pip install

* Fix shellcheck SC2046 missing quotations

* Make sure we install pip packages as librenms user for Python3

* revert daily.sh, update dependencies in composer

* And in the validation

* should be executable

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-11-10 10:38:50 -06:00
Jellyfrog
8ffd573cf2 Remove text about report sql issues (#13307) 2021-10-01 14:03:53 -05:00
Jellyfrog
258505ed44 Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Jellyfrog
26b95c0ccc Apply fixes from StyleCI (#13208) 2021-09-08 23:35:56 +02:00
Tony Murray
e81ee98b31 Validate schema in utc (#13182)
if timestamp is off, prepend sql query to set UTC for session
2021-08-30 11:02:48 -05:00
Tony Murray
9b8b1b814a Validate APP_KEY (#13171)
* Validate APP_KEY
key:rotate command to rotate keys, only rotates validation data for now

* fixes, swapped encrypters, not saving new value to db, check that key exists first

* add confirmation

* Option to generate new key, re-encrypt data and then save it to .env
A lot more text to try to prevent disaster.  Print out both keys 1-2 times.
Fix bug in EnvHelper (when key is commented but not empty)

* fix style

* oops, good phpstan
2021-08-27 22:48:21 -05:00
Tony Murray
5d691dc375 Consolidate DB version code (#13111)
* Consilidate DB version
and don't use dbConnected() function

* cleanup imports
2021-08-09 18:33:31 -05:00
Sean
1a97559816 Fix scripts to allow pathname with space (#13027) 2021-07-14 22:00:21 -05:00
Tony Murray
bd3da058d3 Human readable database inconsistent error (#12950)
* Human readable database inconsistent error
In case a db error causes an exception, check validate and show the db errors to the user in the webui.

* only failed validations

* fix style
2021-06-14 13:33:59 -05:00
Tony Murray
ba4ccc1c61 Fix database validations (#12882)
Query output changed using Laravel Fluent, fix output parsing
2021-05-14 12:38:00 -05:00
Tony Murray
77a17dac88 Fix installer when DB is empty (#12873)
(which is every time)
2021-05-13 13:02:43 -05:00
Tony Murray
df5096e449 Install: Validate database before migrating (#12867)
* Validate database during install
Needed to remove usages of legacy functions in the validation

* Fix output, restore real versions
2021-05-13 07:18:54 -05:00
Jellyfrog
f7fbf9fe07 Add support for when group doesnt exist (#12817)
Previously this errored out the validation
2021-04-29 22:44:31 -05:00
Jellyfrog
edb36fd69d More cleanups (#12715)
* PHPDoc

* Replace Auth > Illuminate\Support\Facades\Auth

* Return inside when()

* use str_replace correct

* Misc

* dead code

* use int $port

* styleci
2021-04-08 08:14:49 -05:00
Cas de Reuver
4ade67097b Fix Config reference in System validations (#12668) 2021-03-28 12:19:14 -05:00
Jellyfrog
f06e81b357 Switch to utf8mb4 (#12580)
* Switch to utf8mb4

This allows emojis to function correctly

* Update URLs
2021-03-28 16:23:08 +02:00
Dan Langille
5ceba5cdb7 Filter some validation when installed from a package (#12647)
* Filter some validation when installed from a package

Also, tell the user that fping FAILURES can be ignored if running LibreNMS in a
jail without ::1

* Filter some validation when installed from a package

Also, tell the user that fping FAILURES can be ignored if running LibreNMS in a
jail without ::1

* change this back to info

* apply styleci diff
2021-03-26 22:07:33 -05:00
Jellyfrog
e3ee4649c1 Set correct min database version (#12606)
https://laravel.com/docs/8.x/migrations#index-lengths-mysql-mariadb
2021-03-11 11:41:44 +01:00
Jellyfrog
d6a830e72b Add minimum database version check (#12581) 2021-03-04 12:01:57 -06:00
Tony Murray
f5a0959181 Revert "Switch to utf8mb4 (#12501)" (#12578)
This reverts commit 8e2e67d0ee.
2021-03-01 14:59:06 -06:00
Jellyfrog
8e2e67d0ee Switch to utf8mb4 (#12501)
* Switch to utf8mb4

This allows emojis to function correctly

* Update URLs
2021-03-01 08:02:26 -06:00
Tony Murray
93b91ebc91 Improved rrdtool version validation (#12539)
Only raise validation issue if rrdtool is set low enough that it matters
2021-02-19 11:39:37 -06:00
Jellyfrog
20b4215204 Swich links to https (#12511)
* Switch librenms links to https

* Convert librenms links in comments

* Switch gnu.org url to https

* switch php urls to https
2021-02-09 00:29:04 +01:00
Tony Murray
43e323bb02 lnms link in /usr/bin (#12446)
* lnms link in /usr/bin

Just put the lnms link in /usr/bin.

Fairly odd that distros don't have /usr/local/bin in PATH

* Update System.php
2021-01-20 03:37:28 +01:00
Jellyfrog
b022a30a5b Apply fixes from StyleCI (#12343) 2020-11-23 19:56:23 +01:00
Tony Murray
2b59ff5fda Add system validation (#12337)
validate lnms link and completion
validate log rotation file is installed
2020-11-23 09:46:22 -06:00
Tony Murray
7ed34c889e Distributed Poller improved validation (#12269) 2020-11-23 00:33:56 -06:00
Tony Murray
25722bbbd5 Faster initial database creation (#12297)
* Faster initial database creation
Add db dumps to improve initial db migration
On my test system 13s -> 7s, a 46% reduction.
Should help out a lot on systems like RPi

* lnms schema:dump command

--snapshots saves db snapshots, otherwise it saves the yaml

* fix style

* fix timezones...

* not working with in-memory db yet
remove build.sql
2020-11-06 01:19:15 +01:00
Jellyfrog
1d23421ba1 Set PHP 7.3 as minimum supported version (#12118)
Needed by Laravel 8
2020-09-22 07:41:26 -05:00
Jellyfrog
29f45ca352 Apply fixes from StyleCI (#12124) 2020-09-21 15:59:34 +02:00
Jellyfrog
0d56bbd946 Apply fixes from StyleCI (#12123) 2020-09-21 15:51:53 +02:00