Commit Graph

1385 Commits

Author SHA1 Message Date
Tony Murray
072d52e9fd Fix typo (#15406) 2023-10-06 07:51:51 -05:00
Tony Murray
6948b59c11 Add rewrites include for legacy modules (#15405) 2023-10-06 07:39:17 -05:00
Tony Murray
d8c372bbf4 Refactor MAC utilities into a single class (#15379)
* Refactor MAC utils to a new utility class

* Apply fixes from StyleCI

* Inline functions
Add tests
Handle bridgeid format

* Apply fixes from StyleCI

* Dedicated code path for stp bridge parsing, and improve STP output a bit

* Correctly parse dot1dBaseBridgeAddress and don't store int in bool field

* trim any unexpected character from bridge addresses, add extra test data.

* better comment

* barsBridge can handle dot1dBaseBridgeAddress correctly now

* parseBridge, check for properly formatted mac first.

* update test data, empty data = empty mac

* Fix new usage after rebase

* import

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-06 07:34:14 -05:00
Tony Murray
86793653b3 Validate secure cookies (#15401)
* Validate secure session cookies if HTTPS
When HTTPS is available, secure session cookies should be enabled
SESSION_SECURE_COOKIE=true

* Apply fixes from StyleCI

* Note config:cache

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-05 22:18:49 -05:00
Tony Murray
cc98089af1 Revert "Fix last polled (#15396)" (#15400)
This reverts commit 313e9a48e1.
2023-10-05 21:49:44 -05:00
Tony Murray
313e9a48e1 Fix last polled (#15396)
* Only update last_polled if polled
Because availability now runs always, we need to check if we ran any other modules successfully, if so, we can update last_polled

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-05 21:27:57 -05:00
Tony Murray
05c30b6001 Fix last polled in wrong column (#15398)
fixes #15382
2023-10-05 20:58:03 -05:00
Tony Murray
087d588102 Vmware vminfo modernize (#15008)
* Vmware vminfo
Remove legacy file and migrate to OS discovery

* tighter

* ios_stp-vlans working correctly now

* Make vmwVmGuestOS nullable

* Discover os info too

* VM Info module

* Apply fixes from StyleCI

* Fix log severity

* Fix log severity (more)

* VM Info module

* Poll with ESXi too because it is lightweight
add test data

* poller data now too

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-05 19:49:26 -05:00
Tony Murray
366be4cd49 Re-fix bug in Graphite (#15394)
preg_replace can handle arrays of subjects :D
2023-10-06 00:11:33 +02:00
Tony Murray
affb68e2bc Fix bug in graphite (#15393)
It was quite wrong.  Not sure if the fixed code is correct though.
fixes #15391
2023-10-05 14:38:48 -05:00
Tony Murray
be24993cbb Remove snmp functions that are barely used (#15377)
* Remove snmp functions that are barely used
Replace them with SnmpQuery calls

* Apply fixes from StyleCI

* Fix missing namespace

* Import Oid

* No more variables left may be repeated multiple times at the end with snmpsim, remove them all

* update data fixed by SnmpResponse bugfix

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-05 01:29:22 -05:00
Tony Murray
e0444bffcf Deprecate poller.php (#15370)
* Deprecate poller.php

* Apply fixes from StyleCI

* Remove references to poller.php
Leave wrapper...

* fix python style

* update wraper to call lnms device:poll

* Quiet output too

* make pb happy

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-04 16:32:02 -05:00
Tony Murray
c1258320f8 Availability module fixes (#15369)
* Refactor poller to allow modules to run even if the device is down
Include core in config (but not webui) to avoid silly shenanigans
Inject datastore into polling

* Needed to split datastore interface

* Cleanup some data_udpate() references

* Apply fixes from StyleCI

* Fix legacy poller :D

* Output to the correct stream

* Fix lint issues

* Apply fixes from StyleCI

* Fix discovery not including core and submodule handling

* Use whereRaw

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-04 10:32:59 -05:00
Tony Murray
4211b1c46f Remove unused functions (#15371)
* Remove unused functions
inline other legacy functions

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-04 10:17:34 -05:00
Tony Murray
6f329a7595 Fix alerting find owner contacts on old SQL server versions (#15355)
* Fix alerting find owner contacts on old SQL server versions
Older SQL server versions had a bug where they didn't accept parenthesis around the first query of a union statement.
It was difficult to remove these parenthesis, so use whereHas instead.

* Fix style
2023-09-28 09:49:29 -05:00
Tony Murray
803e7c0004 Fix Linemessagingapi class name (#15356) 2023-09-27 13:49:12 -05:00
I-FGSD
e89f97057a Update Windows.php (#15350)
I added Server 2022 and Windows 10/11 22H2 (and a few other popular but older windows builds that people might still have in use).

I also propose changing the naming of windows machines to better reflect the release and version of windows. This naming is derived from this page: https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions

For example, for Windows Server it was previously set to something like 'Windows Server 2019 1809 (NT 6.3)' which is incorrect as MS stopped using NT 6.3 since Windows 10 version 1507. Now it'll display as 'Windows Server 2019 (1809)'. The kernel/version is in parentheses and isn't also in the main part of the name as it's redundant/duplicated information.
2023-09-26 20:54:57 -05:00
Tony Murray
c8041b6699 FDB Tables improve performance (#15333)
* FDB Tables improve performance
Reduce unnecessary sql queries, by using a relationship
Cache vendor oui lookups

* Oui already "clean"

* Fix typo
2023-09-25 19:49:22 -05:00
Tony Murray
bfc82a5383 Bump version to 23.9.1 2023-09-18 20:59:06 -05:00
Tony Murray
ba67d886c8 Fix bug in sysContacts email collection (#15325)
Also, include trace in log when an error occurs
2023-09-15 08:05:55 -05:00
Tony Murray
4b98bd7607 Bump version to 23.9.0 2023-09-15 07:29:15 -05:00
Tony Murray
b5f12ee03f ADAuthorizer auth skip count entry (#15322)
fixes #15304
2023-09-14 09:27:16 -05:00
Tony Murray
28603f2a63 Fix error when mail-contact is missing (#15305) 2023-09-11 21:23:26 -05:00
Tony Murray
8466d537c6 Additional contact options for email transports (#15266)
* Additional options for email transports
Similar system email options will be deprecated

* Fix lint and style issues
2023-09-08 09:27:23 -05:00
Tony Murray
e978025553 Fix typo in default mibs for SnmpQuery (#15297) 2023-09-08 08:32:01 -05:00
Tony Murray
f670a8074a Fix .env quoting issue (#15298)
Triggered when password contains # and .env file uses windows line returns.

Friends don't let friends use windows line returns
2023-09-08 08:31:41 -05:00
Tony Murray
b51ae39e71 Radius enforce roles (#15294)
Add new setting to specify if user roles will be set at login or not.
Without this setting enabled, roles are only set when the user is first created and never after that. If roles set via Filter-ID attribute or radius.default_roles change, they will never be reflected on existing users.
For that reason, the default is set to enabled.  Historically, radius did not enforce roles.
2023-09-07 11:28:35 -05:00
Pelt10
6d4e1f8d93 Return an 5XX error when an exception is raise (#15285) 2023-09-06 13:41:13 -05:00
Skylark
2b10956f0b Hide token, keys and possword in Transports (#15274)
I've gone over all the Transporters adn changed all 'text' fields for token, keys and passwords to 'password' so the no longer show up as clear text in the GUI
2023-09-01 15:07:39 -05:00
Tony Murray
9c6fc31113 Fix LDAP Authorization Authorizer (#15267)
https://community.librenms.org/t/8-28-sudden-ldap-authentication-issues/22176/10
2023-08-30 19:33:13 +02:00
Tony Murray
bbe835b5f9 Radius update roles correctly (#15261)
Needs a re-write so semantics line up with Laravel auth better, but this is the quick/safe fix.
2023-08-28 23:38:09 -05:00
Tony Murray
b889e218dc LDAP Authorizer hand count entry (#15259) 2023-08-28 14:06:33 -05:00
Tony Murray
f622a96c70 Fix mysql auth removing roles upon login (#15258) 2023-08-28 11:00:18 -05:00
Tony Murray
2cd207028a Implement RBAC (only built in roles) (#15212)
* Install bouncer

* Seeder and level migration

* Display and edit roles

* remove unused deluser page

* Update Radius and SSO to assign roles

* update AlertUtil direct level check to use roles instead

* rewrite ircbot auth handling

* Remove legacy auth getUserlist and getUserlevel methods, add getRoles
Set roles in LegacyUserProvider

* Small cleanups

* centralize role sync code
show roles on user preferences page

* VueSelect component WIP and a little docs

* WIP

* SelectControllers id and text fields.

* LibrenmsSelect component extracted from SettingSelectDynamic

* Handle multiple selections

* allow type coercion

* full width settings

* final style adjustments

* Final compiled assets update

* Style fixes

* Fix SSO tests

* Lint cleanups

* small style fix

* don't use json yet

* Update baseline for usptream package issues

* Change schema, not 100% sure it is correct
not sure why xor doesn't work
2023-08-28 00:13:40 -05:00
Tony Murray
723600751c Dispatcher option to log output (#15230)
* Dispatcher option to log output
-o --log-output Log output into various files in the log directory
wire up -d option to be passed into scheduled commands
Caution, can fill your disk.

* style fixes

* more silly style fixes (and a typo accidentally added)

* final lint maybe?

* more lint...

* believe it or not, more lint
2023-08-21 18:28:07 -05:00
Tony Murray
69297c9e91 Bump version to 23.8.0 2023-08-19 09:13:28 -05:00
Tony Murray
6e4d124619 Misc fixes 2 (#15190)
* Fix error when missing poller data

* Apparently impossible to detect regex without error, so require regex always.  Update docs.

* Apparently this adva code is garbage :D

* Missing count sensor type

* Processor handle missing input

* Handle missing ifName a little better

* Yep, ports module is a dumpster fire.  Attempt to clean up some.

* apparently os yaml trying to replace on non-existent fields

* Might as well define all sensor type units

* revert previous fix, real issue was vlans module does not have polling.
2023-08-13 18:43:52 +02:00
Tony Murray
d865e3b372 Always mark device last_discovered (#15218)
Previously, if the device was ping only, it wasn't marked as discovered.
Now we always run discovery, but basically all it does is update last_discovered.
2023-08-13 16:56:54 +02:00
Tony Murray
670904bd30 Fix service_master_timeout setting (#15217) 2023-08-11 14:20:39 -05:00
AdamB
daf36ef48f fping 4.0+ prefers IPv6 (#14825)
Additionally fping6 is no longer a thing - this breaks IPv4 hosts entirely in a dual stack environment

It's not possible to reconcile these options, so we have to have a toggle until distro's with fping 3.x fall out of support.
2023-08-10 20:16:59 -05:00
Jacob
a71ca98fac LDAP: remove user_id cast to int (#15205)
* Remove user_id cast to int

Unnecessary due to field being varchar.

* Change the strict comparisons to non-strict
2023-08-08 21:30:16 -05:00
Tony Murray
d1b7004fef Severity Enum (#14620)
* Severity Enum
Replace old Alert constants

* Fix whitespace

* Additional uses

* style fixes

* Fix test too

* More missed locations

* More
2023-08-05 12:12:36 -05:00
Tony Murray
9382959c8c Set mibs explicitly in SnmpQuery (#15199)
* Set mibs explicitly in SnmpQuery
Always override system mibs, so we have consistency
New method to control mibs

* Lint fixes
2023-08-05 14:45:15 +02:00
Johnny Sung
de65ff55fc Implement LINE Messaging API (#14867)
* implement LINE Messaging api

* apply code clean up

* Update Linemessagingapi.php

* fix variable type

* Match branding

* Remove extra proxy

---------

Co-authored-by: Neil Lathwood <gh+n@laf.io>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-08-04 12:30:46 -05:00
Tony Murray
523e76db71 Fix sensor discovery fetch issue (#15193)
* Fix sensor discovery fetch issue

* value is not in an array

* Fix type

* remove exception...

* Update HarmonyEnhanced

* update test data
2023-08-04 13:25:19 +02:00
Tony Murray
12f8bb2040 MAC Vendor OUI use scheduler (#15187)
* MAC Vendor OUI use scheduler
Add command to update `lnms maintenance:fetch-ouis`
Show vendor column in tables if mac_oui.enabled is set to true
Improve scheduler validation handle non-standard install directories and systems without systemd
Add index to table to improve speed and improve mac->vendor lookup speed
Scheduled weekly with random wait to prevent stampeding herd issues for upstream
drop oui update from daily

* MAC Vendor OUI use scheduler
Add command to update `lnms maintenance:fetch-ouis`
Show vendor column in tables if mac_oui.enabled is set to true

* Lint fixes and better prefix detection

* update schema file
2023-08-03 19:29:30 -05:00
Jellyfrog
5a56e9081e Use Laravel schema migration command directly (#14039)
* Add new schema migration command

* Apply fixes from StyleCI
2023-08-03 19:26:48 -05:00
Justin Lentz
90b16bab81 port_error_perc macro (#15016)
* port_error_perc

* Update macros.json

* Update macros.json

* Update querybuilder.json

* Revert

* Update macros.json

* Change macro names so they match usage_perc

* Try *100.0

* Attempt 2 - Encapsulate in parenthesis

* Undo Parenthesis

* Trying laf's suggestions

* Update QueryBuilderFilter.php
2023-07-31 22:26:21 -05:00
Jellyfrog
1a6fe2bff7 Update composer dependencies (#15167) 2023-07-26 22:24:37 +02:00
Tony Murray
3908bddb49 Miscellaneous fixes (#15162) 2023-07-26 01:08:10 +02:00