Commit Graph

111 Commits

Author SHA1 Message Date
Jellyfrog
20b4215204 Swich links to https (#12511)
* Switch librenms links to https

* Convert librenms links in comments

* Switch gnu.org url to https

* switch php urls to https
2021-02-09 00:29:04 +01:00
abrezinsky
240edd2143 Use a proxy server for the PagerDuty transport. (#12294)
* Use a proxy server for the PagerDuty transport.

We don't use the get_guzzle_proxy() function since tcp:// doesn't work
with all of the HTTP transports that Guzzle supports.  Instead we use
the standard get_proxy() function.

Tested against Squid

* formatting only
2020-11-04 15:03:48 +01:00
Yuwei Ba
fd2c1361ef Update Telegram.php (#12228)
Return Telegram response body when failed so users will know where went wrong, bad template etc.
2020-10-19 09:27:01 -05:00
Jellyfrog
29f45ca352 Apply fixes from StyleCI (#12124) 2020-09-21 15:59:34 +02:00
Jellyfrog
0d56bbd946 Apply fixes from StyleCI (#12123) 2020-09-21 15:51:53 +02:00
Jellyfrog
77c531527c Apply fixes from StyleCI (#12117)
* Apply fixes from StyleCI

* Disable style check
2020-09-21 14:54:51 +02:00
thomcatdotrocks
dfab530525 Matrix txnid fix (#12057)
* Fix Matrix alerting txnid

This fixes the issue I brought up in #12018.  I can confirm that I now get a new message from the LibreNMS bot every time I test my Matrix transport.

* Update AUTHORS.md
2020-09-04 16:38:19 +02:00
Raphael Dannecker
73b7636c9f Matrix alert transport (#12018)
* Added Matrix as alert-channel (Feature request #4927)

* formatting

* Dokumentation of matrix-transport

* Matrix Server-URL

* Formatting
2020-08-20 12:04:17 +02:00
kleinem86
a4f5af069c Added Proxy support for Api Transport (#11968) 2020-07-29 16:00:55 +02:00
Tony Murray
76a7ea1a63 Fix alert last modified timestamps
mysql timestamp columns do not accept timestamps
2020-06-15 22:24:14 -05:00
Tony Murray
0a5c3cc747 Fix Device::isUnderMaintenance() add location relation 2020-06-14 12:39:10 -05:00
Tony Murray
13ade9ab6c Merge branch 'master' into alerts-carbon 2020-06-12 07:48:51 -05:00
SourceDoctor
125ecb4bde Eventlog Application Alert in it's Severity Colour (#11660)
* Eventlog Application Alert in it's Severity Colour

* use 'use'

* enums

* enum key list

* typo fix
2020-06-08 10:56:45 +02:00
pepperoni-pi
28ae37c406 Added ability to use JSON directly in Msteams Transport (#11129)
* Added ability to use JSON directly in Msteams Transport

* Update Transports.md

* Update Msteams.php

* Update Msteams.php

Added boolean to fix test transport button

* Update Templates.md

Added JSON example and modified titles slightly.

* Update Templates.md

Moved MS Teams examples under "Examples" header since they are no longer formatted in HTML

* Update Templates.md

* Update Templates.md

* Update Msteams.php

changed condition to use $obj['id'] rather than $obj['msg']

* Update Msteams.php
2020-06-04 22:18:49 -05:00
nepeat
736a6a419c Make the Discord transport more formatted for Discord. (#11461)
* Make the Discord transport more formatted for Discord.

* Generate the fields using a function for cleaner code.

* Handle cases where the elapsed time does not exist in the object.
2020-06-01 02:04:12 +02:00
SourceDoctor
b89eb22cd5 Enumerate AlertState (#11665)
* Enumerate AlertState

* fix typo

* add missing use's

* .

* .
2020-05-23 21:14:36 -05:00
VTS
60552d96ae Copy and modify the syslog transport for sending alerts to Splunk in an easy to parse format (#11176)
* Create Splunk.php

* add documentation

add documentation for splunk transport rule

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-05-11 23:11:45 -05:00
spencerryan
39ef4dc503 Do not delay alert recovery notifications (#11555)
Skip the delay logic for recovery.
2020-05-06 23:02:43 +02:00
spencerryan
9b22bcc5b8 Send Device group membership to Pagerduty (#11522)
* Send Device group membership to Pagerduty

Send device group membership to pagerduty. This allows routing (event rules) on the Pagerduty side to make decisions based on group membership inside LibreNMS

* Simplified changes

Rolled all changes into one line per @murrant sugguestions
2020-05-03 13:22:48 +02:00
spencerryan
a545c87ad5 Allow manual configuration of Pagerduty Integration Key (#11519)
* Allow manual configuration of Pagerduty Integration Key

Pagerduty supports a global event queue per account and provides the integration key for it. This allows you to enter the key directly and bypass the OAuth workflow if desired.

* Update Pagerduty.php

Fixed spacing.
2020-05-01 22:03:11 -05:00
Heath Barnhart
10660261df pagerduty transport uses template message (#11459) 2020-04-21 23:48:23 +02:00
Tony Murray
1c08c11a77 Remove Laravel helpers (#11428)
* Remove Laravel helpers

* Replace qualifier with import
2020-04-18 00:37:56 +02:00
Adam Bishop
492ab32b6d Add support for sending events to Sensu (#11383)
* Add support for sending events to Sensu

Sensu is an alerting and monitoring service (and much more) that has a
nagios compatible check API.

This transport translates LibreNMS alerts into Sensu events, and sends
them to the agent API running on the same host as the poller.

The transport has a few options, but none of them are required - if the
Sensu agent is correctly configured, alerts will be sent as soon as the
transport is enabled.

There's a fair amount of code, as I've tried to translate as much data as
possible between LibreNMS and Sensu.

* Update Transports.md

* If alerted is 0, send an "ok" alert dated rrd.step / 2 seconds ago

This makes Sensu aware of the last time the check ran successfully (ish).
If we don't send the initial "ok", Sensu will either display 'unknown',
or an incorrectly high duration for the incident.

Alerted gets set to 1 after the first alert is sent.

We choose rrd.step / 2 as:
 * rrd.step is the maximum time ago the check could have succeeded
 * we halve it, so that if a check is flapping, it is not masked

Basically, we guess that the check fails around halfway through the time
since the poller last ran.

* Add additional metadata

* Improve codeclimate slightly

* Consider names that are 2 or 3 components long
2020-04-11 14:29:13 -05:00
Tony Murray
4d5ebfb561 Alert Rules use Carbon
Use carbon for time queries, need to be careful of timezone quirks.  Timestamps won't have that issue
2020-04-07 00:02:16 -05:00
SourceDoctor
5bfc44f812 Location based Alert Rule (#11128)
* Location base Alert Rule

* travis fix
2020-02-12 12:53:26 -06:00
Joe Clarke
0a34322877 Do not strip tags when markdown is in use. (#11075)
Markdown supports limited HTML tags, which can help enrich messages.
Additionally, eliminate extra whitespace when markdown is used as that
will have weird output effects.
2020-01-29 05:59:23 -06:00
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