Commit Graph

248 Commits

Author SHA1 Message Date
Tony Murray
b6e18db766 fix: page/graph load speed: part 1 (#6611)
* fix: page/graph load speed: part 1
Speed up load_all_os() by caching the full $config['os'] array
Function time goes from 1.13648s -> 0.00073s
The cache is updated during discovery, but only if it is >22hrs old.
Additionally, the cache is not used and a full yaml load is forced if the cache is >24hrs old.
The cache time is controlled by $config['os_def_cache_time'], I don't see any reason anyone would change that time.

* Delete Session.php

* Include the cache directory.
2017-05-10 08:57:10 +01:00
Neil Lathwood
34c35f3627 webui: Updated remaining display options where we do not show sysName if hostname is IP (#6585)
* webui: Updated remaining display options where we do not show sysName if hostname is IP

* renamed function + simplified
2017-05-05 06:25:58 -05:00
Tony Murray
4dbab407bb refactor: OS discovery tests are now dynamic (#6555)
* refactor: OS discovery tests are now dynamic
All that needs to be done now is supply snmprec files with the proper name. os.snmprec or os_description.snmprec
I also tweaked the loading of yaml files to speed up the tests substantially.
Verifies all os have at least one test and all snmprec files are tested.

* fix typo
2017-05-03 15:52:53 +01: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
056ddbac05 webui: Fixed the display date for the current version (#6474)
* webui: Fixed the display date for the current version

* changed to use exec

* changed >> to >
2017-04-22 18:03:14 -05:00
Tony Murray
72ce39cf9b refactor: schema updates (#6370)
Test the schema files with STRICT_TRANS_TABLES and fix any issues
2017-04-13 10:18:12 +01:00
Neil Lathwood
1bbbaff58b refactor: Moved ifLabel -> cleanPort and updated the usage (#6288)
* refactor: Moved ifLabel -> cleanPort and updated the usage

* added list of tags allowed

* few updates as per comments from @murrant

* Added simple unit tests

* double display for javascript popover

* Remove ifNameDescr() function
Fix realtime port page

* remove accidental temp code

* Remove double display calls in ajax tables
2017-04-04 08:08:23 +01:00
Tony Murray
4b9f3f37d7 fix: move user preferences dashboard and twofactor out of users table (#6286)
* fix: move user preferences dashboard and twofactor out of users table
This allows them to work with any authentication method
Add set_user_pref() and get_user_pref() helper functions

* fix edit users for other users

* Fix updated_at default timestamp

* Update and rename 183.sql to 184.sql

* removed commented out debug
2017-04-01 22:18:00 +01:00
Aldemir Akpinar
2dd0ab870f Do not show unintended debug messages (#6296)
* Do not show unintended debug messages

* Fix the silly mistake
2017-03-29 14:35:44 +01: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
d00a2d6215 fix: Updated set_null() function to be more useful #6030 (#6049)
* fix: Updated set_null() function to be more useful #6030

* drop isset

* Added unit test

* change to assertNull
2017-03-07 22:15:22 -06:00
Neil Lathwood
ed02e39347 webui: Update device overview to not show hostname when certain conditions match #5984 (#6091) 2017-03-04 21:25:06 -06:00
Neil Lathwood
46198b2caa feature: Added ability to show links to fixes for validate (#6054)
* feature: Added ability to show links to fixes for validate

* Finish this PR up and add a few more messages
Move collation checks to print_list()
2017-03-02 08:04:29 +00: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
Søren Rosiak
414efb3539 refactor: Various Code Cleanup (#5777)
* refactor: Various Code Cleanup

* moar
2017-02-05 22:37:08 +00:00
Neil Lathwood
a19b2614dc fix: added some timeout safeguards for curl calls (#5743) 2017-02-03 08:12:42 -06:00
Neil Lathwood
981e974a70 fix: Check lat/lng are numeric rather than !empty #5585 (#5657) 2017-01-31 08:07:27 +00:00
Neil Lathwood
483c40eddd api: Added parent_id to VMs that have a host #3523 (#5621) 2017-01-26 22:38:43 +00:00
Tony Murray
2f1095cb8d fix: html purify init wasn't done always when it was used (#5626) 2017-01-26 19:23:03 +00:00
Tony Murray
59706194bf refactor: move HTMLPurifier init to init.php so we only create one object. (#5601) 2017-01-25 20:56:59 +00:00
Neil Lathwood
599e1c4b25 fix: HTML Purifier would create tmp caches within the vendor folder, moved to users tmp dir #5561 (#5596) 2017-01-25 14:17:03 -06:00
Tony Murray
af0446f37f fix: PHP 7.1 function usages with too few parameters (#5588) 2017-01-25 17:43:45 +00:00
Neil Lathwood
32da1bceea fix: Changing device type now is persistant (#5529) 2017-01-22 09:49:13 +00:00
Richard Mayhew
47397d0083 webui: Updated icons to use Font Awesome (#5468) 2017-01-21 11:24:05 +00:00
Neil Lathwood
01e4ac3d58 newdevice: Added additional sensor support for Huawei VRP #4279 2017-01-19 16:42:57 +00:00
Neil Lathwood
8557f2df41 newdevice: APC Environmental monitoring units #5140 2017-01-18 08:48:33 +00:00
David Bell
7fc2834eb4 fix: Stop flattening config options added in config.php (#5493) 2017-01-17 22:26:35 +00:00
Søren Rosiak
292c4382c1 Revert "Stop flattening config options added in config.php" (#5492) 2017-01-17 19:42:48 +02:00
David Bell
977a7b6685 fix: Stop flattening config options added in config.php (#5491) 2017-01-17 19:13:16 +02:00
David Bell
44071e83b1 feature: Added check for if git executable (#5444) 2017-01-15 22:54:06 +00:00
Neil Lathwood
d5296319fb refactor: MySQL strict and query fixes (#5338)
* refactor: MySQL strict and query fixes

* moved sql file
2017-01-13 06:47:16 -06:00
Neil Lathwood
6ff3ae8789 fix: Detection blank or unknown device types and update #5412 (#5414)
* fix: Detection blank or unknown device types and update #5412

* Less ifs
2017-01-12 23:47:13 -06:00
Tony Murray
b3f6218359 fix: os type and group not being set (#5357) 2017-01-09 08:16:09 +00:00
Neil Lathwood
cc8e31d1a1 newdevice: Added support for Dasan NOS #5179 + disco change (#5255)
* newdevice: Added support for Dasan NOS #5179

* sysName -> sysDescr - doh

* updated functions

* Updated discovery of OS functions

* added missing test units

* mibs added

* Allow multiple regex statements per sysDescr_regex

* Fix style/code issues

* added docs
2017-01-03 14:04:18 -06:00
Neil Lathwood
7f5c555ba5 refactor: Move mib based polling into yaml config files (#5234)
* refactor: More mib based polling into yaml config files

* doc update

* Update MIB-based-polling.md
2017-01-03 11:12:39 -06:00
Tony Murray
e20a242785 refactor: use Composer to manage php dependencies (#5216) 2017-01-01 09:37:15 +00:00
Neil Lathwood
f5a16be0e3 refactor: Move OS definitions into yaml files (#5189) 2016-12-23 17:53:19 +00:00
Tony Murray
b3d07c3425 fix: Misc warning fixes in mib polling (#5222) 2016-12-22 11:03:21 +00:00
Neil Lathwood
78f5c26cd6 fix: Allow html but not script, head and html tags in notes widget #4898 (#5006) 2016-11-26 20:54:49 +00:00
Tony Murray
da3d687c6d refactor: rewrite arp-table discovery (#5048) 2016-11-25 21:14:35 +00:00
Tony Murray
6890a71be4 feature: validate list devices that have not been polled in the last 5 minutes or took more than 5 minutes to poll (#5037) 2016-11-23 17:41:13 +00:00
Neil Lathwood
cc01969b06 refactor: Default to only using mysqli (#4915)
* refactor: Default to only using mysqli

* Remove includes/dbFacile.mysql.php

* updated mres() function to remove $config global
2016-11-10 19:40:53 -06:00
laf
8190a3c7b2 Added phpdoc to safedescr() function 2016-11-01 16:37:19 +00:00
laf
02ab4df54a Updated function + added unit test 2016-10-25 13:19:48 +00:00
laf
e287930c3b fix: Toner graphs with invalid chars 2016-10-24 21:40:39 +00:00
Søren Rosiak
71a6d6ed73 fix: Delete all port_id references #4684 2016-10-16 00:42:56 +01:00
Neil Lathwood
a2f2ccfd2c security: Fix some reported security issues (#4807) 2016-10-15 20:45:18 +01:00
Neil Lathwood
d86b39395a refactor: Small poller improvements, removes unecessary queries / execs (#4741) 2016-10-14 20:03:26 -05:00
Neil Lathwood
c0d7ad44b0 Revert "refactor: snmp cleanup" (#4746) 2016-10-07 09:26:10 +01:00
Tony Murray
07e8e9f2be refactor: snmp cleanup (#4683) 2016-10-06 21:20:11 +01:00