Commit Graph

81 Commits

Author SHA1 Message Date
Tony Murray
350b3a1ef8 fix: Fixed alerting with dynamic contacts for rules made with the new builder (#8677)
Update test-alert.php too

Thanks to @dsgagi on Discord for identifying the issue
2018-05-08 21:35:21 +01:00
Neil Lathwood
1eee6e8195 alert: Added ability to make notes for acking alerts + record who did so (#8433)
* alert: Added ability to make notes for acking alerts + record who did so

* Updated schema

* moved sql file

* Updated from comments in PR

* warning changed to blue

* reset notes + keep notes on ack
2018-04-26 00:00:56 -05:00
Tony Murray
0d4a403253 Fix GenSQLOld() (#8459) 2018-03-23 14:39:50 +00:00
Neil Lathwood
544b363951 alert: Added support for disabling recovery notifications (#8430)
* alert: Added support for disabling recovery notifications

* reversed use of recovery

* removed debug + small update
2018-03-22 12:38:16 -05:00
Tony Murray
8883dde9bd Alerting, actually generate SQL (#8415)
* Alerting, actually generate sql.
Only unquote things that are actually numeric

* Fix merge
2018-03-20 12:49:57 +00:00
Tony Murray
72752fa2d0 Use one sql query to fetch device alert rules (#8391)
* Use one sql query to fetch device alert rules
Rename $device to $device_id to avoid confusion.  I didn't see any variable collisions.

* don't return disabled rules

* remove semi-colin
2018-03-15 16:03:45 +00:00
Neil Lathwood
0aed9788e3 Fixed alerts group mapping (#8389) 2018-03-15 09:23:54 -05:00
Neil Lathwood
0ba5fa66e0 Reference the correct table for devices (#8383) 2018-03-15 11:02:43 +00: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
Tony Murray
6b68d5fce9 alerts: Added alert_id to alerts for templates (#8368)
* Add alert_id to alerts for templates
Extract alert loading to a function loadAlerts().
Alternative to #8351

* Actually add alert_id to $obj

* travis fixes
2018-03-13 22:19:57 +00:00
FTBZ
eb72a5394e feature: Copy all email alerts to default contact (#8178)
* feature: Copy all email alerts to default contact

* change in SQL and add check as requested

* Rename 233.sql to 234.sql

* tab removing
2018-02-05 08:25:24 +00:00
Aldemir Akpinar
56561aa4dc feature: Added support for Host dependencies (#7332)
* First draft of the modals and the config interfaces

* GUI part done

* Backend code and db schema addition

* Documentation added, fixed alerting bug

* Fix typos

* Do not try to push an older db_schame.yaml

* Small db fix

* More db fixes

* Travis CI fixes

* missed a line in the travis error

* Fixed dependency clearing bug, Manage Host dependencies button now shows current selections

* Removed unnecessary index

* Correct faulty query

* Fixed sql query as requested, and renamed sql file

* Added requested changes

* Removed debug code

* Renamed sql file

* More fixes as requested

* Trying to fix db_schema.yaml

* adding laf's diff

* Corrected a small bug

* Try to resolve scrutinizer issue

* Main page bootgrid ajax modifications

* Also corrected travis ci errors

* Added select2 for pull downs, removed a redundant debug output. Changed parent_id to text

* Add missing class in the device settings page

* Fix bug where a link wasn't added after save

* Better parent down detection

* Add missing comma

* Behold the multi-parent code

* Added lookup table

* Ready for testing

* Trying to fix documentation conflicts

* Fix copy paste errors, and possible sql injection

* indentation problems

* Modified db_schema.yaml as well

* Typos, typos

* This should correct alerts

* Try to fix travis ci error

* Fix the typo in index.php

* Changed to Tony's query

* function explanation text changed

* Updated db_schema.yaml

* Trying to make automated tests happy

* Changes as requested

* Added acknowledgment for select2

* Added laf's patch

* dbBulkInsert when adding parents
2017-12-20 14:17:52 +00:00
deepseth
70d68db6e3 refactor: Stop sending emails to "NOC" for default_email target (#7917) 2017-12-18 15:03:33 +00:00
mcq8
5ff03d5942 refactor: Refactor alert transports to classes (#7844)
* Refactor alert transports to classes

* Fix linting

* Make Slack alert transport php 5.3 compatible

* Rename call method to deliverAlert for alert transport
2017-12-10 20:20:28 +00:00
Neil Lathwood
edf26c1106 fix: Validate email addresses used in alerting (#7830)
* fix: Validate email addresses used in alerting

* Whitespace
2017-11-30 23:27:04 -06:00
Tony Murray
d6db01abb5 refactor: Refactor fix php codesniffer 3.x issues (#7816)
We cannot use 3.x because it  requires php 5.4, so update to 2.9.1 or newer 2.x release.
2017-11-29 08:23:19 +00:00
mcq8
c9728a1f71 refactor: Refactored authorizers to classes (#7497)
* Refactored authorizers to classes

* Merge changes for #7335

* ! fix php 5.3 incompatibility

* Update ADAuthorizationAuthorizer.php

* Fix get_user -> getUser

* Rename AuthorizerFactory to Auth, fix interface missing functions

* Add phpdocs to all interface methods and normalize the names a bit.

* Re-work auth_test.php AD bind tests to work properly with the new class.
Reflection is not the nicest tool, but I think it is appropriate here.
Handle exceptions more nicely in auth_test.php

* Restore AD getUseList fix

Not sure how it got removed

* fix auth_test.php style
2017-11-18 10:33:03 +00:00
Aldemir Akpinar
34d0fc3199 refactor: Ability to edit default alert template (#7121)
* newfeature: ability to edit default alert template

* Fix style errors

* Added missing db query

* Removed unnecessary code, and added faq section

* Minor documentation about default alert template. And put back wrongly removed lines

* Fixing the silly old mistakes... again
2017-08-12 20:21:13 +01:00
Aldemir Akpinar
821dbefefb fix: Set event type alert for alert log entries (#7013) 2017-07-13 13:30:05 +01:00
pblasquez
cc38930007 feature: Added elasticsearch transport and docs (#6687)
* Add elasticsearch transport and docs

* Fix formatting

* Fix formatting

* Remove librenms string from sql file

* Add missing states

* Use ifAlias not ifDescr

* Update Alerting.md

* Remove unused es_enabled flag

* Fix storage column names

* Fix processor columns

* Rename 194.sql to 193.sql
2017-06-01 12:16:39 +01:00
Neil Lathwood
bfa26b8634 fix: Revert to using addslashes() for template parsing in alerts (#6661)
* fix: Revert to using addslashes() for template parsing in alerts

* Update alerts.inc.php
2017-05-17 20:11:54 +01:00
Neil Lathwood
612186dabf alerting: Added option to enable/disable option for sending alerts to normal users (#6590)
* alerting: Added option to enable/disable option for sending alerts to normal users

* Update notifications.rss

* added missing sql

* Fix schema

* Update notifications.rss
2017-05-15 23:35:26 +01:00
Arzhel Younsi
073b444d4a alerts: Remove prettifying of mysql query in alerts (#6614)
* Pretty mysql for alerts breaks regex rules

Fix for issue #6613

* Remove useless replacements
2017-05-13 22:32:41 +01:00
Neil Lathwood
0338734fe7 feature: Added script (scripts/test-template.php) to test alert templates (#6631)
* feature: Added script (scripts/test-template.php) to test alert templates

* moved remaining functions, fixed php 5.3 and include dir

* added docs on use for test-template script
2017-05-13 06:46:08 -05:00
Neil Lathwood
0b2f5cddd2 fix: Fix alerts not honouring interval over 5m (#6438) 2017-04-17 20:08:52 -05:00
Tony Murray
1ea7af424b feature: bind user for active_directory auth (#6255)
* feature: bind user for active_directory auth
Optional, allows the use of "remember me", API, and alerting.

* missing global (but still may not be working)

* always return a value from reauthenticate()

* Make sure the ldapbind credentials are correct on reauth.
Do not send output if they are incorrect (use d_echo) this breaks ajax calls, etc.
Add scripts/auth_test.php, to make it easier to debug authentication.

* Refine auth_test.php a bit more
A few small cleanups in other places of the auth

* Add auth_test.php to docs
Some more improvements in the auth_test.php output.

* Update Authentication.md
2017-03-29 08:22:02 -05:00
Neil Lathwood
5d659a1b68 fix: Rebuild extra data to include original (#6245) 2017-03-23 08:23:01 +00:00
Neil Lathwood
a752dc1bff fix: Alerts that worsen or get better will now record updated info #4323 (#6203) 2017-03-22 09:02:47 +00:00
Tony Murray
67f10cd40e fix string escape in getContacts (#6216) 2017-03-17 21:29:23 +00:00
towster
605b9d2092 feature: Send default mail when no email destinations found (#6165)
* when an email is attempted to be sent but there are no recipients send to default_mail address
2017-03-14 23:22:43 +00:00
FTBZ
a0f5fe4f37 feature: Added basic recurring maintenance for alerts #4480 2017-01-22 18:00:15 +00:00
Mickael Marchand
8352a3a000 fix: update any IP fields using inet6_ntop() #5207 2016-12-29 23:50:22 +00:00
Tony Murray
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
Neil Lathwood
e1fac851f9 refactor: Update alert rules to generate sql query and store in db (#4748) 2016-10-15 00:29:55 +01:00
Neil Lathwood
eab4ae5ab5 Added more debug to alerting capture (#4727) 2016-10-13 20:14:02 -05:00
Neil Lathwood
8b68429a06 Tidy up alert output info for poller cli (#4578) 2016-09-25 10:01:58 -05:00
Tony Murray
9284bc60ff Update code in includes to be PSR-2 compliant (#4220)
refactor: Update code in /includes to be psr2 compliant #4220
2016-08-28 18:32:58 +01:00
laf
17d93182c1 Added check for empty emails 2016-07-28 20:28:23 +01:00
laf
0e197e96ec Added support for multiple emails 2016-07-26 22:29:04 +01:00
f0o
21a0a18055 Fixed Device-Groups for multiple entries and glue-expansion 2016-06-22 08:42:48 +00:00
Neil Lathwood
47b87e959e Merge pull request #3138 from f0o/minor-alerting-addons
Minor alerting addons
2016-03-08 21:00:37 +00:00
Ultra2D
9773b3bade Tabs to spaces 2016-03-04 11:30:11 +01:00
f0o
702fa61458 Fix Math issue in rule generation 2016-03-02 17:08:45 +00:00
laf
7e483f6bd2 Added check if that value is set 2016-02-27 11:51:31 +00:00
laf
a028689095 Updated alerts query to change ip 2016-02-27 03:54:07 +00:00
Daniel Preussker
731e43bc66 Revert "[WIP] Sanity!" 2016-02-17 13:59:58 +00:00
f0o
21e94b3e3a Sanity! 2016-02-10 15:21:31 +00:00
laf
b8bc52ce0c Removed distinct() from query as we limit by 1 anyway 2015-12-19 19:50:02 +00:00
f0o
ae3f893351 Remove now obsoleted naive glue-checks 2015-11-30 19:13:32 +00:00
f0o
b14d094d83 Fix Glue-Expansion on alerts 2015-11-30 18:51:22 +00:00