Commit Graph

184 Commits

Author SHA1 Message Date
Tony Murray
cce3dc0746 Discord Transprot user configurable embed fields (#15068) 2023-07-24 18:53:34 -05:00
Antonio Perretta
8c8b877ba4 Alert transport slack config (#15131)
* Fixing webform - Icon field was referencing slack-author and causing issues when writing to database

* Fixing validation - slack-username no longer used, changed to slack-author

* Fixed typo in previous update to Slack.php
2023-07-07 12:36:34 -05:00
Wheel
741c26dd2f Transport Messagebird voice message API (#15115)
* Messagebird voice message API

* Reverse permission change on rrd/.gitignore

* Name string
2023-06-23 15:19:26 -05:00
Wheel
3ac0129fab Messagebird transport (#15079)
* Messagebird transport

* Linting

* Styleci

* Styleci

* Minor note update
2023-06-07 08:22:36 +03:00
Peter Childs
713bef33bd Fix syslog transport output format (#15070)
* add maxclients to redis

* Syslog Transport fix Header (remove space)

* Did not mean to touch this file

* Did not mean to touch this file
2023-05-30 08:12:08 -05:00
Tim de Boer
ed0dee6487 Fixed Markdown/Parse mode for Telegram (#15066)
* Updated Install-LibreNMS.md

Default PHP version of Debian 11 (following this documentation) is 8.2 currently, instead of 8.1

* Fixed Markdown/Parse mode for Telegram
2023-05-26 00:56:19 +02:00
Jellyfrog
2b3575a5e9 Laravel 10.x Shift (#14995)
* Apply code style

* Remove explicit call to register policies

* Shift core files

* Shift config files

* Default config files

In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.

* Bump Laravel dependencies

* Add type hints for Laravel 10

* Shift cleanup

* wip

* wip

* sync translation

* Sync back config

* Public Path Binding

* QueryException

* monolog

* db::raw

* monolog

* db::raw

* fix larastan collections

* fix phpstan bug looping forever

* larastan errors

* larastan: fix column type

* styleci

* initialize array

* fixes

* fixes

---------

Co-authored-by: Shift <shift@laravelshift.com>
2023-05-24 22:21:54 +02:00
Tony Murray
0c93132588 Quick fix for alerting (#15060) 2023-05-24 08:24:05 -05:00
Tony Murray
04bb75f5f3 Alert transport cleanup, no_proxy support and other proxy cleanups (#14763)
* Add no_proxy and other proxy related settings
Set user agent on all http client requests
Unify http client usage

* Style fixes

* Remove useless use statements

* Correct variable, good job phpstan

* Add tests
fix https_proxy bug
add tcp:// to the config settings format

* style and lint fixes

* Remove guzzle from the direct dependencies

* Use built in Laravel testing functionality

* update baseline
2023-05-23 09:25:17 -05:00
Jellyfrog
a27a53cc03 Telegram: Fix undefined array key (#15025) 2023-05-09 07:35:12 -05:00
Olen
7ec37561c5 Ensure irc fifo-file is shared between dispatcher and core containers (#14647)
* Ensure fifo-file is shared between dispatcher container and core container

* Fix config path
2023-04-28 09:03:24 -05:00
Jellyfrog
68e0b3df28 Apply fixes from StyleCI (#14899)
Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-03-13 22:32:22 +01:00
not-known
2a4c50ed19 Jira transport: use template title (#14883)
* Use the title from the Alert Template for the Jira Transport if not empty or else use the default title

* Use the title from the Alert Template for the Jira Transport if not empty or else use the default title

* Fix style

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-03-13 05:07:29 +02:00
electrocret
c0fd1e15e2 Fix Alertlog messaging (#14861) 2023-02-24 13:10:10 +01:00
Timo Reimann
4b2fb79c1e Fix MS Teams alert transport, correct HTTP header (#14843)
* Fix Msteams.php

Microsoft rejects webhooks without correct Content-Type since beginning of January. This PR fixes the behaviour and makes Teams webhooks working again.

* Update Msteams.php

Fix StyleCI issue
2023-02-14 07:51:16 -06:00
Alexandre Novakovski
48be858bf2 Telegram: Add support for topics (#14804) 2023-01-26 15:28:41 +00:00
Tony Murray
1d3440b943 Unify time interval formatting (#14733)
* Unify time interval formatting
Use carbon for formatting, it supports locales.

* fix style

* remove baseline exceptions

* fixes found by lint
2022-12-15 15:52:53 -06:00
Jellyfrog
71d740770b Remove Log::event (#14526)
* Remove Log::event

Use the Eventlog class directly instead

* wip

* wip

* wip

* Apply fixes from StyleCI

* Update Eventlog.php
2022-11-09 09:47:19 +01:00
Tony Murray
15a41c9164 Fix xss in browser push transport (#14470)
Escape html when populating user list.
2022-10-17 12:32:16 -05:00
Tony Murray
964a67289a Populate the alert rule field with the builder json (#14374)
That way it isn't empty. (which is unexpected)
2022-10-02 00:02:08 -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
Jellyfrog
152497a098 PHPStan: Enable more checks (#14318)
* PHPStan: Enable more checks

* Fixes

* Fixes

* Deprecation fixes
2022-09-09 07:08:06 -05:00
Tony Murray
302a989d4e Email Transport: embed graphs by default (#14270)
* Email embed graphs

* Allow attachment for non-html
Add setting to webui
Correct $auth setting

* Cleanups, throw RrdGraphException instead of returning an error image.
Generate the error image later, giving more control.
Reduce code duplication a little

* Style and lint fixes
Change to flags

* Add baseline for lint errors I don't know how to resolve

* oopsie, changed the code after generating the baseline

* Tiny cleanups.  Make set DeviceCache primary, it is free.

* Docs.

* email_html note

* Allow control of graph embed at the email transport level to override the global config.

* Allow control of graph embed at the email transport level to override the global config.

* Add INLINE_BASE64 to make it easier to create inline image tags
2022-09-05 20:41:55 -05:00
Tony Murray
ec8629fb63 Discord ability to attach graph images (#14276)
* Discord ability to attach graph images
Must use @signedGraphTag()
Needs more work on the graph side of things still: issues with CORs and other.

* Fixes

* alert data is an array for transports

* No need to decode, that was a bug before
2022-09-05 16:20:10 -05:00
Tony Murray
ef1076dd7b Cleanup some RunAlerts issues (#14274) 2022-09-03 03:19:21 +03:00
Nash Kaminski
797fe7477d Improvements to PagerDuty alert formatting (#14143)
* Split PagerDuty payloads into an array delimited by newlines

* Remove empty lines in PagerDuty message
2022-07-27 02:51:02 -05:00
Marek Wobst
207aaf3064 Add rich (=html) support for messages via Matrix (#14054)
Mails may be colorful now, too.
2022-07-20 23:05:38 -05:00
Tony Murray
9f749ae778 Update Larastan (#14031)
* Update Larastan

* fix as many as I can

* update baseline for the remaining

* fix style

* Update Log::event phpdoc
2022-06-13 08:57:21 +02:00
Nash Kaminski
24e1c96790 Allow the use of a custom URL for accessing the PagerDuty API and correct API schema violation (#14010)
* Allow the use of a custom URL for accessing PagerDuty

* styleci

* PagerDuty custom details must be an Object, not string

* styleci
2022-06-04 13:54:35 -05:00
TheMysteriousX
afe3a25738 Use display name when sending alerts to Sensu (#13967)
* Use display name when sending alerts to Sensu

* system->hostname should always be an FQDN or IP
2022-05-27 09:07:29 -05:00
DaftBrit
cedaf8e3ae Setting card summary to alert title (#13989) 2022-05-24 12:21:09 +02:00
TheMysteriousX
95aaa31dd9 Sensu: Correct type hint (#13915)
* Correct type annotation

Not 100% sure this is correct as I don't know what the previous change was trying to correct - but they're definitely not all strings.

* Correct the correction
2022-04-13 14:25:56 +02:00
geg347
ef12e5f980 Added Basic authentication capability to Alertmanager Transport (#13867)
* Adding Basic authentication capability to Alertmanager's Transport

* Fix PHPStan linting error

* Fix StyleCI error

* Fix StyleCI error part 2
2022-03-31 21:45:44 +01:00
MrXermon
40ff020433 Fixed #13851. (#13852) 2022-03-15 22:36:48 +01:00
geg347
9036fd53b4 Added extra dynamic values alerttransport alertmanager (#13828)
* Add extra dynamic values to Alert transport for Alertmanager

* Add description to explain how extra dynamic values for Alertmanager works in the WebUI

* Add _ in dynamic label name + fix continuous-itegration error

* Fix continuous-itegration error part 2

* Updating AlertManager docs with explanation of how dynamic variables works
2022-03-14 21:39:00 +00:00
Jellyfrog
1debe5e166 Use built in method to render a string with Blade (#13688) 2022-01-26 07:10:06 -06:00
Tony Murray
3c0831c821 Use display name in alerts (#13650)
* Use display name in alerts

* remove error from baseline
2022-01-04 23:40:42 +00: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
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
djamp42
c61ccf5c48 Change text to show alert termplate msg (#13521)
In the initial pull request this was brought up but never addressed, https://github.com/librenms/librenms/pull/9305#issuecomment-427930650  The only reason i can think of is due to SMS message length, but you could be mindful of that with a alert template.  Submitting this to see if anyone objects to changing it.
2021-11-16 17:48:01 +01:00
Tony Murray
1ff48018fa Fix slack errors when variables are not set (#13476) 2021-11-05 22:30:30 -05:00
Tony Murray
0862496e26 Fix api transport mult-line parsing (#13469)
* API transport fix parsing
parse templates after parsing user options, not before

* API transport tests

* fix style and lint

* remove accidental item

* fix more type issues
2021-11-03 13:37:57 -05:00
Tony Murray
2c77edf4d2 Better handling of some alerting errors (#13446)
* Better handling of some alerting errors

* Better error output

* Consolidate simple template parsing

* Fixes reported by phpstan (one was a bug, yay!)

* add back forgotten trim

* don't remove the template if there is no match

* Match previous behavior, which was inconsistent.

* use anonymous class for tests instead

* Oopsie, Stringable is PHP8+

* fix style
2021-10-29 22:12:20 -05:00
Hannele Kormano
688ec422de Drop PDConnect Install links (#13407)
* Drop PDConnect Install links

This flow has been removed.

* Update some terminology while I'm here

History time notes just for fun: 
 - it was called "service key" when you could only have one integration per service
 - it was called "integration key" when you could only have integrations on services
 - it's now called "routing key" to be inclusive of account-level routing keys

* Delete some code that should be unused now

* Tidy up imports

* I think these are also unused now
2021-10-22 19:53:36 +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
La
e5f540eed8 fix alert transport api with POST method (#13288) 2021-10-02 23:56:49 +02:00
ottorei
b2d34cac4a Fix PagerDuty transport's group field (#13235)
* Do not poll passive interfaces

* Bug

* Update payload
2021-09-13 21:14:11 +02: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