Commit Graph

13 Commits

Author SHA1 Message Date
Jellyfrog
77c531527c Apply fixes from StyleCI (#12117)
* Apply fixes from StyleCI

* Disable style check
2020-09-21 14:54:51 +02:00
Tony Murray
0a5c3cc747 Fix Device::isUnderMaintenance() add location relation 2020-06-14 12:39:10 -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
SourceDoctor
b89eb22cd5 Enumerate AlertState (#11665)
* Enumerate AlertState

* fix typo

* add missing use's

* .

* .
2020-05-23 21:14:36 -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
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
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
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
seros1521
2db29a325f Add procedure URL to alert templates (#10609) 2019-09-24 13:08:22 +02: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
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