* 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
* 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
* 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
* 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.
* 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
* 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.
* 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
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.
* 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
* 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
* 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
* 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
* 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
* 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.
* 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