Commit Graph

219 Commits

Author SHA1 Message Date
Tony Murray
ee1afba003 Fix Alert transport details xss (#16444)
* Fix stored XSS in alert transport details

https://github.com/librenms/librenms/security/advisories/GHSA-7f84-28qh-9486

* Fix password double encode
2024-09-29 13:45:16 +01:00
jcamos
4c72856046 Matrix: critical alerts now notify (#16355)
* Update Matrix.php

Changing 'm.text' to 'm.notice' so that when an alert is issued, you get notified on your Matrix client.

The current 'm.text' parameter will silently send you the message, whereas 'm.notice' will send you a message with an alert.

* Enabling notifications on Matrix client

Changing 'm.text' to 'm.notice' (line 47) so that when an alert is issued, you get notified on your Matrix client.

The current 'm.text' parameter will silently send you a message, whereas 'm.notice' will send you a message with an alert.

* Update Matrix.php

* Update Matrix.php

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-09-12 10:13:21 -05:00
Steve Calvário
40b629011f Fix alert -1 count (#16359) 2024-09-04 16:04:06 -05:00
Tony Murray
89d70bd48e Fix alert detail count missing (try2) (#16309) 2024-08-21 21:41:22 -05:00
Tony Murray
50ff4fafed Work around alert with bad data (#16287)
Avoid trying to count null by making sure it is an array
2024-08-15 18:21:50 -05:00
Tony Murray
9455173edc Fix alert bug when key missing (#16281) 2024-08-12 12:21:14 -05:00
Justin Lentz
338e0acbe4 Alertmanager Striptag Dynamic Variables (#16141) 2024-06-20 09:37:34 -05:00
Ashwath Venkataraman
c7708922ab Create Alertops.php (#16050)
* Create Alertops.php

This is a request to add this Transport publicly, so alerts can be sent to AlertOps' webhook endpoint - AlertOps is an alerting/notification tool.

* Update Alertops.php

* Update Alertops.php
2024-05-22 22:03:51 -05:00
Ron
79184e8345 SIGNL4 Alert Transport (#16037)
* SIGNL4 Alert Transport

SIGNL4 alert transport added.

* Update Transports.md

* Update Signl4.php
2024-05-22 10:16:35 -05:00
Tony Murray
49f8269262 Improved Latency graph (#15940)
* Improved Latency graph
Store loss+jitter info in rrd instead of database
New graph icmp_perf (legacy ping_perf still valid referencing part of the newer data)
Delete device_perf table

* Change loss to an area so it is more visible

* Style fixes

* Cleanups from phpstan & tests

* exit_code fix

* Remove alert usage of device_perf

* Don't use magic __get

* Add test for bulkPing
Add host to previous tests

* style fixes

* Fix issue fping error responses
2024-04-18 09:57:01 -05:00
Joe Clarke
d7737b9889 Pretty up Slack formatting. (#15898)
* Pretty up Slack formatting.

* Normalize spaces by turning every instance of two or more spaces into
  one space.
* Allow for custom URL links even when strip_tags() is in effect by
  transformaing "standard" markdown syntax into Slack link markdown
  after strip_tags() is run.

* Document the changes to the Slack transport.

While here, flesh out the Slack docs to match the configuration options
one currently sees in the transport.

* Use backticks to escape things from markdown rendering.

* We don't need this other escaping now.

* Fix custom link due to line break.

* Fix spelling typo.

---------

Co-authored-by: Joe Clarke <jclarke@cisco.com>
2024-04-16 11:28:10 -05:00
Jellyfrog
4039d88b3b Update dependencies (#15869)
* Update dependencies

* fix new phpstan errors

* Update phpstan.neon
2024-03-03 22:45:09 +01:00
Skylark
851f682155 Transport - Jira transport rewrite (#15561)
* Add custom Field to Jira Payload

Allmost every Jira setup is diffenerent and requires customise information to be added to the API post.

This change will allow you add a custom fields to the '"fields": {   }' using json format.
Examples: are provided in the TransportUI

* applying StyleCI fixes

* Updating Jira transport

* Updating Jira transport

* Updating Jira transport

* styleci fixes

* Renaming variables to align with existing conventions

* Fixing imput checks to make sure values are legit

* style

* Fix minor typo

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
Co-authored-by: Justin Lentz <monkeybrains7@gmail.com>
2024-02-22 11:07:49 -06:00
Personwho
df54ff072c Remove dumpRawSql() function in AlertUtil.php (#15803)
It caused fail to execute alert/transports/{transport}/test
2024-02-05 14:13:27 +01:00
Joe Clarke
31e8557930 transport - enforcing Webex max message length. (#15789)
* Add support for Webex max message length.

Webex limits messages to just over 7 KB.  Some alerts might be longer
than this.  So truncate the message with ellipses.

While here switch to using the new API URL.

* Use spaces.

Formatting got messed up on the transfer from test to dev.

* Do the truncation after the message is massaged.

This may yield a few more allowed characters.

---------

Co-authored-by: Joe Clarke <jclarke@cisco.com>
2024-02-04 17:20:36 +01:00
Gil Obradors
5856e2c6cd Rename JiraServiceManagement.php to Jiraservicemanagement.php (#15717)
* Rename JiraServiceManagement.php to Jiraservicemanagement.php

#15716 Filenames must not be PascalCase, only the first letter can be uppercase.

* Update Jiraservicemanagement.php

Following class name conventions

* Update Jiraservicemanagement.php

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-01-09 16:05:29 +01:00
Hamza Khan
166026d251 Add JiraServiceManagement Transport (#15593) 2024-01-08 16:49:14 +01:00
Jellyfrog
071ca9bc2a Apply fixes from StyleCI (#15698)
Co-authored-by: StyleCI Bot <bot@styleci.io>
2024-01-04 22:39:12 -06:00
Brian Egge
470e2ae34f Update Pushover.php (#15652)
Entities are html encoded so this will cause them to be displayed correctly in pushover alerts

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2023-12-17 00:20:42 +01:00
Tony Murray
2755676131 Fallback to default alert template and give reason (#15583)
* Fallback template, give reason
Print the error and notice of the fallback template being used.

* more strict typing
2023-11-16 15:18:12 +00:00
PipoCanaja
d107af1363 bug - Fix API Content-Type Header handling (#15574)
* Fix API Content-Type Header

* compacted and commented

* style
2023-11-14 07:26:00 -06:00
not-known
cf69a00cd0 Add option to disable the send of acknowledgement alerts. (#15208) 2023-11-13 21:56:06 -06:00
Tony Murray
63eeeb7172 Mail Transport use BCC option (#15554)
Option to use BCC instead of to field for emails
2023-11-08 08:36:09 -06:00
Wade Fitzpatrick
27ef398907 Add alert transport for Grafana Oncall (#15330)
* Add alert transport for Grafana Oncall

* Add doc for Grafana Oncall

* Fix lint

* Fix comment lint
2023-10-18 22:24:40 -05:00
SourceDoctor
0f0f49697f muteabel acknowledged alert notifications (#15456) 2023-10-13 22:20:51 -05:00
Tony Murray
1caa2dec42 Send event log when alert rule fails (#15440)
Instead of breaking all following alerts when one has an error, just skip that one alert rule and send and eventlog detailing the error.
2023-10-12 19:31:53 -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
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
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
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
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
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
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
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