Commit Graph

85 Commits

Author SHA1 Message Date
SpaceDump
25920be1db Added fix for escaping underscore while using Markdown (#11070)
* Added fix for escaping underscore while using Markdown

* Corrected indentation
2020-01-26 08:05:49 -06:00
louis-oui
a384fc2830 Do not update alert timestamp when updating a triggered alert (#10907)
* Do not update alert timestamp when updating a triggered alert

* Only update alerts timestamp if alert is triggered or recovered

* db schema

* db schema

* cleanup timestamp update
2020-01-22 15:01:25 -06:00
louis-oui
e235c59d2f Add alert rule option to invert devices and groups "map to" list (#11038)
* Add alert rule option to invert map to
* Update 2019_12_17_151314_add_invert_map_to_alert_rules.php
* fix invert map to does not work if several groups are set in map to
* Clarify labels
* fix invert map to at rule creation
* clarify invert label
* Fix device in map to - not group
* dummy commit
2020-01-19 14:55:51 +01:00
Kevin Krumm
10b42137e9 Revert "Add alert rule option to invert devices and groups "map to" list (#10954)" (#11036)
This reverts commit 7a8d0b9e09.
2020-01-16 08:42:53 +01:00
louis-oui
7a8d0b9e09 Add alert rule option to invert devices and groups "map to" list (#10954)
* Add alert rule option to invert map to

* Add alert rule option to invert map to

* Update 2019_12_17_151314_add_invert_map_to_alert_rules.php

* fix invert map to does not work if several groups are set in map to

* fix invert map to does not work if several groups are set in map to

* fix invert map to does not work if several groups are set in map to

* Clarify labels

* Clarify labels

* Clarify labels

* Clarify labels

* fix invert map to at rule creation

* clarify invert label
2020-01-15 11:40:01 -06:00
louis-oui
0e3c472018 "Disable alerting" on device disables alert rules check (not just alert transport) (#11015)
* Fix disable notify

* Fix disable notify

* Disable all alerting

* fix db migration

* fix db migration

* fix db migration

* Add autoclearing active alerts if disable alerting set

* Add autoclearing active alerts if disable alerting set

* fix check

* Device in gray if disable_notify is set - not ignore tag
2020-01-09 18:46:52 -06:00
SourceDoctor
b125dd1eae get colors from getColorState function (#10955) 2019-12-27 10:57:29 +01:00
SourceDoctor
60f33f79b6 get colors from getColorState function (#10956) 2019-12-27 10:56:56 +01:00
SourceDoctor
a1f4b1b88f Get Colors from getColorState function, for Transport Slack (#10957) 2019-12-18 23:49:22 +01:00
SourceDoctor
b24bf02c2a Move alert state color definition to config (#10958) 2019-12-18 11:08:32 +01:00
SourceDoctor
f835198a45 Globalize getColorForState function (#10944)
* globalize getColorForState function
2019-12-17 22:27:08 +01:00
cjwbath
c2603e789f More appropriate state colours for MS Teams alerts (#10911)
* More appropriate state colours for MS Teams alerts
* Split colour lookup to new function to keep Code Climate happy
* Remove bits of whitespace
2019-12-13 16:51:34 +01:00
mendoza-conicet
0ea346113a Add Headers and body to API Transports (#10614)
* Add Headers and body
add PUT Method

* fix check length of headers

* bad commit

* style check

* better body description

* Descr and RFC enforcement on 'PUT' and body

Only PUT can accept a statically defined body. GET will ignore it (RFC) and POST body is generated with the parameters.

* Process the variables as well for headers

* Update Api.php

* update docs
2019-11-01 09:00:26 +01:00
PipoCanaja
d72c722075 Alerts - Add features + serial in alerts-> table (#10747)
* Alerts - Add features + serial for device

* doc
2019-10-26 00:28:36 +00:00
Tony Murray
fe0506c04c Add missing import (#10741) 2019-10-24 13:37:18 +00:00
Ngo Quang Hoa
caaa6a97bc Update Alerta.php (#10684) 2019-10-21 00:50:11 +00:00
hartred
3c25551a93 Update Slack.php add emoji and username support (#10695)
* Update Slack.php add emoji and username support

* Update

* Update
2019-10-16 23:52:36 +02:00
Tony Murray
7482422614 When sending email alerts use CRLF for windows clients (#10563)
* When sending email alerts use CRLF for windows clients

* Convert hard \r\n into line return in templates

* there is no down really
2019-10-02 14:08:10 +00:00
seros1521
2db29a325f Add procedure URL to alert templates (#10609) 2019-09-24 13:08:22 +02:00
Shao Yu-Lung (Allen)
9ac70037bb Add LINE Notify Alert Transport. (#10495)
* Add LINE Notify Alert Transport.

* Fix code style.

* Update document.

* Update Linenotify.php
2019-09-05 04:30:53 +00:00
Lee Keitel
85492d245d Catch exceptions generated by alert transports (#10565)
* Catch exceptions generated by alert transports

The alert.php script would completely die if a single alert
transport generated an exception. For example the API transport
if CURL couldn't connect to the api endpoint. The script
should attempt to send alerts to all working transports and not
die because a single transport fails.

* Move alert transport creation into try block

Catch any potential exceptions during transport creation.
None of the transports currently implement __construct()
but the DB could throw and in the future there may be
a transport that does implement it.
2019-09-05 02:13:32 +00:00
SniperVegeta
e0a33021da Update RunAlerts.php (#10552)
Added for {{ $alert->id }}
2019-08-22 14:06:44 -05:00
Tony Murray
e99f421511 Remove legacy auth usage of $_SESSION (#10491)
* Remove auth use of $_SESSION

Will break plugins that depend on $_SESSION, Weathermap was already fixed.
Port them to use Auth::check()/Auth::user()/Auth:id()

* revert accidental replacement
2019-08-05 14:16:05 -05:00
Tony Murray
36a5da00ca Fix missed alert function renames (#10452) 2019-07-18 11:05:43 -05:00
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