104 Commits

Author SHA1 Message Date
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
fcbd3a0dff Fix ".status services" to show properly possible status codes (#7663)
* Fix ".status services" to show properly possible status codes

Nagios plugins return 0-3 as the status-code for a check. This adds "warning" and "unknown" to the output as well as hierarchical color for the total.

* Fix ".status services" to show properly possible status codes

Nagios plugins return 0-3 as the status-code for a check. This adds "warning" and "unknown" to the output as well as hierarchical color for the total.
2017-11-07 09:19:18 -06:00
265e502eb2 feature: Check cli timezone from the validation webpage (#7648)
We cannot check the web timezone from the cli.
2017-11-07 11:22:12 +00:00
ad739252a2 fix: Fixed status services up/down inverse values for IRC Bot (#7657) 2017-11-06 22:11:36 +00:00
4dd56bc72e refactor: Wifi cleanup (#7607)
* refactor: remove duplicated data collection in old wifi module
Still a bit more work before we can fully remove it

* remove unused graphs
update overview graphs for some wireless os
2017-11-02 21:07:58 +00:00
0250542d64 Spelling/typo corrections reported from validate.php (#7606)
Typo and spelling mistakes corrected, as well as uniform punctuation added to all response text returned to validate.php
2017-11-01 22:58:13 -05:00
fb45f00340 fix: ping fails on servers that don't set PATH in cron (#7603)
* fix: ping fails on servers that don't set PATH in cron
Find the full path to fping and persist it in the database.
Adds the ability to persist settings with Config::set()

* Add ability to set webui settings.
No display of for paths, because it would be inconsistent.
2017-11-01 21:56:47 +00:00
d809bddb4e fix: Improve poller validation (#7586)
* fix: improve poller validation
remove failures when there are duplicate poller entries
add warning that there are duplicate poller entries
link to the poller log in the webui
small fix to getBaseURL() to avoid exception when run from cli.

* Re-run poller cleanup to try to reduce the users with duplicates.
2017-10-31 20:32:56 +00:00
51ba934e11 feature: Added web validation (#7474)
* refactor: convert validations to modules to prep for gui integration

* accidentally dropped, schema update

* fix accidental output to webui

* mention discovery-wrapper.py and re-arrange.

* refine some fix statements

* rename the Config validation group to Configuration.

* fix some scrutinizer issues
remove as many local functions from validator.php as possible
move extensions from pre-check
remove duplicate timezone check
looks like there is some db schema differences between mariadb 10.1 and 10.2, investigating

* mariadb version diff take2

* Check schema version first for database.
Remove stop to go back to command line for install docs.
Add helpful link when there is no devices added to /addhost

* fix incorrect validation for empty string defaults

* Fix style

* Add additional file permissions checks

* catch exception and fail for invalid timezone
Change visuals a bit.

* add php version warning

* fix space
2017-10-26 07:56:09 +01:00
6e379bfbbd newdevice: Added support for Alcoma wireless devices (#7476)
* New os Alcoma

* New os Alcoma

* Update AlcomaAlmp.php
2017-10-17 08:57:31 +01:00
f48cff0f1b newdevice: Added support for Racom RAy devices (#7466) 2017-10-15 19:31:44 +01:00
c927e6d68c newdevice: Updated Zyxelnwa to add storage, mempools and wireless support
* zyxelnwa: add storage, mempools and wireless

* zyxelnwa: add storage, mempools and wireless

* Update Zyxelnwa.php

* zyxelnwa: add MIB and use snmp-get
2017-10-07 21:17:51 +01:00
503500f978 feature: AD now supports nested groups (resubmit #7175) (#7259)
* feature: AD support nested groups (resubmit #7175)
Don't let groups with periods in the name cause issues.

* Merge #7245 into this PR

* Capture Exceptions in get_userlevel()

* Throw generic error if auth_ad_debug is not enabled to prevent information leak.
2017-10-04 21:31:17 +01:00
c0b267b49c refactor: Discovery protocols re-write (#7380)
* refactor: discovery protocols re-write
extract more code to make it easier to read
use snmpwalk_group
walk lldpRemTable instead of lldpRemoteSystemsData
Optimize discover_device to reduce dns lookups of bad dns names
Make discovery_by_ip behavior consistent between cdp and lldp
move can_skip_discovery to discovery functions

Tested lldp, cdp, and ospf.

* always discover links even if the remote device isn't in system
Fix discover_link always updating

* fix style

* fix update, not fetching id

* increase platform length.  Most devices use sysDescr here, which is max length 255

* remove orphaned links

* update db_schema.yaml
2017-10-04 08:16:23 +01:00
6ea6218f47 refactor: rewrite is_valid_port() (#7360)
* refactor: speed up is_valid_port()
Convert is_valid_port to Config
Several Config optimizations
Update documentation

* fix getCombined() when os key is not set, but global is.
Add more tests
2017-09-21 18:02:01 +01:00
b19b9e90d2 Revert "refactor: rewrite is_valid_port()" (#7355)
* Revert "refactor: Added detection of vlan name changes (#7348)"

This reverts commit 4ad8faecdcca0308aa8c2bf48e813a0032f8349a.

* Revert "refactor: Rewrite is_valid_port() (#7337)"

This reverts commit 31607418e1229d414040cc648b29789706679fcb.
2017-09-17 08:21:28 +01:00
31607418e1 refactor: Rewrite is_valid_port() (#7337)
Convert is_valid_port to Config
Several Config optimizations
Update documentation
2017-09-16 10:13:03 +01:00
98786c0ea7 feature: Allow ignore_mount, ignore_mount_string, ignore_mount_regex per OS (#7304)
* feature: Allow ignore_mount, ignore_mount_string, ignore_mount_regex at OS level

* Change the storage settings to override global instead of merge.
Add documentation
2017-09-13 19:43:21 +01:00
a7cb40448f Fixed and added to SAF-Integra-* detection (#7309) 2017-09-09 22:15:59 +01:00
455c72156d newdevice: Added support for Saf Integra Access points (#7292)
* newdevice: Added support for Saf Integra Access points

* Split SAF Integra models out

* added polling files

* Update saf-integra-b.yaml

* Update saf-integra-w.yaml
2017-09-08 15:22:03 -05:00