Commit Graph

66 Commits

Author SHA1 Message Date
Tony Murray
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
Neil Lathwood
529660b8c5 docs: Updated docs to include installing xml php modules + updated validate (#7349) 2017-09-15 19:29:54 -05:00
Tony Murray
dc110d2d97 fix: Do not issue non-master warning if on the release update channel (#7297) 2017-09-07 09:18:19 +01:00
Neil Lathwood
f2c69f35d0 refactor: Updated validate.php to only warn users the install is out of date if > 24 hours (#7208)
* refactor: Updated validate.php to only warn users the install is out of date if > 24 hours

* Fix 24hrs, not 48hrs
2017-08-24 06:28:59 +01:00
Tony Murray
1d777693e1 feature: New IP parsing classes. Removes usage of Pear Net_IPv4 and Net_IPv6. (#7106)
* Refactor remove use of pear Net_IPv4 and Net_IPv6

Caution, I added tests to test the functionality of the new functions, but I'm not 100% certain the replaced usages match 100%.  Please test.

Left usage in generate-iplist.php because I'm not sure the use of that script, so I didn't want to implement additional functionality to support it.

Add support for ipv6 fo ipInNetwork() function

Add phpdocs to functions
Remove accidental inclusion

Use binary operations instead of string for networKFromIp()
Tidy up binary operations in ipInNetwork()

tidy parsing cidr network

Change to a class based implementation.

Update phpdocs.
Fully catch exceptions for hex parsing.

Fix mistake.

support older phpunit versions

Fix php shifting to negative with php 5

* Fix graph authorization. Uncaught exception and checking an ipv4 against an ipv6 network == fail.

* Also remove colons from hex strings.

* Fix typo in bgp polling
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
2017-08-08 14:14:58 -05:00
Tony Murray
1e77d4b3ea refactor: validate.php improvements (#6973)
Always output header (may be missing mysql data)
Improve version display, now looks like '1.28-129-g74e6c3edf' <tag>-<commits since tag>-<shortag>
Add mysqli to the list of required extensions, check extensions before init
Add dbIsConnected() function, used to check if we have db in version_info()
Do not die on IPv4 and IPv6 so validate can print errors.
Move git checks so they are output together
fix rrdtool 1.7.0 reports version as 1.7.01.7.0
2017-07-17 19:02:28 +01:00
Tony Murray
74e6c3edf5 feature: ignore web server log files ownership in validate (#6943) 2017-07-03 22:17:07 +01:00
Neil Lathwood
573a4b0e62 Updated validate to detect lower case tables + added support for checking mariadb 10.2 timestamps (#6928)
* Updated validate to detect lower case tables + added support for checking mariadb 10.2 timestamps

* updated install docs
2017-07-03 15:46:45 -05:00
Tony Murray
ebdfbd00d8 fix: validate prefer capabilities over suid for fping (#6644)
* fix: validate prefer capabilities over suid for fping

* fix logic
2017-05-15 23:45:02 +01:00
Neil Lathwood
069020cb80 updated rrdtool ver check to wrap quotes around (#6393) 2017-04-11 07:04:25 +01:00
Neil Lathwood
5ce9b6b2e8 feature: Added rrdtool version check to compare installed version with defined version (#6381)
* feature: Added rrdtool version check to compare installed version with defined version

* update to check config is not > than installed ver
2017-04-10 08:11:56 -05:00
Tony Murray
b1a414e785 feature: support non-standard unix socket (#5724)
* Add support for custom MySQL unix-socket

* NULL must be lowercase!

* Naive edit of html/install.php

* fixup

* Refactor dbConnect
Use it everywhere

* $config needs to be global
Don't need to set $database_link

* small cleanups
2017-04-06 22:02:37 +01:00
Tony Murray
907a601c1d Fix an issue with table creation (named indexes merged) (#6366) 2017-04-05 11:19:22 -05:00
Neil Lathwood
03deb6434a feature: Added ability to validate database schema (#6303)
* feature: Added ability to validate database schema

* small scrut fixes

* Check for extra tables and columns
Print 30 items of schema updates, easier to copy paste sql

* Now supports detections and suggested fix for:
tables: missing, extra
columns: missing, extra, incorrect
indexes: missing, extra, incorrect

* final changes + hook into travis
2017-04-05 09:00:28 +01:00
Tony Murray
a2115458af fix validate wrong comparison (#6242) 2017-03-22 22:13:40 +00:00
Tony Murray
5d5c3d8887 Check for devices before checking discovery and poller (#6217)
Use the pollers table to check poller last run
Don't rely on all poller entries being valid, we never remove entries from that table.
2017-03-22 08:14:03 +00:00
Neil Lathwood
dad2a5e9cc Updated bitly link in validate and updated docs to use pastebin service (#6179)
* replaced bitly link

* updated docs for adding new OS
2017-03-12 21:21:26 -05: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
Neil Lathwood
24a5f6bd37 Db collation standardisation (#5932)
* initial work to standardise collation

* more updates

* final bits for collation update (famous last words)

* Rename 165.sql to 166.sql

* Update schema version inside 166.sql

* moved schema file 166->171
2017-02-27 18:28:01 +00:00
Neil Lathwood
16c4425469 change validate to check if sql_mode is blank (#5981) 2017-02-23 23:02:51 +00:00
David Bell
5dd030f438 refactor: Added config option for database port (#5517) 2017-01-27 23:16:04 +00:00
Andrew Wippler
d526a16042 Updating help text when validate cannot find a bin (#5584) 2017-01-25 00:25:40 +00:00
Tony Murray
dc4747e853 fix: validate suid is set for fping (#5474) 2017-01-16 19:19:23 +00:00
David Bell
44071e83b1 feature: Added check for if git executable (#5444) 2017-01-15 22:54:06 +00:00
Tony Murray
586f7e90c5 fix: validate mysql queries (#5365) 2017-01-09 20:17:16 +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
Tony Murray
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
Neil Lathwood
5f8e5e7d3a Added check for local timezone = php timezone (#4965) 2016-11-15 07:18:07 +00:00
Layne
99e5970357 Change output to create a table when pasted into github (#4938) 2016-11-04 19:26:05 +00:00
Tony Murray
2eb504f194 fix: do not show fail if running as the librenms user + slightly less false positives (#4821) 2016-10-19 20:14:12 +01:00
Tony Murray
c5177c26af feature: validate.php: check poller and discovery status (#4663) 2016-10-03 17:48:19 +01:00
Tony Murray
d2193f76ca feature: allow scripts to be run from any working directory (#4437)
* feature: allow validate.php to be run from any working directory

* remove redundant realpath() call

* re-add realpath() to remove symbolic links

* realpath() isn't needed...

* chdir() in all php scripts in ./ and ./scripts/

* update-sql.php clearly is not used, as it was broken.

* Change some scripts to executable
Remove extra chdir() call in snmp-scan.php

* Missed console-ui.php
Kind of fixed console-ui.php help output

* Re-add newline
2016-09-14 16:53:04 +01:00
deutor
5f68bb82cd Formatting issues
Formatting issues
2016-08-31 11:01:33 +02:00
deutor
74675a7b00 Change the way username is obtained
Username should be obtained by getting user name for effective UID. Using USERNAME or USER variables is not the right way (when you just "su" and not "su - " it keeps previous username):
id  :  uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=user_u:system_r:unconfined_t
./validate.php:   [FAIL]    You need to run this script as root
echo $USER: <name of user that did su>
2016-08-31 10:20:07 +02:00
Tony Murray
abc6a5b799 PSR-2 Final cleanup (#4247)
refactor: Final PSR2 cleanup
2016-08-28 23:32:55 +01:00
Tony Murray
b8e9b2d917 Implement an autoloader (#4140)
* Implement an autoloader

When cleaning up classes for psr2, things got a bit unwieldy, so I implemented a class autoloader.
I created a PSR-0 compliant LibreNMS directory and moved all classes there that made sense.
Implemented LibreNMS\ClassLoader which supports adding manual class mappings

This reduces the file includes needed and only loads classes when needed.

* Add teh autoloader to graph.php

* Add a small bit of docs
Fix incomplete class in includes/discovery/functions.inc.php
2016-08-21 14:07:14 +01:00
laf
817ac245c0 Updated validate script to put markers in place 2016-08-01 19:42:48 +01:00
laf
b35321cdad Updated version_info to output unix timestamp 2016-07-31 22:41:39 +01:00
Tony Murray
f10d74f372 Validate.php timezone failure
Move the timezone into the constructor.
2016-07-22 10:09:25 -05:00
Tony Murray
aa23223f71 Also check the output of git before saying there is modified files
Indent files to improve readability
2016-07-14 15:46:24 -05:00
Neil Lathwood
0f5cfb5af1 Merge pull request #3782 from murrant/git-date
Add date to git version info
2016-07-07 19:09:15 +01:00
Tony Murray
846c5ab0c9 Add date to git version info
valdiate: local tz, rfc2822
poller: iso 8601
about: iso 8601 -> browser local
Also, do not fetch github info on about page, it isn't used.
2016-07-06 13:17:13 -05:00
laf
a01dc6620d Changed mysql strict from warn to fail 2016-07-06 14:47:07 +01:00
Tony Murray
080c59c387 Correct check for command results. 2016-07-01 16:16:23 -05:00
Tony Murray
2dbec67088 Run git as the configured user when ./validate.php is run as root
Move the modified files check out of the get_version function
2016-07-01 12:49:44 -05:00
laf
dc0379cdee fix php 5.4 in validate 2016-05-02 21:41:36 +00:00
Tony Murray
bf1e7c2822 Three new validate.php checks
* Check that $config['install_dir'] is set correctly by checking that config.php exists there.
* Check if the local branch is not master, warn that it will prevent updates
* Check for modified files and list them (this will not include staged files)
2016-04-29 12:53:02 -05:00
laf
ad45ade8a0 Added check for php.ini timezone being set 2016-04-26 13:08:21 +00:00
laf
e64483521b Added command to chown install dir to correct user 2016-04-23 15:13:43 +00:00
Paul Gear
1a3213b81f Minor clarifications 2016-03-17 10:18:16 +10:00