Commit Graph

109 Commits

Author SHA1 Message Date
PipoCanaja
a2d378e0be Display Up/Down time in Device List (#9951)
* First attempt of Up/Down time

* First attempt of Up/Down time

* Moved to Time::formatInterval()

* cleaning

* last polled in casts

* Cleaning the variants of formatUptime()

* Cleaning in ./html/includes/dev-overview-data.inc.php

* Cleaning in ./html/includes/dev-overview-data.inc.php

* Cleaning in ./html/includes/dev-overview-data.inc.php

* updated includes/polling/core.inc.php

* updated includes/alerts.inc.php

* clean accessors
2019-03-17 21:09:58 -05:00
Tony Murray
590c488d74 Rewrite devices page backend (and a little frontend) (#9726)
* Implement devices table data output

* initial filter

* Add select2 filters
improve table header layout
improve init_select2

* bump versions to be safe

* add group filtering
fix location sorting

* allow filter value morphing

* add missing state filter

* remove the old devices endpoint
2019-01-25 15:31:33 -06:00
Tony Murray
7c4fac489a Fix issues cause by new location and other misc (#9490)
* Fix issues cause by new location and other misc
fix some queries so we return devices with null locations
remove unnecessary query of all ports on ports page lists
make locations menu available to non-admins for the legacy menu
fix a few issues with the old network-map

* fix graphs

* fix oxidized query
2018-11-29 13:04:11 -06:00
Tony Murray
3e35ee0e7d Refactored and update Location Geocoding (#9359)
- Fix location so it is a regular database relation (this allows multiple devices to be accurately linked to one location and saves api calls)
- Parse coordinates from the location more consistently
- Add settings to webui
- ~~Used [PHP Geocoder](http://geocoder-php.org/), which has lots of backends and is well tested. (also includes reverse and geoip)~~
- Google Maps, Bing, Mapquest, and OpenStreetMap supported initially.
- Default to OpenStreetMap, which doesn't require a key.  They will liberally hand out bans if you exceed 1 query per second though.
- All other Geocoding APIs require an API key. (Google requires a credit card on file, but seems to be the most accurate)
- Update all (I think) sql queries to handle the new structure
- Remove final vestiges of override_sysLocation as a device attribute
- Update existing device groups and rules in DB
- Tested all APIs with good/bad location, no/bad/good key, and no connection.
- Cannot fix advanced queries that use location

This blocks #8868

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`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
2018-11-28 22:49:18 +00:00
Tony Murray
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
Tony Murray
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
Maurice den Braber
3198826769 Update devices.inc.php to use searchquery (#8509)
Updated devices.inc.php to use new searchquery parameter in stead of hostname.
2018-04-05 22:41:56 +01:00
Maurice den Braber
9f5b42b028 webui: Allow full search on devices page (#8364)
* Update devices.inc.php

* Update devices.inc.php

* Replace $_POST with $vars

Better protection for SQL injection attempts; Need to verify other files for same issue.

* Fixed whitespace.

*sigh*

* More search options & sql injection fixes.

+Allow full search on devices page;
+Allow sysName search on alertlog page;
+Allow sysName search on alerts page;
+Allow sysName search on eventlog page;
+Allow sysName search on poll-log page;
+Allow sysName search on ports page;

*Replaced all occurrences of $_POST with $vars in librenms/html/includes/table. ($vars are sanity-checked).

* Whitespace fix

* Fixed $where & $param

* Add files via upload

* Whitespaces....

Sometimes you want'em, sometimes you hate'em.
2018-03-25 21:50:09 +01:00
Tony Murray
561846a44b fix: Fiedx issues with new config init (#8242)
* Fix non-config defaults

* update processConfig and remove file
2018-02-12 09:15:44 +00:00
crcro
e81413ac61 webui: Added back devices sort by status (#8103)
* added back sort by status

* removed useless html style tags
2018-01-17 16:22:59 +00:00
crcro
364b5749ef webui: Devices header cleanup (#8039) 2018-01-06 20:17:01 +00:00
crcro
45be722b58 fixed missing devices graphs options (#7981) 2017-12-29 14:10:36 -06:00
Tony Murray
12373d0f60 Fix devices update url (#7965) 2017-12-27 13:41:59 -06:00
crcro
7a0f8c02b6 webui: Devices table refresh (#7809)
* initial release

* added missing copyright

* update to match latest style

* removed status text column

* removed status text column

* fix overflow of options bar
2017-12-24 19:58:32 +00: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
Neil Lathwood
a4be2a4892 fix: Set the from / to for graphs in the devices list #6262 (#6264) 2017-03-23 21:09:55 -05:00
Tony Murray
456f01f68e webui: center device icons. Keep device actions at two rows (#5627)
netonix logo -> svg
2017-01-26 22:20:43 +00:00
Neil Lathwood
25d67c6d79 fix: links on devices graphs page to take users straight to specific graph page (#5001)
* fix: Correct links to devices graphs #4928

* remove commented out link
2016-11-15 21:32:43 -06:00
crcro
5569884f7f webui: Updated devices view (#4700) 2016-10-16 15:58:48 +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
walrus
779b04e431 fixed typo 2016-07-07 21:27:20 -05:00
walrus
b8edbeb83e added link to temp sensor to group page 2016-07-07 21:23:50 -05:00
Tony Murray
009840bf8a Store device group relationships in a pivot table. 2016-06-02 13:25:01 -05:00
Daniel Preussker
731e43bc66 Revert "[WIP] Sanity!" 2016-02-17 13:59:58 +00:00
f0o
f606369309 Bulk cosmetic fixes 2016-02-10 15:40:50 +00:00
Paul Gear
e5f1914096 Add graph selector to devices overview
Copy of selector code from html/pages/graphs.inc.php that probably has bugs
2015-11-17 07:55:35 +10:00
laf
7187117511 Made status sortable 2015-11-05 19:42:06 +00:00
laf
7775d6d07e Changed from is_numeric to empty as variables can now contain non-numeric 2015-10-26 20:43:14 +00:00
laf
12cd422702 Updated devices Graphs links to use non-static time references 2015-10-26 19:49:30 +00:00
laf
e9deae1315 Centralised the date selector for graphs for re-use 2015-10-20 21:35:08 +00:00
Arjit Chaudhary
46b5ebc6de Change to panel UI 2015-09-23 15:41:48 +05:30
Arjit Chaudhary
0c6044cf73 Added back table-condensed to table-hover 2015-08-23 15:21:12 +05:30
Arjit Chaudhary
efa475d3e8 renamed brand to vendor 2015-08-23 15:20:18 +05:30
Arjit Chaudhary
eb4d386731 Highlight table on hover, added column names for status and brand
Probably could re-name brand to manufacturer ?
2015-08-23 00:09:12 +05:30
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
Aaron Daniels
dde56c3b24 Modified code to use graph generation functions instead of generating manually.
The graph generation functions check for the status of 'web_mouseover'.
2015-08-05 07:13:19 +10:00
laf
031a818c77 Removed references to location override 2015-07-20 16:52:33 +01:00
Clint Armstrong
b5e8998c70 apply lazyload patch 2015-07-16 12:42:58 -04:00
Job Snijders
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
laf
dd32e01113 Re-enabled the remove search link for devices! 2015-07-08 00:22:36 +01:00
Mike Rostermund
5f36149f8a Add ping to /devices/ graphs 2015-06-10 08:11:11 +02:00
Mike Rostermund
2e82965f08 Add poller time graphs to /devices/ 2015-06-10 08:02:22 +02:00
Mike Rostermund
c2c33e603a Add Load graphs to devices page 2015-06-10 00:47:26 +02:00
laf
0026ae90f7 Fixed user perms on devices pages 2015-04-22 21:09:13 +01:00
laf
fa52fdc986 Added new function to tidy up for bootgrid output 2015-04-13 15:32:39 +01:00
f0o
23a01ab24e Re-Added SQL rule generation lost at b79b0b0d8f
solves #795
2015-04-13 13:21:30 +00:00
laf
c95488f73f Swapped if check 2015-04-13 12:11:12 +01:00
laf
ba1e9e6c5f Filtered out new lines to not break webui 2015-04-13 11:47:25 +01:00