Commit Graph

111 Commits

Author SHA1 Message Date
Heath Barnhart
851994cfb8 Alert Subsys to OOP and SNMPTraps trigger Alert Rules (#9765)
* Changed snmptrap.php and handlers to allow for alerts.

* Moved RunRules() to Dispatcher.php

* Modified includes, passes pre-commit tests locally.

* Converted RunRules to OO, fixed formatting in files found by TravisCI

* rebase, covert alert subsy to oop

* Modified init.php to call new Alert subsystem

* fixed dependencies

* Resolved undefined functions

* Fixed PingCheck.php not triggering

* Changed runAlerts to __construct

* Fixes
Can't have Config inside empty()
incorrectly named function (my fault)
poller.php missing shebang
organize imports
2019-07-18 08:36:02 -05:00
Joe Clarke
8bbc69a878 Add support for using Markdown for the Ciscospark transport (#10442)
* Add support for using Markdown.

Alert templates can be written using Webex Teams (i.e., Spark) Markdown,
which makes for some richer alerts.  This option defaults to false to
maintain Principle of Least Astonishment.

* Update Cisco Spark docs.

* Mention that Cisco Spark is now called Webex Teams
* Add support for Markdown

* Refactor text.

Do not exceed 80 characters per line.

* Refactor code to meet style guidelines.

* Remove errant tabs and use spaces instead
* Correct type check
* Remove use of 'else'
2019-07-14 16:34:22 -05:00
PipoCanaja
ef637a7c77 API Transport - Empty lines handling (#10431)
* API Transport - Empty lines handling

* Handle empty lines

* Update Api.php
2019-07-10 23:23:45 -05:00
PipoCanaja
55f67f42fe Refactor Api transport to use Guzzle (and new variables syntax) (#10070)
* Allow new {{ $xxxx }} syntax

* Properly handle urlencode on variable values without braking the URL, and uses Blades

* Doc
Doc typo

* use Guzzle for HTTP requests

* Add Basic auth support

* Doc update

* clean

* Revert Blades, but keep the {{ $xxxx }} syntax

* Revert Blades, but keep the {{ $xxxx }} syntax

* Init Vars and comments

* Notifications

* api-options are not required

* Update notifications.rss
2019-07-04 16:55:29 +01:00
Tony Murray
dd2fc0baf8 Fix Dummy alert transport (#10379) 2019-06-26 09:47:03 -05:00
Tony Murray
f3ba8947f7 Use Config helper (#10339)
remove usage of global variable
2019-06-23 00:29:12 -05:00
Tony Murray
312d35dd95 SMS Eagle reduce chances of user mis-configuration (#10223)
* Merge pull request #54 from librenms-plugins/revert-52-PluginNamespaceCorrection

Revert "Adding namespace LibreNMS\Plugins;"
SMS Eagle prevent user mis-configuration
Only allow URLs, but automatically append http:// to ones that are only hostname

* restore whitespace
2019-05-14 08:29:34 -05:00
Tyler Christiansen
89197581d2 Cast alert ID to string for PagerDuty API (#10186) 2019-05-04 00:05:47 +02:00
Mihai Petracovici
2df2956817 Improved option naming & validation for smseagle (#10141)
* Relax validation for smseagle hostname
* Update property description and documentation
2019-04-27 09:08:16 +02:00
Neil Lathwood
d31a551464 Removed legacy code from transports (#10081) 2019-04-12 12:33:10 -05:00
Tony Murray
ac1cd1296b Fix transport options when edited on Windows (#10001)
Windows puts line returns as \r\n, when parsing LibreNMS previously left the \r, which could cause issues
Centralize the code so we just have one place to fix.
Try to fix SMSEagle, it had the options wrong (copied from another transport)
2019-03-27 07:18:02 -05:00
angryp
15aee15388 Alertmanager fix 2 (#9860)
* Improved Alertmanager transport

* Typo fix

* Fix according to Travis fail
2019-03-01 23:09:25 -06:00
Neil Lathwood
5d74839139 Removed legacy transports and templates code (#9646)
* Removed legacy transports and templates code

* Add notification

* abstract LnmsCommand

* Only issue alerts "legacy" alerts to mail for default contacts, etc.

* Prevent no contacts error when default contact is not specified, or there are no contacts for other reasons.

* remove eval \o/

* Update notifications.rss
2019-02-15 07:58:59 -06:00
pobradovic08
67d81e68c9 LibreNMS/Alert/Transport/Elasticsearch - Send timestamp with timezone (#9757)
* Send timestamp with timezone

Add timezone to timestamp field, otherwise ES will think it's UTC

* Update Elasticsearch.php
2019-02-12 21:48:12 -06:00
Misha Komarovskiy
fe4bd2b338 Update Mattermost transport with configurable author_name (#9759)
Signed-off-by: Misha Komarovskiy <zombah@gmail.com>
2019-02-12 18:22:30 -06:00
angryp
c0aea751e3 Fixed Alertmanager transport (#9807) 2019-02-12 17:51:20 -06:00
aylham
cf1701624f Canopsis transport (#9795)
* Change in the Canopsis transport to make it 3.9.0 compliant and link to
the new documentation

* Add missing php72 module on Centos

* Fixing documentation for AMQP based tranport outside of the main doc
2019-02-11 09:46:09 -06:00
Richard Mayhew
1f53e7658c Msteams (#9774)
Msteams consistent title
2019-02-07 01:24:58 -06:00
George Pantazis
b6c1048c36 Added Mattermost Transport 2019-01-28 11:36:05 +02:00
TheGreatDoc
a0e33a6703 Merge pull request #9743 from librenms/revert-9711-issue-5659
Revert "Mattermost Alert Transport"
2019-01-26 08:31:24 +01:00
TheGreatDoc
75927c8389 Revert "Mattermost Alert Transport (#9711)"
This reverts commit 09d500812e.
2019-01-26 07:59:04 +01:00
GitStoph
4ed8f67e0d Added Alerta Alert Transport (#9673)
* Added Alerta Transport option.

* fixed a couple codacy requirements

* Update Alerta.php
2019-01-25 15:37:27 -06:00
George Pantazis
09d500812e Mattermost Alert Transport (#9711)
* fixed #5659
Added support for Mattermost notifications.

George Pantazis <gpant@eservices-greece.com>

* Update Mattermost.php

* changes as requested by @murrant
2019-01-25 15:35:42 -06:00
Alex Typaldos
29f8a8d4a3 Fix victorops recovery alerts (#9651)
* send entity ID as string

VO will not accept an int as an entity ID, this causes issues when issuing recovery alerts as the entity_id is the only way to link incidents.  I have tested this with VO and incidents will alert AND recover.

* change from str() to strval() which is the correct function
2019-01-12 12:51:52 -06:00
angryp
0c188c5995 Added Alertmanager transport (#9637)
* Added Alertmanager transport

* Fixed as per comments

* Update Alertmanager.php

* Update Alertmanager.php
2019-01-12 10:42:42 +00:00
Tony Murray
f451f56e98 Pushover fix sounds (#9519)
* Pushover fix sounds

* fix editing issue with duplicate field ids
2018-12-10 22:18:45 -06:00
gillmore-ac
170b87226d feature: Added HTML tag support for msteams transport (#9533)
* Added HTML tag support for msteams transport

* Update Msteams.php
2018-12-10 21:56:58 -06:00
Drew Hynes
634f1c01f7 changed tabs to spaces 2018-11-30 18:35:07 -05:00
Drew Hynes
b4607e4bc2 removed else to satisfy codeclimate checks 2018-11-30 18:09:10 -05:00
Drew Hynes
d40c3de918 changed variable name to resolve issue with Gitlab transport 2018-11-30 17:37:13 -05:00
Neil Lathwood
b93e66efbe Show visually in webui + cli when using deprecated templates or transports (#9413)
* Show visually in webui + cli when using deprecated templates or transports

* Fixed query
2018-11-10 21:06:51 +00:00
Paulo Coimbra
518e5f06d3 Added format field to Telegram Messages (#9404)
* Add format field to Telegram Messages

Added Telegram field to send formatted messages as Mardown or HTML

* Update Telegram.php

* Correct Mistypo.

* Correct mistypo

* Correct Mistypo

* Correct mistypo

* Update Transports.md

* Add Format field on Telegram Examples

* Change Telegram Format field to type select

* Add "blank" option to Format field

* Update Telegram.php

* Update Telegram.php

* Update Telegram.php
2018-11-08 22:26:29 +00:00
Neil Lathwood
01666e5ca7 Fixed AlertUtil - again (#9429) 2018-11-07 17:04:45 +00:00
Neil Lathwood
42bd9a3c83 Fixed alert util (#9428)
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
2018-11-07 15:17:23 +00:00
Neil Lathwood
38e3250528 Added support for using Transport name in templates (#9411) 2018-11-05 07:56:16 +00:00
Andy Rosen
4e5a0fa4d7 Added Twilio SMS as an Alerting Transport (#9305)
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
2018-10-17 17:19:28 +01:00
Neil Lathwood
3fc9e334b8 Use correct ID for incident resolution (#9321)
* Use correct ID for incident resolution

* Update Pagerduty.php
2018-10-16 16:38:35 -05:00
Neil Lathwood
53a1730fc7 Fixed PagerDuty alert to show rule name + device as summary (#9213)
* Fixed PagerDuty alert to show rule name + device as summary

* Update Pagerduty.php
2018-09-19 02:28:50 -05:00
Denis
2978e52edd Modified timestamp sent to nagios transport in order to fix an issue with flapjack
…ith flapjack

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-09-04 14:08:51 +01:00
Neil Lathwood
e20152ec30 Fixed slack options not showing in the webui (#9107)
* Fixed slack options not showing in the webui

* Update config extraction too
2018-08-30 20:58:42 +01:00
Neil Lathwood
e603fcfd6f Converted PagerDuty to new transport format (#9092)
* Converted PagerDuty to new transport format

* Attempt at oauth for transports

* clean

* missing images

* reverted wrong file. phpstorm saved me...

* fix typo

* Updated to help the display

* Fix validation error, start to try to send alerts.
Editing the transport, deletes the service_key...

* Ignore hidden config options

* Fix up api call, proper feedback.

* hide oauth field in print list
2018-08-29 09:44:29 -05:00
Alexey Medvedev
e448190a68 Added transport modules Kayako Classic and SMSFeedback (#9027)
Hello! I've made a first version of Alert Transporting module for Kayako Classic Servicedesk. May be it is possible to use with Kayako OnPremise version (not sure).

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-08-21 22:41:59 +01:00
Neil Lathwood
bc2fe6aeb1 Tidy up some transport code from previous pr (#8927) 2018-08-17 22:38:00 +01:00
Neil Lathwood
760fa10cb3 Update Telegram.php (#9000) 2018-08-08 16:43:10 -05:00
Nash Kaminski
f3c316f72d Correct config template for API transport (#8991)
Due to bug in the implementation of the alert transport mapping introduced in #8660  , the API transport is unable to be configured via the new interface. Only the 'get' method is displayed in the UI and the defined validation is expecting uppercase "GET" or "POST" as the method, making it impossible to configure the API transport.

This change corrects the name to option value mapping to uppercase GET and adds back the POST method option. 

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [X] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-08-06 22:50:06 +01:00
Tony Murray
deb405fac9 Alert transport fixes (#8967)
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-07-31 21:53:03 +01:00
Tony Murray
e4ecd1eea4 Fix default template (#8964)
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [ ] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-07-30 21:12:42 +01:00
Neil Lathwood
cde15ce753 Fixed pushbullet transport (#8963)
* Fixed pushbullet transport

* Updated return value
2018-07-29 22:52:53 +01:00
Richard Mayhew
d824e8db62 Removed the static Slack Priority field (#8936)
* Removed the static Priority field

* Update Slack.php
2018-07-24 16:31:14 -05:00
Paul Heinrichs
a703423df8 Fix typo in clickatell (#8937) 2018-07-24 12:01:16 -05:00