Commit Graph

52 Commits

Author SHA1 Message Date
ottorei
69397ea70f
ISIS-adjacency polling support (#12461)
* init

* Add adjacency polling support

* Format messages

* Fix prints

* Apply fixes from StyleCI

* Fix schema

* Schema fix

* Alert rule example

* Remove display format

* Change option order

* Add test data

* Add test data

* Test data

* Review fixes

* Remove duplicate MIB-file

* Add cleanup

* Fix

* Print fix

* Remove extra cleanup

* Revert "Remove duplicate MIB-file"

This reverts commit 4b3cf8127c.

* Remove unneeded MIB-files

* Add check for empty array

* Apply fixes from StyleCI

* Review fixes

* StyleCI

* StyleCI

* Apply fixes from StyleCI

* typo

* Update function calls on pages

* Linting fixes

* Apply fixes from StyleCI

* Discovery module

* Add discovery module

* Apply fixes from StyleCI

* Update example alert rule

Co-authored-by: ottorei <ottorei@users.noreply.github.com>
Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2021-06-10 19:42:34 -05:00
Tony Murray
027ff0ebee
Revert #12321 (#12786)
Revert #12321
You can't import raw SQL like that.
2021-04-23 08:17:51 +02:00
TheGracens
44e52e5a8d
Notify if a sensor has been deleted (#12755) 2021-04-21 21:52:42 -05:00
Meh
c53dec796e
Added devices unpolled alert rule template (#12321)
* Update alert_rules.json

Added devices unpolled alert template

* Update alert_rules.json

* Use coalesce to provide default value

* Update alert_rules.json

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-11-20 22:22:45 -06:00
Nate Byers
2b0643086b
Corrected alert_rules.json file to container proper JSON. (#12033) 2020-08-26 07:54:14 +02:00
Tony Murray
87754b6b48
Clean up default alert rules (#12014)
* Disable rules from the default list
Too many rules in the default, disabling the customoid rules.
It is easy to add from the collection.  Any other suggestions?

* remove bgp and default false
2020-08-24 08:12:00 +02:00
TheGreatDoc
8235860ab8
QNAP NAS - Added state rules to collection (#11931) 2020-07-14 17:37:25 +02:00
SourceDoctor
6cceeb43f0
Fixing wrong Alert Rule Operator (#11842) 2020-06-20 11:55:22 +02:00
SourceDoctor
2a8e39d55e
UPS Alert Rule Fix (#11836) 2020-06-18 18:15:27 +02:00
yon2004
089e97dc51
Update alert rules (#11838)
fixed a error with AND and && for UPS-NUT rules
2020-06-18 15:35:55 +02:00
yon2004
953def1518
Added discovery for ups-nut status (#11606)
* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Update linux_ups-nut.snmprec

* Fixed UPS states so making alerts easier.

* Fixed

* Actually Fixed it

* Added alert rules for UPS-NUT
2020-06-18 09:43:11 +02:00
cjwbath
3c850fbcb2
Fix the PANOS HA state check alert rule from collection 2020-05-22 11:28:41 +02:00
SourceDoctor
5deda8646a
Alert Collection Rule - APC UPS Diagnostics Test Result (#11292) 2020-03-16 12:59:07 +01:00
SourceDoctor
206ca81ae0
Alert Collection Rule fix for APC on Battery Power (#11291)
* Builder View Fix for Collection Selector

* APC Battery Power Alert Rule fix

* .

* .
2020-03-16 12:30:07 +01:00
SourceDoctor
a9bf92057f
Ping Latency Check to Alert Collection (#11139) 2020-02-13 00:52:46 +01:00
Kevin Krumm
3db0542458
Default alert rules remove Devices up/down (#11124)
* Default alert rules remove Devices up/down

removed the Devices up/down as the default alert rule. This can be confusing to new users. We already have the alert for SNMP and one for ICMP defaulted.

* Update alert_rules.json
2020-02-12 19:54:00 +01:00
Joseph Tingiris
c2dfe7b21c
Renovated Alert Rules (#11115)
* Change select order from id to name

* added example icmp/snmp down rules given by @kkrumm1

* Renovated Alert Rules

* Defaulted sort by name
* Moved top buttons and results selector outside of table and aligned them with pull-left and pull-right
* Collapsed '#' (ID) into 'Type' and added titles for the icons
* Added Devices and Transports columns for each rule
* Moved Extra column next to transports
* Added icons for Enabled when a user does not have global admin
* Changed row_# variable to rule_id_#
* Some 'else' cleanup
* Added various title tags for more information when hovering
* Moved pagination outside of table and align it with pull-left and added a bootgrid style summary pulled-right
* Added table & th tags for bootgrid (but didn't turn it on)

* code climate, round 1

* code climate, round 2

* add hrefs for device & device group edit

* added trailing slash for device-groups/../edit/

* prevent #name conflict with transport modal

* add hrefs for transport & transport group edit

* use popover consistently

* code climate, round 3

* removed unused variables

* code climate, round 4

* popover variables

* reload after successful delete

* more informative feedback

* use toastr, not #message, & don't reload

* added license header & fail faster if not admin

* use (more informative) ajax error message

* delete confirmation with alert name in the modal

* print each device per line

* add href for all devices

* refresh status & enabled data-content when/if a rule is turned on/off

* use DRY style per @SourceDoctor (& my) preference); codeclimate meh

* point devices popover to the right
2020-02-10 02:06:12 +01:00
Joseph Tingiris
79bdbe91b5
Show when a device was added and last discovered (#11104)
* Add inserted column to devices table

* Added schema for devices.inserted

* Show when a device was added and last discovered

* Added collection rule for "Device added within the last 60 minutes"
2020-02-05 14:06:43 -06:00
louis-oui
934260cc75 Feature: Custom OID polling and graphing (#10945)
* merge

* fix db migration

* fix new auth

* fix new auth

* fix new auth

* fix new auth

* fix db schema tests

* fix polling customoid

* fix polling customoid

* fix graph

* fix graph

* fix graph

* fix CI

* fix CI

* always update prev value

* typo
2019-12-18 18:17:21 -06:00
Hayden
16287d8674 Update alert rules with backticks (#10902)
* add backticks to past_5m macros to parse correctly in GUI
* added missing greater-than to syslog rule
2019-12-03 23:10:17 +01:00
Timothy Willey
a000b4a6de ArubaOS - fix client count polling, add ap count polling. (#10231)
* fix client count polling, add ap count polling.

* Set low warning/critical thresholds for AP count sensors

* Add Aruba AP Count Warning and Critical Alerts to collection, lint alert_rules.json

* add newline at end of alert_rules.json

* add/update tests/data/arubaos*.json test data
2019-05-23 10:17:09 -05:00
Lucas Dousse
0b1c737659 Add conditions for bgp admin status = stop (#9773)
I propose this change so that bgp sessions down volunteer is not on alert
2019-02-04 08:52:26 -06:00
Kevin Krumm
8f07eceda3 Alert Rules: fix for critical and warning rule (#9688)
* Alert Rules: added sensor alert

To sensor alert Critical and Warning. 
sensors.sensor_alert = \"1\"

* Update alert_rules.json
2019-01-19 09:26:05 -06:00
Tony Murray
a97ccda0b9
Fix wireless sensor edit messages and collection alert rule (#9624)
* Fix wireless sensor edit messages and collection alert rule

* fix alert rule quotes

* json type
2019-01-09 19:40:27 -06:00
VVelox
c5bb60907c add app for getting status of TCP connections for specified services (#8090)
* add the poller for portactivity

* add the ability to get monitor ports for portactivity

* add the graphs for displaying stuff for the portactivity app

* add the portactivity app page

* update the docs for Portactivity

* remove extra line

* minor doc update for Portactivity

* add update_application line

* convert to use json_app_get

* convert curly brackets to square

* style fix

* remote error, errorString, and version after they stop being important so they are not processed

* add alert rule examples

* add the poller for portactivity

* add the ability to get monitor ports for portactivity

* add the graphs for displaying stuff for the portactivity app

* add the portactivity app page

* update the docs for Portactivity

* remove extra line

* minor doc update for Portactivity

* add update_application line

* convert to use json_app_get

* convert curly brackets to square

* style fix

* remote error, errorString, and version after they stop being important so they are not processed

* add alert rule examples

* remove dump of get_portactivity_ports function added during rebase

* update to the current json_app_get

* add portactivity snmprec

* add the portactivity test data

* whoops bad merge when rebasing... fix

* minor formatting cleanup and add a missing comma

* fix some odditities with what one of the tests is doing

* whoops... include the use for the exception

* set the response to okay

* attempt to make snmpsim array check happy again

* the json now lints

* more making metric testing happy

* one more update to make travis-ci happy

* now flattens arrays also add array_flatten

* rename array_flatten to data_flatten as pre-commit chokes on it as laravel has something similarly named

* go through and properly add all the metrics

* tested with the newest one and it works

* whoops, clean up json and remove prototype that was used when putting it together

* doh! make it happy with laravel now

* see if a minor changing in formatting for the numbers makes the polling unit test happy

* order them properly

* remove a comma

* a few more minor fixes
2018-11-22 09:05:38 -06:00
Steve Johnson
ac3fa28f7e Added Citrix Netscaler HA sensors and alerts (#8800)
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-25 22:51:06 +01:00
Neil Lathwood
54284800c7
Fixed alert rules that use columns in value (#8925)
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-21 10:07:17 +01:00
Tony Murray
411a5db269 fix: Fixed Poller taking too long -> device took too long alert rule (#8622)
* Fix poller taking too long rule

* Update alert_rules.json
2018-05-13 20:02:57 +01:00
Tony Murray
6c04f92877 fix: Fixed port_usage_perc macro (#8625)
We cannot check if the port is enabled inside the macro because it casts the usage percentage to a boolean (1 / 0)

Remove redundant macros.port in rule collection (was check 3 times before this)

Broken by #8511
2018-04-27 14:27:05 +01:00
Neil Lathwood
03076c4025
feature: Added new alert rule builder UI and rule mapping UI (#8293)
* feature: Added new alert rule builder UI

* Updated to export sql queries

* More updates

* more changes

* removed debug

* fix scrut

* Updated to include import options + various other fixes

* fix rule

* Populate name from collection rules.

* Fix default rule import
Allow new and old style rules in the collection.
Don't add new yet as I'm not sure GenSQL() is working.

* Fix GenSQL call

* Extract filter building to class so it is nicely contained in one place

* moved schema

* some fixes and tweaks

* travis fixes

* Some more features / updates

* Fix up my mistakes when adding default rules

* Use a modal for new alert (Incomplete)
Larger dialog!!
Remove page loading stuff.

Working:
Loading rules, resetting dialog, importing from collection.

Not working yet:
select width
device limited rule access? don't know what this is...

Lots of unused stuff to delete...

* reload "table" after save

* fixed editing rule

* Auto select2 width

* Reload window on save

* Restore per-device alert. Remove debug.

* Small cleanups. Rule Name first.

* Restore button to button type. Rename schema.

* Fixes: wrong command to reload window, remove extra attributes, rule is never passed

* Fixed old rule editing

* some small updates for old imports

* travis update to use trusty

* maybe travis fix

* Ability to set alert rule mappings on the rule edit screen

* pip installs one line, no quiet for deploy

* update schema def

* Fix style and some copyright headers

* fix docs missing file

* Allow new versions of snmpsim and libraries

* Parser WIP

* Fix default rules insert

* reorganize

* Legacy import first draft done

* Implement saving
Skip translation to sql for now

* Working on glues

* small rule collection fix

* Working on glues

* Working on glues

* Docs updates + small UI changes

* Parser WIP

* reorganize

* Legacy import first draft done

* Implement saving
Skip translation to sql for now

* Working on glues

* Working on glues

* Working on glues

* Add table mapping, should move to it's own class

* WIP

* Glue working!!

* Extract Schema class

* Some final touches.
revert alerts_rules.json for now.

* Finish up initial implementation
Needs more tests

* Fix a few places

* small doc updates

* Fix finding tables in grouped rules.

* remove unused code

* code format fixes

* Some quick tests for Schema
Simplified output for findRelationshipPath. Always includes start and target in the result.
This simplifies a lot of code in QueryBuilderParser.php
This also always loads the target table data now (which we want)

* Make bill_id the PRIMARY index for the bills table

* Load macros from a json file in misc instead of the database.

* Fix whitespace and wrong key for collection.

* Handle IN properly when generating SQL

* Fix glue (devices.device_id = ports.port_id) is incorrect :D
Show ALL tables we can resolve relationships for in the query builder filter.

* Remove all macros from the database
Remove insert statements, leave updates to update user's existing rules.
2018-03-14 20:25:19 +00:00
sorano
1d45d4b73d fix: MySQL query in alert_rules.json (#8300)
Fix the:
MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= (DATE_SUB(NOW(),INTERVAL 5 MINUTE))  &&  syslog.msg REGEXP ".*authentication f' at line 1 (SELECT * FROM syslog WHERE (syslog.device_id = '149') && (syslog.timestamp > = (DATE_SUB(NOW(),INTERVAL 5 MINUTE))  &&  syslog.msg REGEXP ".*authentication failure.*"  ))
2018-02-27 09:22:59 +00:00
FTBZ
2755763758 device: Added suspended state to PAN OS (#8125)
* device: add suspended state to PAN OS

* remove bad rules, solution in other PR
2018-01-25 21:08:22 +00:00
Chip Gwyn
f2088a505a fix: Palo Alto HA Alert Rule references non-existent column in sensors table (#8138)
column in the sensors table.  However there is no "type" column.  This should be "sensor_type".  This is indicated
by the error in the logs:

`MySQL Error: Unknown column 'sensors.type' in 'where clause' (SELECT * FROM devices,sensors WHERE (( sensors.device_id = devices.device_id ) && devices.device_id = '102') && (devices.os = "panos" & sensors.type = "panSysHAState"  &&  sensors.sensor_current = "1"  &&  sensors.sensor_prev = "2"  ))
`

Updated the rule to reference the correct column.
2018-01-24 09:18:28 +00:00
Kevin Krumm
88ecbbff24
alert rules: added Dell iDRAC alert rules (#8010)
* alert rules: added Dell idrac alert rules

to the alerts collection.

* Update alert_rules.json

* added iDRAC

fixed iDRAC naming.

* added iDRAC Global System Status Alert
2018-01-05 16:06:49 -06:00
Kevin Krumm
f7aed1e203
rules: deafult alert rules, updated the name for (#7861)
Sensor Over/Under to better help users understand where this alert is coming from. :)
2017-12-06 08:04:31 -06:00
Tony Murray
5405498ed6 alerts: Adde generic alerts for state sensors (#7812)
* feature: Generic alerts for state sensors
A bit of a hack, but gets the job done. Perhaps someone can refactor the ResolveGlues() function sometime to make it better.

* Fix mistakes

* Add docs and collection rules, critical enabled by default

* moved schema file to 221.sql
2017-12-02 23:03:36 +00:00
Kevin Krumm
b6abf158a0 alerting: Added more rules to collection (#7797)
Comware Sensors PSU, Fan
Cisco Sensors Fan, PSU
UBNT EdgeSwitch Chassis State
2017-11-26 14:32:32 +00:00
Kevin Krumm
597af28093 alerts: Added in dell server sensors alert rules to the collection (#7647)
* alert rules: alert rules for dell servers

added in dell alert rules to the collection.

* Update alert_rules.json

fixed the ,

* Update alert_rules.json

fixed the "rule":

* Update alert_rules.json

minor fixes and added in MAC address alert. This could be useful when searching for missing devices or rogue devices on your network.

* Update alert_rules.json

removed mac address rule.
2017-11-07 20:21:37 +00:00
FTBZ
aef1a5f28a newdevice: Added state sensors for Palo Alto Networks firewall (#7482)
* Features: Add state sensors for Palo Alto Networks firewall

* Removed the MIBs files

* fix: Removing echo

* Migrate to YAML

* Migrate to YAML

* Change passive to unknow
2017-11-02 21:41:51 +00:00
FTBZ
2e849e1b02 feature: Added more rules for the alert collection (#7430) 2017-10-04 21:02:17 +01:00
kkrumm1
01a48496c8 features: Added HP iLo and OS-updates rules to the rule collection (#7423)
* features: added even more rules to the collection

Added in,
HPE iLo Server drive degraded/failure
HPE iLo Server Power Supply degraded/failure
HPE iLo Server fan degraded/failure
HPE iLo Server CPU degraded/failure
HPE iLo Server Memory degraded/failure
Applications OS-Updates, New Updates Available

* Update alert_rules.json

* fixed some line issues and spaces

* fixed syntax error

* Update alert_rules.json

fixed a ,

* Update alert_rules.json

fixed mistake with {

* Update alert_rules.json

fixed typo at the end
2017-10-04 08:21:16 +01:00
FTBZ
e16900456c feature: Added alert rules for RFC1628 UPS to the rule collection (#7415) 2017-10-03 21:34:12 +01:00
kkrumm1
777eb1f823 feature: Added more rules to the collection of alert rules (#7363)
* Features: Updated collection of alert rules

Added in the following to the Alerts Collection,

Syslog, received Alert Priority Message
Syslog, received Emergency Priority Message
APC UPS Battery Needs Replacement
APC UPS Switched to Battery Power
APC UPS in Hardware Failure Bypass Mode
APC UPS in Emergency Static Bypass Mode

* Update alert_rules.json

* Update alert_rules.json

fixed changes per request.

* Update alert_rules.json

fixed "white spaces and spaces"

* Update alert_rules.json

Fixed spaces and tabs... rookie mistake.
2017-09-20 22:58:24 +01:00
Neil Lathwood
707b6c6954 feature: Added support to cisco sensors to link them to ports + macro/docs for alerting (#6959)
* feature: Added support to cisco sensors to link them to ports + macro/docs for alerting

* renamed sql
2017-08-04 19:37:50 +01:00
Etz
115515f966 fix: Service warning/critical alert rules (#7105)
Name and rule statements were swapped.
2017-08-02 09:20:45 -05:00
kkrumm1
09103b2067 feature: Added syslog auth failure to alert_rules.json (#6847)
feature: Added syslog auth failure to alert_rules.json (#6847)
2017-06-17 15:03:18 +01:00
Florian Beer
7442f8d40d feature: Added service alert rules (#6772)
* Add service alert rules

https://community.librenms.org/t/configuring-alerting-via-nagios-plugins/1389/5?u=florianbeer

* Fix escaping

* Update alert_rules.json
2017-06-02 19:51:45 +01:00
Tony Murray
2dd44fdfdf refactor: move default alert rules into the collection (#6621)
* refactor: move default alert rules into the collection
Also adds the wireless rules to the default set.

* Added additional defaults to extra

* Fix up the extra value
Also, missed `rule` column when creating default rules
2017-05-13 09:24:47 +01:00
Tony Murray
4c0412b14d feature: Wireless Sensors Overhaul (#6471)
* feature: Wireless Sensors
Includes client counts for ios and unifi
Graphing could use some improvement.
Alerting and threshold ui not implemented

WIP: starting OO based wireless sensors.

Class based functionality working
remove old functional files
add schema file

discovery needs to be enabled, not polling

fix up schema

fix Unifi discovery not returning an array

Add some debug when discovering a sensor.
Fix style.

Add missing semicolin

Add a null object (Generic) for OS.
Fill out some phpdocs

Re-organized code
Each sensor type now has it's own discovery and polling interface
Custom polling tested with Unifi CCQ

Left to do:
Implement UI (Graphs and Custom thresholds)
Alerting
Testing

Fix event message text

Remove runDiscovery and runPolling from OS, they are unused and don't belong there.

Cleanups/docs

Missed this file.

Remove the requirement to fetch the current value to check validity.
Do that automatically if current is not specified
A few cleanups here and there

First pass at graphing.
device_ and wireless_ graphs added.

Add RouterOS support

Singleton OS instance isn't required right now.
Remove that to allow some memory to be freed.

Add wireless to the device list metrics.
Make all metrics clickable

Tweak graphs a bit

Implement limit configuration page.
Use sensors page as common code instead of duplicating.
Clean up some javascript interactions:  Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value.
Add some wireless alert rules to the library.

Add documentation.

Add unifi client counts by ssid in addition to radio.
Optimize Sensor polling a bit.

Add HP MSM clients support (for full controller)
Fix function accessibility

Formalize the discovery and poller interfaces.

Add Xirrus clients and noise floor
move module interfaces to a more appropriate place.
push caching code up to os, unsure about this do to the limitations

No point in selectively enabling wireless discovery.  We only discover if the device supports something.

Add RSSI, Power, and Rate.
Add these sensors for Ubnt Airos.
Clean up some copyrights.

Reduce the amount of files need to add new types.
Leave graph files for consistency and to allow customization.

Remove the old wifi clients graph completely.
ciscowlc should have improved counts (total and per-ssid)

Schema didn't get added.

Impelement the rest of the AirOS sensors
Reformat and re-organize the Airos.php class.

Add several UBNT AirFiber sensors

A few fixes add links to the section headers

Add HP MSM mibs.

* Schema file got dropped in rebase.

* Add wireless menu to view sensors across all devices.
Icons in the menu need help :/

* Add HeliOS, Mimosa, and Siklu support
Sensors added SNR + Noise

* Add power and utilization to Unifi

* Update polling to prefetch all sensor data in a few snmp requests as possible

* Add Extendair: tx+rx power, aggregate rate, frequency

* Add a check for duplicate sensors in discovery.  Just print an error for now.

* Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed)
Fix an incorrect link in the wireless sensors table

* Add error rate and change all bps and Hz to use si units

* Fixes to limits and frequency display

* Fix overview graph frequency display
A few decimal place tweaks

* Don't allow switching sensor and wireless-sensor graphs, it doesn't work.
Change individual distance graphs to use si units

* Go through the OS and make sure I got all the sensors I can (probably missed some still)
Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS.
Message to help developers adding supports that don't return an array from discover functions.

* Fix some issues

* Remove noise and signal for now at least
A couple more fixes
Add a notification

* Oopsie

* Bonus AirFiber sensors
2017-05-01 23:49:11 -05:00
towster
fea705b7f5 alerts: Added new alert rules to collection (#6166)
Added Interface Errors Rate greater than 100
Added Device discovered within the last 60 minutes
2017-03-15 15:41:12 +00:00