Commit Graph

244 Commits

Author SHA1 Message Date
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
Chip Gwyn
bc405194db webui: Modified styles.css to make the device group menu a bit larger (#8200)
* modified styles.css to make the device group menu a bit larger.  Was 200px, set to 800px.  Makes a huge difference in reaability.

* Changed .scrollable-menu to have a max-height of 600px

Changed .scrollable-menu to have a max-height of 600px after discussion, 600 seems a good compromise for size until something better can be found.

* force css update
2018-02-27 19:52:43 +00:00
Florian Beer
44d5a592f1 webui: Update badge background for selected pagemenu item (mono.css) (#8157)
* Update badge background for selected pagemenu item

This brings the background color in line with the user notification number badge background in the upper right corner.
The previous background was too bright for mono.css to properly read the white menu item text.

* CSS cache busting

Change last two digits to 42, because reasons.
2018-01-29 21:58:45 +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
Tony Murray
c22c879983 fix: Remove faulty memcached code (not related to distributed polling) (#7881) 2017-12-10 20:40:45 +00:00
Tony Murray
de8bcf3a6c fix: update notification for users with updates disabled (#7253)
Don't show the toast when the notification is marked as read
2017-08-29 09:32:24 -05:00
Tony Murray
0def643e09 feature: Notify about failed updates, block detectable bad updates (#7188)
* Feature: Notify about failed updates, block detectable bad updates
Ability to post notifications when the update fails.
Detect and roll back updates that will cause broken installs. (Needs testing)
Add severity to notifications, critical (2) notifications will display a toast.

This will be used for removing in-tree dependencies and raising the minimum php version.

* Improve naming a bit add phpdoc to new_notification
In case multiple notifications are created, remove them all.

* Remove notifications when update is disabled.

* update travis to use db testing

* added missing index
2017-08-26 21:35:39 +01:00
Tony Murray
b2c8f34039 refactor: Use anonymous functions for debug error_handler and shutdown_function in index.php (#7219) 2017-08-26 20:07:34 +01:00
Tony Murray
f43ad4629c remove eval() (#6648) 2017-05-17 22:38:00 +01:00
Tony Murray
683a10e723 fix: Improve authentication load time and security (#6615)
* fix: minimize session open time
page/graphs speedup part 2

Write close the session as soon as we no longer need to write to it. Prevents the session from blocking other requests.
Do not run through full authentication functions if the session is already authenticated.
Removes password from the session as well as some items to prevent session fixation from #4608.

WARNING: This will cause issues for ad/ldap users who do not have a bind user configured!

* Do no erase username when using cookie auth.
Properly close the session in ajax_setresolution.php

* write close the session as soon as possible in ajax_setresolution.php

* Remove session regeneration. It is not compatible with the current code and would require more changes.

* Totally refactor authentication.  Extract code to functions for re-use and improved readability

* Use exceptions for authentication and error logging
Tested: mysql, ad_auth with and without bind user

* fix a couple scrutinizer issues

* fix reauthenticate in radius
2017-05-15 22:18:23 -05:00
Neil Lathwood
41e7689c77 refactor: DB Updates will now file level lock to stop duplicate updates (#6469)
* refactor: DB Updates will now file level lock to stop duplicate updates

* scrut fixes

* renamed function from clear_lock() to release_lock()
2017-05-03 14:48:23 +01:00
Simon Mott
18784fdb89 webui: Updated rrdtool command output to use <pre>(#6345)
* fix whitespace display on RRDTool Command

* use a class instead
2017-04-05 07:54:55 +01:00
Tony Murray
4a705ea7e3 Fix vertical alingment of the main navbar. (#6256) 2017-03-23 16:22:50 +00:00
Tony Murray
20ae9e2ecd webui: Improve device header layout (#5990)
* webui: Improve device header layout

* Update css style version to break caches
Remove unused css.
2017-02-24 09:59:30 +00:00
Paul Heinrichs
097a827759 webui: display QR codes for API access (#5988)
* Generate qr code for api hash

Added qrcodejs ( https://github.com/davidshimjs/qrcodejs )

* Add head to modal window

* updated to use fontawesome
2017-02-23 22:19:22 -06:00
Richard Mayhew
5bfd23e7eb webui: New eventlog severity classification (#5830)
* New event log severity model

* Revert "New event log severity model"

This reverts commit 0783527af8.

* New event log severity model

* Fixed spaces vs tabs

* Learning the format requirements

* Learning the format requirements

* Moved the colours in to the stylesheet

* change SQL file to stop conflicting

* refactor log_event so severity isn't last, but reference is.

* keep having to move the file due to new PR conflicts

* Revert "keep having to move the file due to new PR conflicts"

This reverts commit f3030e7218.

* extended support to dashboard and eventlog page

* formatting
2017-02-12 22:41:05 +00:00
Neil Lathwood
5ae4f73ea8 webui: Added ?ver=X to LibreNMS style sheets so we can force refreshes in future (#5651) 2017-01-28 21:59:42 +00:00
Tony Murray
afe887d85e webui: New LibreNMS logo assets (#5629) 2017-01-27 18:02:49 +00:00
Richard Mayhew
47397d0083 webui: Updated icons to use Font Awesome (#5468) 2017-01-21 11:24:05 +00:00
Søren Rosiak
cdef7885aa webui: Small Best Practice Fixes 2017-01-02 00:03:23 +00:00
Tony Murray
db240cb4eb refactor: Collection and output of db and snmp stats (#5049) 2016-11-23 06:57:19 +00:00
Tony Murray
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
Neil Lathwood
b5be6e9271 feature: Added custom css and include directories which are ignored by git (#4871) 2016-10-28 05:55:40 +00:00
Tony Murray
e0cc8dfb48 Disable refreshing on window resize when $no_refresh is set. 2016-09-20 10:16:22 -05:00
Tony Murray
0351b54fb8 webui: make d_echo work in webui (#4432)
* webui: make d_echo work in webui
Remove d_print_r(), it is redundant to d_echo()
Remove d_echo calls in services.inc.php

* Switched debug check to work with nginx
2016-09-14 10:05:49 +01:00
Neil Lathwood
7dec670494 refactor: Updated a lot of references to LibreNMS - copyright still left intact (#4339) 2016-09-08 08:12:23 -05:00
Tony Murray
b8e9b2d917 Implement an autoloader (#4140)
* Implement an autoloader

When cleaning up classes for psr2, things got a bit unwieldy, so I implemented a class autoloader.
I created a PSR-0 compliant LibreNMS directory and moved all classes there that made sense.
Implemented LibreNMS\ClassLoader which supports adding manual class mappings

This reduces the file includes needed and only loads classes when needed.

* Add teh autoloader to graph.php

* Add a small bit of docs
Fix incomplete class in includes/discovery/functions.inc.php
2016-08-21 14:07:14 +01:00
laf
5f8705bd37 Changed package names 2016-08-20 12:21:13 +01:00
Tony Murray
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
Tony Murray
f5f31e88ac Use namespaces for classes, take 2
CollectdColor, move into it's own file, change functions to camelCase
Plugins use LibreNMS\Plugins
2016-08-17 20:26:51 -05:00
Neil Lathwood
809969efc9 Revert "Use namespaces for classes" 2016-08-17 21:27:56 +01:00
Tony Murray
709de9a166 Use namespaces for classes
CollectdColor, move into it's own file, change functions to camelCase
Plugins use LibreNMS\Plugins
2016-08-15 14:04:39 -05:00
laf
06998420cf Updated unpolled notification to only show unpolled devices 2016-06-21 20:12:32 +01:00
Tony Murray
c7d551f6d1 Check that variables are set before using them.
This will hide ugly output for users not using a subdirectory, but may make it harder to diagnose issues for those that are.
2016-05-31 22:28:34 -05: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
Daniel Preussker
2b55c06d9e Revert "Variable/Environment sanity" 2016-02-10 14:31:16 +00:00
f0o
37dccb3932
First effort in bringing some sanity 2016-02-10 13:42:55 +00:00
Mike Rostermund
e2d1a8e7d9 Replaced custom utime() function with microtime(true) 2016-01-08 13:33:32 +01:00
laf
a56ccd7a74 Added option to disable lazy loading of images 2015-12-09 15:50:10 +00:00
Tony Murray
e8d5756467 Fix missing path info on nginx.
Update nginx documentation to set the PATH_INFO variable.
Avoid hacks in index.php if it PATH_INFO is already set for both nginx and apache.
2015-12-03 13:23:37 -06:00
Louis Bailleul
b1fd1b3137 Only update resolution if session variables don't exist
Tune print-graphrow.inc.php to avoid last graph going to a new line in certain cases
2015-11-26 17:13:29 +00:00
laf
e9deae1315 Centralised the date selector for graphs for re-use 2015-10-20 21:35:08 +00:00
Daniel Preussker
335a68bb98 Update index.php
Hotfix for #2007
2015-10-02 00:49:18 +00:00
Neil Lathwood
e2dfab4ca0 Merge pull request #2007 from QuxLabs/qux-issue-8
Added working memcached support
2015-10-01 17:08:03 +01:00
Daniel Preussker
afdbb2406d
Added $nocache parameter
Fixed typo in caching
Excluded caching for MySQL-Authentication & /poll-log/
2015-09-30 15:20:06 +00:00
Alan Gregory
a86988605d Added Full screen Mobile support 2015-09-29 09:50:34 -03:00
Michael Newton
f77c712bfc changes needed to run under web server subdirectory 2015-08-11 14:54:05 -07:00
Neil Lathwood
945ca7f2ea Revert "changes needed to run under web server subdirectory" 2015-08-11 21:25:23 +01:00
Michael Newton
cc0f449fc9 changes needed to run under web server subdirectory 2015-08-07 11:10:43 -07:00