Commit Graph

205 Commits

Author SHA1 Message Date
Tony Murray
cb005210d2
Resubmit #9608 (#9941)
* Reorganize trap tests

* Testing db DRIVER to prevent .env from interfering

* New code to detect if Laravel is booted.  Hopefully more reliable.

* WIP external test process

* revert module test helper

* Use .env in Eloquent::boot()

* Fix test database settings loading

* fix undefined classes
(didn't find the one I needed)

* Fix incorrect Config usages
And RrdDefinition return type

* fix .env loading

* use the right DB

* slightly more accurate isConnected

* Move db_name to DBSetupTest specifically

* restore $_SERVER in AuthSSOTest

* missed item

* WIP

* tear down in the correct order.

* some testing cleanups

* remove check for duplicate event listener, it's not working right

* Don't need this change anymore

* Implement Log::event to replace legacy function log_event()

* fix port tests

* fix up tests

* remove pointless TrapTestCase class

* fix style

* Fix db config not being merged...

* skip env check for tests

* defer database operations until after Laravel is booted.

* don't include dbFaciale...

* redundant use
2019-03-12 23:59:03 -05:00
Tony Murray
eb648a1d6f
Revert "Changes to improve testing (#9608)" (#9937)
This reverts commit d1a0ccda46.
2019-03-12 00:49:14 -05:00
Tony Murray
d1a0ccda46
Changes to improve testing (#9608)
* Reorganize trap tests

* Testing db DRIVER to prevent .env from interfering

* New code to detect if Laravel is booted.  Hopefully more reliable.

* WIP external test process

* revert module test helper

* Use .env in Eloquent::boot()

* Fix test database settings loading

* fix undefined classes
(didn't find the one I needed)

* Fix incorrect Config usages
And RrdDefinition return type

* fix .env loading

* use the right DB

* slightly more accurate isConnected

* Move db_name to DBSetupTest specifically

* restore $_SERVER in AuthSSOTest

* missed item

* WIP

* tear down in the correct order.

* some testing cleanups

* remove check for duplicate event listener, it's not working right

* Don't need this change anymore

* Implement Log::event to replace legacy function log_event()

* fix port tests

* fix up tests

* remove pointless TrapTestCase class

* fix style
2019-03-11 22:59:39 -05:00
Tony Murray
1ad7f3138b
Add Laravel to LibreNMS (#8318)
* Add Laravel to LibreNMS.

* Try to set permissions during initial install and first composer update to Laravel.

* Fix composer.lock
Fix missing db config keys

* Start building v1 layout
Port ajax_setresolution, inject csrf into jquery ajax calls
Layout works, building menu
Partially done.

* Fix device group list
remove stupid count relationships

* Print messages for common boot errors.
Don't log to laravel.log file.
Log to error_log until booted, then librenms.log

* Fix up some issues with Config loading
Start of custom directives

* Custom blade directives: config, notconfig, admin

* Preflight checks
Only load config files once.

* Update the composer.lock for php 5.6

* Menu through routing

* Start of alert menu

* Better alert scopes

* reduce cruft in models

* Alerting menu more or less working :D

* Fix style

* Improved preflight

* Fix chicken-eggs!

* Remove examples

* Better alert_rule status queries
Debugbar

* fix app.env check

* User Menu

* Settings bar (dropped refresh)
Search JS

* Toastr messages

* Rename preflight

* Use hasAccess(User) on most models.
Add port counts

* Missed a Preflight -> Checks rename

* Fix some formatting

* Boot Eloquent outside of Laravel
Use Eloquent for Config and Plugins so we don't have to connect with dbFacile inside Laravel.
Move locate_binary() into Config class

* Config WIP

* Try to fix a lot of config loading issues.

* Improve menu for non-admins removing unneeded menus
url() for all in menu

* Only use eloquent if it exists

* Include APP_URL in initial .env settings

* Implement Legacy User Provider

* Helper class for using Eloquent outside of Laravel.
Allows access to DB style queries too and checking the connection status.

* Fix up tests

* Fix device groups query

* Checking Travis

* copy config.test.php earlier

* dbFacile check config before connecting
Don't use exception to check if eloquent is connected, it gets grabbed by the exception handler.
Ignore missing config.php error.

* Fix config load with database is not migrated yet.

* Remove Config::load() from early boot.

* Use laravel config settings to init db (this prefers .env settings)
Fix bgp vars not set in menu
add _ide_helper.php to .gitignore

* Restrict dependencies to versions that support php 5.6

* Update ConfigTest

* Fix a couple of installation issues

* Add unique NODE_ID to .env

* Correct handling of title image

* Fix database config not loading. Thanks @laf

* Don't prepend /

* add class_exists checks for development service providers

* Fix config value casting

* Don't use functions that may not exist

* Update dbFacile.php

* d_echo may not be defined when Config used called.

* Add SELinux configuration steps
More detailed permissions check.
Check all and give complete corrective commands in one step.

* Ignore node_modules directory

* Re-add accidetal removal
2018-05-09 08:05:17 -05:00
Tony Murray
8afafe7eb0 refactor: pre-commit.php updates (#8679)
Disable the log for unit tests to speed things up hopefully
2018-05-09 12:53:45 +01:00
Tony Murray
20865b0ca4
OS Testing update (#7971)
* OS Testing update
Option on pre-commit.php to run tests for just one OS. Reorganize tests a bit to support this.
Improved bgp-peers capture and os module capture (initial)
Better output when phpunit tests fail

* fix a couple issues.  Better output for another

* Use the correct setup function
2017-12-28 16:12:08 -06:00
Tony Murray
fff66d3c00
Feature: Generic discovery and poller tests (#7873)
* Processor Tests!

* Capture data from live devices easily.

* fix up some stuff, remove powerconnect things as they seem to be just broken.

* formatting, fix missing assignment
add netonix processor data

* fix multi-line, always add sysDescr and sysObjectID
ios cpm test file

* revert composer change and fix whitespace issues

* add help text

* missed help text

* tighter debug output

* handle empty strings properly and mibs with numbers

* use keys for sorting as intended

* fix type with empty data

* oops :)

* whitespace fix

* try installing fping

* Fix TestCase collision + cleanup

* mark TestCase as abstract
don't run two instances of snmpsim

* better database dumps, improved capture

* style fixes

* fix quotes add a few more tables

* add --prefer-new, properly merge data

* Support separate discovery and poller data. But don't waste space if they aren't needed.

* refactor to use class
collects all code in one place for reusability

* reorganize

* Print out when not saving.

* Support for running multiple (or all) modules at once.

* tidy

* Change unit test to a generic name and test all modules we have data for.

* Add documentation and a few more tidies

* whitespace fixes

* Fix tests, add a couple more modules, more docs

* More docs updates

* Fix scrutinizer issues

* add bgp-peers
2017-12-20 08:36:49 -06:00
Zmegolaz
f8d7ccfe0d feature: Support for up/down detection of ping only devices.
* Added support for ping only devices.

* Renamed sql-schema/206 to 207.

* Discovery tried to detect the OS when it shouldn't.

* Updated db_schema.yaml

* Added ping icon.

* Don't show unused graphs and tabs when SNMP is disabled.

* Allow the user to specify OS of ping only devices.

* Removing custom OS now changes it to 'ping'.

* Removed unnecessary use of mres().

* UI select box for SNMP enable/disable.

* Hide device_ping_perf if ping is disable on device.

* Fixed SNMP settings update status messages.

* Added functionality to add ping only devices via the web ui.

* Added ping only option to addhost.php

* Added ping only support to snmp-scan.py

* Moved sql 208 to 211

* Fixed scrutinizer issues.

* Fixed broken ossearch.

* Added ping only support to the API.

* Updated API doc.

* Added (optional) to OS and hardware description. Hid Port Settings, Applications, Modules, Storage, Processors, Memory and Components from the edit menu

* Style fix.

* Updated ping icon.

* clean() instead of mres(). More escaping. Better help in snmp-scan.py and addhost.php

* Fixed scrutinizer issue.

* Always try SNMP in snmp-scan.py, new option for it in addhost.php. Slice instead of chunk in ajax_ossuggest.php. Other minor style changes.

* Updated sql modifications to insert the new column in the same place as in db_schema.yaml.
2017-10-27 22:59:25 -05:00
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
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
5e790ee617 newdevice: fix Extremeware and XOS detection (#6554) 2017-05-03 15:02:10 +01:00
Olivier Beytrison
2f5a1742c3 newdevice: Added detection for GE UPS (#6549) (#6553)
* Add support for GE UPS (#6549)

* rename OS and remove sysDescr regex
2017-05-02 15:20:28 +01:00
Olivier Beytrison
a6eca494ff newdevice: Added detection for AKCP SecurityProbe (#6550)
* Add support for AKCP SecurityProbe

* Add tests for AKCP SecurityProbe
2017-05-02 14:48:44 +01:00
Neil Lathwood
e2f0965b5c newdevice: Added support for Aruba ClearPass devices (#6528) 2017-05-02 07:46:02 -05:00
network-guy
371c0ff65b newdevice: Added support for Cisco's AsyncOS (#6545)
* Create asyncos.yaml

Added device definition for AsyncOS devices.

* Create asyncos.inc.php

Add poller definition for Async devices.

* Update asyncos.yaml

Added discovery modules.

* Update asyncos.inc.php

Refactored version, hardware, and serial parsers.

* Add AsyncOS MIBs

Add MIBs for AsyncOS WSA and ESA appliances.

* Added OS test

* AsyncOS Refactoring/OS Support

* Change serial number in unit OS test
2017-05-02 07:53:56 +01:00
Neil Lathwood
e7e5d51b30 newdevice: Added support for Exalt ExtendAir (#6524) 2017-04-29 15:58:06 +00:00
Neil Lathwood
cf026659cb newdevice: Added detection for Alvarion Breeze units (#6526) 2017-04-29 15:56:17 +00:00
Neil Lathwood
14fd57bd57 newdevice: Added support for Avaya Scopia devices (#6527) 2017-04-29 15:55:25 +00:00
Neil Lathwood
4c42c91ba8 newdevice: Added support for Tycon Systems TPDIN units (#6506) 2017-04-27 22:16:41 -05:00
Neil Lathwood
e6fa8dbd13 newdevice: Added basic detection for Packetflux SiteMonitor (#6498)
* newdevice: Added basic detection for Packetflux SiteMonitor

* added missing file

* updated to include some health sensors
2017-04-27 22:14:52 -05:00
FTBZ
2aa4145a26 fix: APC/MGE UPS sensors divisor for load and voltage (#6509)
* fix: APCMGE sensors divisors

* Add missing SNMP SIM file

* Add OS test for snmprec file
2017-04-26 08:35:07 -05:00
Tony Murray
43914fbc7f newdevice: Eaton/MGE UPS reorganization (#6388)
* Eaton UPS cleanup

* newdevice: Eaton/MGE UPS cleanup

MGE split Galaxy (and Upsilon) to apc-mgeups
All others to eaton-mgeups
Remove mge ups from eatonups os.
Remove powerware it is a duplicate of eatonups

* Add rfc1528 for both mgeups os

* Update overview graphs
2017-04-24 14:04:05 +01:00
Neil Lathwood
720177965b newdevice: Added support for C&C Commander Plus units (#6478) 2017-04-22 08:13:07 -05:00
Neil Lathwood
d0201a9437 newdevice: Added detection for Ericsson UPC devices (#6472) 2017-04-22 08:12:05 -05:00
Neil Lathwood
21a70dcb8a newdevice: Added basic detection for Geist Watchdog (#6467)
* newdevice: Added basic detection for Geist Watchdog

* Added further support

* Added more health sensors
2017-04-22 08:11:21 -05:00
Neil Lathwood
3ff8b269f5 newdevice: Added support for enLogic PDUs (#6464) 2017-04-22 08:07:37 -05:00
Neil Lathwood
b27e200a6c newdevice: Added support for Eltex OLT devices (#6457) 2017-04-22 08:05:17 -05:00
Lorenzo Zafra
c31bc7d844 newdevice: Etherwan managed switches (#6488)
* newdevice: Etherwan managed switches

* Fixed requested changes
2017-04-22 12:46:12 +01:00
Tony Murray
b18d026f9d fix: ArubaOS PowerConnect detection (#6463)
fixes: #6446
2017-04-19 16:34:28 +01:00
Neil Lathwood
230fb6601b newdevice: Added detection for Ciena packet switches (#6462) 2017-04-19 10:20:45 -05:00
Tony Murray
eebf0d263a refactor: move ios detection to yaml using new sysDescr_except (#6456)
* refactor: move ios detection to yaml using new sysDescr_except

* Add IOS-XE too

* Add Catalyst 4500 test data, it needs IOS-XE for proper detection.
2017-04-19 11:02:29 +01:00
Tony Murray
963f444f17 fix: Allow line returns in snmprec files with the 4x data type (#6443)
* fix: Allow line returns in snmprec files with the 4x data type
Fill in IOS data files
IOS-XE discovery fails, fix that

* Restore IOS-XE, unsure if it can be removed
2017-04-18 22:28:48 +01:00
Tony Murray
8a8edb7d6d refactor: move the rest of avaya os detection to yaml (#6426)
Detection should be improved for these OS.
2017-04-15 08:10:15 +01:00
Tony Murray
54975f64d4 refactor: move aos discovery to yaml (#6425)
Untangle ArubaOS/AOS-W a bit.
Test data well supported by stats.
OmniStack LS, feels odd, but leaving it as AOS.
2017-04-15 08:09:14 +01:00
Neil Lathwood
d64a083141 newdevice: Added basic detection for Tandberg Magnum tape units (#6421)
* newdevice: Added basic detection for Tandberg Magnum tape units

* Tandberg icon to svg
2017-04-14 21:50:43 -05:00
Neil Lathwood
808f27e760 newdevice: Added detection for IgniteNet HeliOS (#6417)
* newdevice: Added detection for IgniteNet HeliOS

* Add empty sysDescr

* Update helios.snmprec
2017-04-14 21:25:42 -05:00
Neil Lathwood
d0c87400f3 newdevice: Added detection and sensor support for EMC OneFS v8 (#6416)
* newdevice: Added detection and sensor support for EMC OneFS v8

* Improve discovery
2017-04-14 21:25:24 -05:00
Tony Murray
e005f78211 newdevice: detect more devices as Comware (#6386)
* newdevice: improve comware detection
Only some H3C Comware devices were detected as comware, detect them all.

* Update the test data

FYI, C1234 was just a nonsense string
2017-04-13 10:52:07 +01:00
Lorenzo Zafra
bd3fd64f3e newdevice: Support - ICT Digital Power Supply (#6369)
* Basic support for ICT PSU, no sensors yet.

* Added current and voltage sensors

* Fixed coding style issues

* Fixed indexes
2017-04-12 15:00:54 -05:00
Lorenzo Zafra
457f2e9744 newdevice: Support - ICT DC Distribution Panel (#6379)
* New Device Support for ICT DC Distribution Panels

* Fixed indexes, removed tests

* Supply name instead of oid to snmp_get call

* Fixed index conflict for current sensors
2017-04-12 14:37:22 -05:00
Neil Lathwood
0f02dec4cc newdevice: Added support for Vanguard ApplicationsWare (#6387) 2017-04-12 14:20:24 -05:00
Tony Murray
c35b5b36f3 newdevice: Basic Ciena (Cyan) Z-Series detection (#6385)
issue: #6337
2017-04-08 07:14:41 +01:00
Lorenzo Zafra
5b32f71434 newdevice: Added support for Teradici PCoIP card (#6347)
* Added device discoery for Teradici PCoIP card

* Removed redundant arguments from snmp_get and comments in os definition

* Added 'workstations' as a device type
2017-04-06 20:38:12 +01:00
Neil Lathwood
61bb58b106 newdevice: Added detection fro Juniper MSS (#6335)
* newdevice: Added detection fro Juniper MSS

* update sysObjectId check
2017-04-06 18:19:25 +01:00
Lorenzo Zafra
699e99e795 newdevice: Updated OS Polling for Opengear ACM7008 (#6349)
* Add OS Polling for Opengear ACM7008

* Fixed OSDiscoveryTest.php whitespaces

* Removed 'v' from OS version polling
2017-04-05 22:48:05 +01:00
Lorenzo Zafra
f85f8c1e13 newdevice: Add support for Nokia (Alcatel-Lucent) SAS-Sx 7210. Add TiMos version and hardware. (#6344)
* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.

* Add support for Nokia SAS-Sx 7210

* Revert "I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md."

This reverts commit 2b89f9edb5.

* Edited hardware regex to cover more sample data
2017-04-04 14:35:39 -05:00
Lorenzo Zafra
9b62ea2cbf newdevice: Added basic support for Omnitron iConverters (#6336)
* Added basic support for Omnitron iConverters

* Fixed discovery issue & cropped logo
2017-04-04 13:02:50 -05:00
Neil Lathwood
b1c2ea2194 newdevice: Added HPE iPDU detection (#6334) 2017-04-03 20:02:43 -05:00
FTBZ
8f0f1ba8b9 newdevice: Add support for AvediaStream Encoder (#6306)
* newdevice: Add support for AvediaStream Encoder

* Add missing tests

* Tests ok, submit away :)
2017-03-31 12:21:41 +01:00
Neil Lathwood
3da412df2f refactor: Move some DNOS detection to PowerConnect #6150 (#6206) 2017-03-24 20:54:39 +00:00