45 Commits

Author SHA1 Message Date
466b5a35a8 Added ability to set a custom SQL query for alert rules. (#9094)
* Added support for AVG in rules

* More updates

* Final work to have advanced sql queries

* Added missing use

* Fix exception when invalid json is passed

* Fixed api for alert rules

* updated docs
2018-09-19 07:47:45 -05:00
32a7c50189 Use Laravel authentication (#8702)
* Use Laravel for authentication
Support legacy auth methods
Always create DB entry for users (segregate by auth method)

Port api auth to Laravel

restrict poller errors to devices the user has access to

Run checks on every page load.  But set a 5 minute (configurable) timer.
Only run some checks if the user is an admin

Move toastr down a few pixels so it isn't as annoying.

Fix menu not loaded on laravel pages when twofactor is enabled for the system, but disabled for the user.
Add two missing menu entries in the laravel menu

Rewrite 2FA code
Simplify some and verify code before applying

Get http-auth working
Handle legacy $_SESSION differently.  Allows Auth::once(), etc to work.

* Fix tests and mysqli extension check

* remove duplicate Toastr messages

* Fix new items

* Rename 266.sql to 267.sql
2018-09-11 07:51:35 -05:00
b0968e850c webui: Changed alert rule triggered icon from X to ! (#8760)
![image](https://user-images.githubusercontent.com/39462/40490177-981b5a78-5f30-11e8-949d-2353272b334b.png)


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-05-24 20:14:25 +01:00
7250376104 refactor: Don't access $_SESSION directly for Auth (#8513)
* Don't access $_SESSION directly for Auth

* fix style

* add property annotations
2018-04-07 21:55:28 +01:00
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
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
da5783d917 feature: Add mysql failed query logging + fixed queries that break ONLY_FULL_GROUP_BY (#5327)
* feature: Add mysql failed query logging + fixed queries that break ONLY_FULL_GROUP_BY

* fix all schema errors and update system
2017-01-07 11:32:38 -06:00
laf
8a142aa53f feature: Added the option to select alert rules from a collection 2016-10-29 10:56:59 +00:00
27e9408626 fix: Change the wording for the create default rules button to hopefully get more users to click it. 2016-10-21 09:53:20 -05:00
e1fac851f9 refactor: Update alert rules to generate sql query and store in db (#4748) 2016-10-15 00:29:55 +01:00
10de31720d 3x to 2x 2016-09-22 14:45:41 -04:00
4106f0f8c7 fix tooltip
`container` property documented here:
http://getbootstrap.com/javascript/#callout-tooltip-groups
2016-09-22 13:44:14 -04:00
07574b27d8 Move to Font Awesome
Keeps the look more in line with the navigation bar icons.
In the future with Bootstrap 4, Glyphicons will not be included, so this
starts the transistions away.
2016-09-22 10:44:17 -04:00
8c639aa5a4 PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
2016-08-18 21:29:30 -05:00
laf
9a23be41c1 Added additional default alert rule 2016-07-03 19:47:12 +01:00
laf
04778eadaa Order alerts by state so that we can indicate rules which have triggered 2016-06-20 23:23:17 +01:00
731e43bc66 Revert "[WIP] Sanity!" 2016-02-17 13:59:58 +00:00
f0o
375d7ca4af Cosmetic fix on Alert-Rules 2016-02-10 15:26:17 +00:00
laf
87347bc8f8 Updated global rules 2016-01-25 23:47:00 +00:00
laf
6b72da4a00 Updated global rules 2016-01-25 23:45:46 +00:00
laf
84fcf1c461 Used alert_rules.id as the # to make corelation with poller debug output easier 2015-12-09 14:32:32 +00:00
33a43ff9ed Spelling correction 2015-09-23 20:36:18 +02:00
27dc720892 Match button style (ie, with + fontawesome icon) 2015-09-16 18:38:09 +05:30
f77c712bfc changes needed to run under web server subdirectory 2015-08-11 14:54:05 -07:00
945ca7f2ea Revert "changes needed to run under web server subdirectory" 2015-08-11 21:25:23 +01:00
cc0f449fc9 changes needed to run under web server subdirectory 2015-08-07 11:10:43 -07:00
laf
dde4ac0db6 Initial work on tooltips 2015-07-19 18:52:39 +01:00
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
laf
4765cebea0 Added support for interval for alerting 2015-05-20 21:46:54 +01:00
f0o
da624fa136 Added Macros in Alert-Rule syntax 2015-04-24 19:14:10 +00:00
laf
a404082d51 Updated some of the main pages to no longer refresh 2015-03-21 21:30:55 +00:00
984e4a8cab Fixed the global alert_rull add SQL. Added a default value for disabled (set to 0). This could probably be fixed in the schema if the default value is set. 2015-02-26 23:04:05 +00:00
2cb5d727b4 Updated to support a demo user 2015-02-16 23:45:28 +00:00
laf
ddbc2a7304 Updated alerts interface to support inverted rules, worse/better alerts 2015-01-26 22:07:42 +00:00
ff833a508d Merge pull request #373 from laf/issue-laf-97
Added ability to create default global alert rules
2014-12-23 16:36:18 +00:00
078d63b3f3 Update print-alert-rules.php 2014-12-23 15:56:39 +00:00
3669a6e824 Update print-alert-rules.php 2014-12-23 15:56:17 +00:00
laf
1d217df791 Set device_id to -1 2014-12-22 19:38:45 +00:00
laf
84eb81c23a Setting default delay to 300 seconds so alerts are every 5 minutes 2014-12-22 19:01:23 +00:00
laf
a3c180868b Updated default rules 2014-12-22 17:41:05 +00:00
laf
6f0b9478a8 Added ability to create default global alert rules 2014-12-22 16:58:58 +00:00
51616844bc Added ability to name alert rules 2014-12-21 15:44:50 +00:00
ef28a9fe03 Scrutinizer issues fixed 2014-12-16 21:10:11 +00:00
1140768bd2 Scrutinizer issues fixed 2014-12-16 20:49:55 +00:00
laf
807fc9a3ba Alerts gui commit 2014-12-16 20:03:19 +00:00