27 Commits

Author SHA1 Message Date
SourceDoctor
a4d1f5e1c8 Show Device Outages as Log List (#12011) 2020-08-18 20:02:56 +02:00
SourceDoctor
dcab027c1f Enhance AlertLog Table View (#11936) 2020-07-18 00:26:17 +02:00
louis-oui
80aca5eec9 Fix availability map downtime (#11638)
* fix

* fix widget

* fix widget

* fix widget

* fix

* last_polled fix

* factorize down / up time device

* factorize down / up time device

* factorize down / up time device

* factorize down / up time device

* factorize down / up time device
2020-06-15 23:53:48 +02:00
Hayden
e469d15493 check if lat/long exist for each device with link (#11366) 2020-04-02 10:49:28 +02:00
Jellyfrog
daf451cef7 Convert overview page to laravel (#10757)
* Convert overview page to laravel

* Convert more pages

* More fixes
2020-03-31 23:03:02 -05:00
Mathieu Poussin
e320fdf1cc Better map link scaling algorithm (#11329) 2020-03-23 11:42:18 +01:00
Mathieu Poussin
1cf7e206e5 Geographical map: Show network links between locations (#11269)
* Geographical map: Show links between locations

* Fix manifest after merge conflict
2020-03-13 11:22:32 +01:00
SourceDoctor
c07678d55f Mark Devices in Maintenance Mode (#11092)
* Mark Devices in Maintenance Mode

* code climate fix
2020-02-02 08:33:01 -06:00
SourceDoctor
692247ddf3 only show uptime seperator '-' if uptime present (#11069) 2020-01-26 08:04:52 -06:00
louis-oui
e3156cbef6 Support of "disable alerting" in availability map and device summary widget (#11022)
* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* merge for last release

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Hide disabled alerting device from avaibility map

* Widget device summary

* Widget device summary

* Widget device summary

* Widget device summary

* Widget device summary

* Widget device summary

* fix color in widget device summary

* fix color in widget device summary

* Commit to restart travis CI

* Commit to restart travis CI
2020-01-15 11:32:29 -06:00
PipoCanaja
ee8297df19 Extend FS switches support, handle lowerLayerDown ifOperStatus (#10904)
* extend FS switches support

* MIB compilation

* HW and Ver

* sensors and CPU

* tests

* correct version

* try to handle properly "down" as not up, for OperStat like lowerLayerDown

* try to handle properly "down" as not up, for OperStat like lowerLayerDown

* try to handle properly "down" as not up, for OperStat like lowerLayerDown

* try to replace "down" with "not up" :)

* fix other ifOperStatus checks
2020-01-15 08:28:36 -06:00
Jellyfrog
b361710148 Device group based access (#10568)
* Device group based access

* Use Permissions class to resolve permissions

Also give port access based on device access

* Convert more pages to use Permissions class

* shorten config setting name
use Eloquent relationships in several places
alphabetize config_definitions.json

* Change Models and Permissions

* Clean up ajax_search LIMIT sql

* Convert more pages to use Permissions class

Co-authored-by: Tony Murray <murraytony@gmail.com>
2019-12-30 12:11:26 +01:00
louis-oui
82bad5f701 Add alert history in device section (#10972)
* Alert log in device
2019-12-24 17:11:25 +01:00
Tony Murray
e6423852ef Remove $_SESSION usage, except install (#10745)
* Remove $_SESSION usage, except install
Fixes issue with device debug capture
Removes secure_cookies setting, use the .env variable SESSION_SECURE_COOKIE instead.  Reminder secure cookies requires cookies are transported over https, if everything is already transported via https, the setting won't make a difference.

* Fix availability map controls
2019-10-26 00:29:12 +00:00
SourceDoctor
52f1bc9e8c geographical map sql query fix for normal user (#10590) 2019-09-09 12:26:44 +02:00
rsys-dev
3cb971e33f Added Graylog to device overview and log level filter mechanism (#10509)
* Added Recent Graylog Entries to Device Overview (WIP)

* Improved "Recent Graylog" entries on device overview (WIP)
Added $config['graylog']['device-page']['rowCount'] to set maximum rows shown in "Recent Graylog" on device overview (Default: 10)
Added $config['graylog']['device-page']['maxLevel'] to set the maximum message level shown in "Recent Graylog" on device overview (Default: 7, validates value to be >= 0 and <= 7)

* Fixed code styling issue

* Added Log Level filter to Graylog widget
Added Log Level filter to Graylog pages (device pages and graylog overview)

* Added documentation for new configuration options

* Removed unneccesary (and already commented) using
Renamed "maxLevel" to "loglevel" as suggested by a colleague

* Added doc for $config['graylog']['loglevel']

* Removed includes/html/print-graylog.inc.php and inlined it in includes/html/pages/device/overview/graylog.inc.php
Removed comma in json object in resources/views/widgets/graylog.blade.php
Replaced translation strings in resources/views/widgets/settings/graylog.blade.php with existing translation strings

* log level -> minimum log level

* Use Config::get() default functionality

* Oops
2019-08-27 12:44:27 -05:00
Tony Murray
e99f421511 Remove legacy auth usage of $_SESSION (#10491)
* Remove auth use of $_SESSION

Will break plugins that depend on $_SESSION, Weathermap was already fixed.
Port them to use Auth::check()/Auth::user()/Auth:id()

* revert accidental replacement
2019-08-05 14:16:05 -05:00
rsys-dev
6394c35ce6 Graylog entry matching device if source is not hostname or primary ip (#10458)
* Added findByHostnameOrIp($hostnameOrIp) for devices.
    Returns Device or null
Fixed Graylog device links, "device" parameter in URL was IP or Hostname instead of device id before
Added Severity number to name conversion. Can be activated by setting $config['graylog']['severity-names'] = "true" in config
Added Facility number to name conversion. Can be activated by setting $config['graylog']['facility-names'] = "true" in config

* Added $config['graylog']['match-any-address']. To enable matching Graylog entries by any interface address set to "true"
Added code to match Graylog entries by any interface address instead of only hostname or primary address

* Fixed missing quotation marks in <script> block in includes/html/common/graylog.inc.php:46, causing graylog page only load header with empty table. Introduced in https://github.com/librenms/librenms/pull/10447

* Modified code to reduce complexity as mentioned by codeclimate

* Changed findByHostnameOrIp($hostnameOrIp) as mentioned by https://github.com/murrant

* Added Language File "syslog.php" for Syslog Severity and Facility
Merged functions "levelName($level)" and "facilityName($facility)" to "syslogPrioParser($type, $value)" where $type should be "facility" or "severity" and $value the numeric or text facility or severity. Returns "NUMBER (NAME)" if possible, otherwhise returns $value

* Shortened findByHostnameOrIp($hostnameOrIp) as mentioned by https://github.com/murrant

* Add shortcut ipv4 and ipv6 device relationships
Better code for adding source addresses
Only translate level and facility if they are numeric
Allow level and facility to be sortable
No need for device link if we know it won't work.  Before the code was punting to save sql queries.

* Cache devices
Took queries from 69 to 6 in my quick test.

* Added Documentation for $config['graylog']['match-any-address']

* Fixed missing quotation marks in app/ApiClients/GraylogApi.php:125
2019-07-26 15:13:35 -05:00
djamp42
fd42ea6e83 Add more detail to webgui alerts (#10388)
* alert sysname

* use existing config option

* add location to alert table

* made location a link

* fix formating

* Update alerts.inc.php
2019-07-18 23:24:24 -05:00
Tony Murray
36a5da00ca Fix missed alert function renames (#10452) 2019-07-18 11:05:43 -05:00
Tony Murray
3ead462549 Enable CSRF protection (#10447)
* Enable CSRF protection

* fix style issues
2019-07-17 07:20:26 -05:00
Tony Murray
f3ba8947f7 Use Config helper (#10339)
remove usage of global variable
2019-06-23 00:29:12 -05:00
Tony Murray
1a60c44eb0 Device groups rewrite (#10346)
* Device Groups rewrite
Updated web ui
Static or dynamic groups allowed
Alert rule query builder
Translation support
Permissions support

* cleanup, make relationship save, and validate it

* builder WIP

* rules builder and rules saving/loading

* Parse query builder to Laravel Fluent query

* Upgrade existing groups when editing.
Properly update only dynamic groups when polling.

* remove unused old code
Update API and other places to use Eloquent

* debug output in poller restored

* Fix up some things
creating static
improved validation
fix js error on creation
Fix static groups in polling

* hide pattern for static group

* Implement authorization
Use in the menu too

* update schema

* fix rollback

* Don't abort on invalid queries

* fixes to query builder

* add test data, looks like macros aren't handled (omitted them because groups don't use them generally)

* Add macro support for QueryBuilderFluentParser

* add test for macro that accepts value

* More space in forms
Retain rules when converted to static
no duplicate names allowed

* Better error feedback
Update related devices on save

* Add button icon

* format

* update docs

* fix tests

* Fix some QueryBuilderFluentParser issues with OR
updated/more test data

* Show device groups runtime
fix querybuilder.json format

* Store table joins in the rules to minimize polling time
Update group joins in daily.sh (and when they are saved)

* Update daily.php

* Add units to time
2019-06-19 16:01:53 -05:00
Tony Murray
c2b09b8f80 Revert "Rewritten device groups (including static) (#10295)" (#10340)
This reverts commit cfc51d51f5714519536931bc331ed981639a9d87.
2019-06-16 21:52:57 -05:00
Tony Murray
cfc51d51f5 Rewritten device groups (including static) (#10295)
* Device Groups rewrite
Updated web ui
Static or dynamic groups allowed
Alert rule query builder
Translation support
Permissions support

* cleanup, make relationship save, and validate it

* builder WIP

* rules builder and rules saving/loading

* Parse query builder to Laravel Fluent query

* Upgrade existing groups when editing.
Properly update only dynamic groups when polling.

* remove unused old code
Update API and other places to use Eloquent

* debug output in poller restored

* Fix up some things
creating static
improved validation
fix js error on creation
Fix static groups in polling

* hide pattern for static group

* Implement authorization
Use in the menu too

* update schema

* fix rollback

* Don't abort on invalid queries

* fixes to query builder

* add test data, looks like macros aren't handled (omitted them because groups don't use them generally)

* Add macro support for QueryBuilderFluentParser

* add test for macro that accepts value

* More space in forms
Retain rules when converted to static
no duplicate names allowed

* Better error feedback
Update related devices on save

* Add button icon

* format

* update docs

* fix tests
2019-06-16 08:27:22 -05:00
Tony Murray
e9ae08d5db Use Laravel url helpers to improve functionality without dns name (#10227)
* Use Laravel url helpers to improve functionality without dns name
Not exhaustive...

* Fix Url generated urls

* Bump js version
2019-05-20 11:47:34 -05:00
Tony Murray
36431dd296 Security fix: unauthorized access (#10091)
* Security fix: unauthorized access
Affects nginx users:
Moved php files outside of public html directory (Apache was protected by .htaccess)

Affects all users:
Some files did not check for authentication and could disclose some info.
Better checks before including files from user input

* git mv html/includes/ includes/html
git mv html/pages/ includes/html/
2019-04-11 23:26:42 -05:00