123 Commits

Author SHA1 Message Date
9b9fb121ab Remove dependencies from the repository, update install docs (#6920)
After vendor is un-indexed restore the contents so things keep working.
2018-02-06 08:17:44 -06:00
fa1d9e9238 Fix incorrect processor unique index query (#8202) 2018-02-05 23:02:57 -06:00
11147d3bbf Major Processors rewrite (#8066)
* Extract DiscoveryItem and move some things to better places.
Extract model class
Fix up model construction.  I have problem with construction...
Makeshift model working.  Switch constructor to factory.  discover() and create()
Support legacy discovery.
Remove uneeded custom pollers
Remove netonix custom detection as we try ucd on all os now.
Add a few yaml procs.  Fix a couple things.
More processor discovery conversions
Move Calix e7 to standard hrProcessorLoad, but it doesn't fully implement the HR-MIB, move things around to make it work.
Add a few yaml procs.  Fix a couple things. Correct some stupid mib stuff.
Move more, drop php 5.3
Add netscaler which uses string indexes.  Port fiberhome to yaml and use skip_values
More conversions.  BroadcomProcessorUsage Trait
Serveriron and Ironware share some mibs.  Create a common abstract os for them.
Add yaml support for mib specification in each data entry
Make legacy discover_processor() set 0 for hrDeviceIndex

Untangle Dell switch OS processors

Use use shared OS for groups if they don't have a specific group.
fix silly mib mistake

Make index optional

Move HR and UCD to Traits and out of Processor.

* forgot to update the fortiswitch index

* Make sgos and avaya-ers match the old index.

* fix comware test data

* fix merge errors

* fix dsm and remove pointless empty modules

* file not found exception is in the wrong place.

* Updated processor development docs
2018-02-05 07:39:13 -06:00
b2762d9fa7 refactor: Prevent function collisions with Laravel (#8166)
Make function call compatible
drop insensitive starts_with and ends_with for now as they aren't needed.
2018-01-29 21:58:21 +00:00
92e1048940 fix: Make consistent with other authorisers (#8151)
Discussed in #7601
2018-01-27 06:57:40 -06:00
f1a2e8d3b4 Exclude some modules when collecting all modules (#8124) 2018-01-25 21:07:10 +00:00
6878df8c12 Prep for composer changes (#8075)
* Prep for composer changes

* Update composer.json, composer.lock and a small update to phpmailer and Yaml

* Prevent accidental `composer update` runs

* Add  --no-interaction to daily.sh
2018-01-22 08:16:37 -06:00
7b918cb61d fix: Pushover message fix to enable templates (#8118) 2018-01-21 20:16:55 +00:00
f7941797b6 Fix testing state sensor index dumping order. (#8117)
Add netonix state sensor test data
2018-01-21 07:43:10 -06:00
494c29aefa Split save-test-data.php into two scripts, allow mass update (#8115)
* Add mass update to save-test-data.
Fail when snmpsim doesn't start and try to give a hint.

* Split save-test-data.php into two scripts

One for updating snmprec files.
One for updating db dump files.
2018-01-20 20:22:47 -06:00
88b4e31912 refactor: Refactored bgp-peers (#7972)
* bgp-peers update
Use IP parsing library more effectively.
Fix update issue
Include comware bgp-peers test data
deeper refactoring
Allow JunOS fallback to BGP4-MIB, some models only use that.
Add junos bgp4 data
Actually update all bpg data in the poller

* fix arista data. refactor some to prevent missing data from mucking things up

* refactor to use $oid_map for BGP4-MIB too

* A few comments to break up teh file a bit

* Junos bgp data an a quick revert for now.

* small cleanup

* fix ios bgp polling, add test data

* check the correct variable
2018-01-18 20:54:38 +00:00
d4bd566d36 newdevice: Added Support for cambium PTP 300, 500, 600 and 800 (#7998)
* Add Support for cambium-ptp500

Added mibs for ptp500, ptp300

* ptp500 - Switch modulation to a state

* Update label on 500 to 500/300

300 and 500 use the same mibs

* Request changes

Added overhead graph's to all current ptp devices

* wrap text in quotes

* Fix discovery bug

* Ptp600 support

* PTP800 Support

* Fix ptp600 issues

* Remove meh copy and pasta

* Remove modulation from OS file

* Update value modifiers / typos

* +x rename-mibs.php

* Modify cambium mibs
2018-01-16 22:52:11 +00:00
44c1ee5f43 Fix tests... (#8080)
Don't exit when we can't add a device, fail :)
2018-01-12 15:24:12 -06:00
d515f5043e refactor: Move install to php53 branch if running an unsupported version of PHP (#8042)
* Move install to php53 branch if running an unsupport version of PHP

* Update validate

* Move PHP version check after update check.  This will prevent us from moving no update users to the php53 branch.

Hopefully if daily.php -f update fails it returns a non-zero and we can move them to the php53 branch still.

* Wiggle things around more.

* Also, send release installs to the php53 branch.

* Set notification error for old PHP version.
2018-01-10 14:40:58 +00:00
2fb8dd7904 fix: ldap-authorization should be considered external (#8047)
* fix: ldap-authorization should be considered external

When sso auth type was added (1c6b7a9), some code for getting a username
was moved into HttpAuthAuthorizer. LdapAuthorizationAuthorizer uses the
same process to get the username and needs to be updated as well.

* Use common implementation of getExternalUsername

Authorizers get the default implementation by setting AUTH_IS_EXTERNAL.
ADAuthorizationAuthorizer is another candidate.
2018-01-09 16:13:47 -06:00
b2a54dae3b Testing updates: module testing and collect only (#8063)
* Testing updates module testing and collect only

* cache clear no-longer needed.
2018-01-09 11:40:26 -06:00
42e5819130 refactor: Updated discovery/poller to use numeric sysObjectID (#7922)
* refactor: Updated discovery to use a core module for sysDescr/sysObjectID use

* final update hopefully

* revert changes

* more changes + docs

* migrated poller to use numerical sysObjectID

* more updates for sysObjectID

* update any alert rules which might have enterprises. in

* moved schema file

* small updates

* updated getHostOS()

* scrut fixes

* updated sysObjectId -> sysObjectID

* updated sysObjectId -> sysObjectID

* updated remainder of sysObjectId -> sysObjectID

* another sysObjectId -> sysObjectID

* fixed secureplatform test data

* Fix tests: $device is not pulled from the database before polling
Also, update the db in the core discovery module.
2018-01-06 23:00:47 -06:00
6a122f21f4 Improve test data capture multi-line data matching (#8023) 2018-01-04 10:25:29 -06:00
7d0ad5c4ef tests: Added testing for Arista EOS BGP (#7984)
* tests: Added testing fro Arista EOS BGP

* fixing tests

* small updates

* last one

* more updates

* Account for no space after = in snmp data
always load_os() when a new device is freshly loaded by device_by_id_cache()

* don't be fatal in load_os()

* Update json to correct data
2017-12-30 10:31:06 +00:00
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
d9169c6842 device: Cambium cnPilot Support (#7898)
* Cambium cnPilot Support

* Requested changes

* Update MIB dir and snmp_get method

* Fixed assigned var

* Add SysObjectId in tests
2017-12-26 10:03:23 +00:00
e24b55ba98 Fix module dependency selection. (#7933) 2017-12-20 21:32:21 -06:00
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
ade19f93be fix: Fixed PMP frequency divisor (#7899)
* Update Frequency Divisor

* Fix Linting

* Update array declaration
2017-12-15 20:51:45 +00:00
adca942552 Fix: Add user level to getUser for LDAP authentication (#7896)
* Fix: Add user level to getUser for LDAP authentication

* Fix: Add user level to getUser for LDAP authentication for current user only
2017-12-12 07:46:29 -06:00
c22c879983 fix: Remove faulty memcached code (not related to distributed polling) (#7881) 2017-12-10 20:40:45 +00:00
5ff03d5942 refactor: Refactor alert transports to classes (#7844)
* Refactor alert transports to classes

* Fix linting

* Make Slack alert transport php 5.3 compatible

* Rename call method to deliverAlert for alert transport
2017-12-10 20:20:28 +00:00
0dd3ec25d3 device: Update Cambium devices to the new wireless sensors (#7703)
* Inital cambium refactor

* Refactored tests

* Remove CMM from pmp group

* Add sensors / Give CMM individual OS

* Fix linting

* More Sensors / states and Revised Headers

* Added old graphs / more sensors

* Add modulation rate to sensor

* Fix Hardware detection bug

* Further hardware detection refinments

* Modify pmp hardware detection

* New Wireless Metric - SSR

* SSR Sensor Graph

* Migrate SSR to metric

* Added last metric file

* Add master check to isAp method

* Fix variables in epmp

* CMM Discovery and state addition

* Add another test for cmm
2017-12-06 21:36:01 +00:00
a4b5c28356 Fix web validation shows Array (#7860)
fixes: #7851
2017-12-06 08:26:32 +00:00
38bde97fc4 mcrypt is optional, update for PHP 7.2 (#7859) 2017-12-06 08:24:20 +00:00
cdf5b05934 Replace usages of array_combine() that match array_by_column() (#7863)
Also, fix up some usages where just array_column() will do.
2017-12-06 08:19:29 +00:00
d2227471ba device: Update wireless sensors for Ray and Alcoma devices (#7820)
* Update wireless sensors Ray and Alcoma

* Update wireless sensors Ray and Alcoma
2017-11-29 21:14:12 +00:00
d6db01abb5 refactor: Refactor fix php codesniffer 3.x issues (#7816)
We cannot use 3.x because it  requires php 5.4, so update to 2.9.1 or newer 2.x release.
2017-11-29 08:23:19 +00:00
d362cd3368 Validation require memcached extension for distributed pollers (#7815) 2017-11-28 21:19:06 -06:00
1c6b7a967f Single Sign-On Authentication Mechanism (#7601)
* Allow the URL a user is sent to after logging out to be customised
This is required for any authentication system that has a magic URL for logging out (e.g. /Shibboleth.sso/Logout).

* Allow auth plugins to return a username

This is a bit cleaner than the current auth flow, which special cases e.g. http authentication

* Add some tests, defaults and documentation

* Add single sign-on authentication mechanism

* Make HTTPAuth use the authExternal/getExternalUsername methods

* Add to acknowledgements

* Add reset method to Auth
2017-11-28 20:40:17 -06:00
6b5dccc169 refactor: AD Auth defer connection until it is needed (#7768)
* refactor: AD Auth defer connection until it is needed
Nice error if php-ldap is missing instead of http 500.

* Add the same error when ldap is missing to other auth methods.
Not as graceful looking in the authorizers since they do not defer connection.
2017-11-28 09:19:34 -06:00
666c7b2700 Fix: Current tx power on Racom Ray (#7813) 2017-11-28 08:02:42 -06:00
2e73b75297 fix: Use memcached to lock daily processes on Distributed Pollers (#7735)
* fix: use memcached to lock daily processes on Distributed Pollers

* All the locks!
2017-11-24 09:37:52 +00:00
257a314fca feature: Validate session directory is writable (#7784) 2017-11-23 08:29:10 +00:00
0c83bd051b Fix: Authentication on CentOS6 (#7771)
There is no need to redeclare abstract functions if the class is already abstract and they are declared in parent.
For some reason the PHP on CentOS7 throws an error with this where all other php versions I tested were fine with it.
2017-11-19 21:59:05 -06:00
d8c33463c6 fix: ldap auth typo (#7766) 2017-11-19 13:02:19 -06:00
c9728a1f71 refactor: Refactored authorizers to classes (#7497)
* Refactored authorizers to classes

* Merge changes for #7335

* ! fix php 5.3 incompatibility

* Update ADAuthorizationAuthorizer.php

* Fix get_user -> getUser

* Rename AuthorizerFactory to Auth, fix interface missing functions

* Add phpdocs to all interface methods and normalize the names a bit.

* Re-work auth_test.php AD bind tests to work properly with the new class.
Reflection is not the nicest tool, but I think it is appropriate here.
Handle exceptions more nicely in auth_test.php

* Restore AD getUseList fix

Not sure how it got removed

* fix auth_test.php style
2017-11-18 10:33:03 +00:00
00a73a2432 Only warn if there is ipv6 disabled (#7757)
* Only warn if there ipv6 is disabled

* Change message & if condition
2017-11-18 01:36:06 -06:00
0dab58c85c fix: Fixed incorrect mail validation (#7755) 2017-11-17 09:09:08 +00:00
c36c80f486 fix: Fixed Component status log (#7723)
I have failed SQL in my log for creating entries.
Which amount to "Component Created"

It doesn't seem as though the status log is displayed/used anywhere.  Especially considering, it didn't work.  So, I would be fine with deleting it too.
2017-11-13 20:43:28 +00:00
b79d106c56 fix: Errors with missing posix extension (#7666)
* fix: errors with missing posix extension
It should be an optional dependency

* add php71w-process to the CentOS 7 install docs
2017-11-10 15:20:47 +00:00
de6266cb88 fix: fping6 validation when fping6 doesn't support IPv6 (#7682)
Found a version of fping6 on repoforge that doesn't support ipv6, lol.
2017-11-09 20:32:51 +00:00
44cb59d54e refactor: Rewrite a bit of the irc bot (#7667)
also, use the appropriate dbFetchCell()
2017-11-07 20:30:59 +00:00
cbe6cb532d Fix: Discovery validation with ping-only devices (#7665)
* fix: validation check cli php extensions
Fix fatal errors when mysql is not loaded / can't connect

* fix: discovery validation incorrectly detects on ping only devices.
2017-11-07 20:09:49 +00:00
52784ed189 fix: Extra fping checks in validation (#7651)
* fix: Extra fping checks in validation
Don't check suid or getcap if we can execute fping (as librenms or webserver user)

* Warn about suid in webui

* Update Programs.php

* Update Programs.php

* Use locate_binary() so we match production code (it is also better)
Don't cripple capabilities check, prefer that over suid.
2017-11-07 12:32:42 -06:00