54 Commits

Author SHA1 Message Date
a2e33efba8 Use PDO for MySQL queries (#8935)
Gut dbFacile
mres() now does nothing... could have some vulnerable queries, but most are ok

TODO
- [x] IRC client broke
- [x] Install broke

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-08-17 21:29:20 +01:00
d841625f12 refactor: Refactor database and config init (#8527)
* Refactor database and config init
Connect to the database without loading full config
Load config completely so post-processing is always done consistently.
Erase existing $config when loading, fixes issues in case we load the config twice.
If the database is not connected, don't try to load database settings. (Fixes some db errors on install)
Attempt to remove $config access/modification before init.php
Remove usage of db_name, that might not match the connected database.
Centralize db config loading, so we consistently apply db_test database settings.
Many of these changes are influenced by Laravel port.

* Some safety so we don't assign strings to numeric port field
Smooth out phpunit bootstrap

* Fix a couple of scrutinizer warnings.
2018-04-11 16:15:13 +01:00
dd8849d265 device: Added Rittal IT Chiller / Carel pCOweb card (#7826)
* device: Rittal IT Chiller / Carel pCOweb

* doc: more documentation about the pcoweb card

* Update Carel-pCOweb-Devices.md

* change the limit for sensors and small changes

* fixed db_schema

* doc updates and sql fix

* doc update

* remove the eer graph to create a sensor
2017-12-30 12:08:04 +00:00
3dcadcccce Allow empty schema files (#7840) 2017-12-01 14:10:32 -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
89ff05ebea newdevice: Added firewall graphs for Palo Alto Networks firewall (#7483)
* Features: Add firewall graphs for Palo Alto Networks firewall

* Features: Add firewall graphs for Palo Alto Networks firewall

* Update db_schema.yaml
2017-10-17 12:42:13 +01:00
8e85eebe32 fix: Don't lock the schema during install.php (#7051) 2017-07-18 20:07:21 +01:00
181b0fb7d5 refactor: Use the new locks for schema updates (#6931)
* Use the new locks for schema updates

* removed schema lock from discovery

* Add the ability to wait for a lock.
Add unit tests

* Add MysqlLock
Use that for the schema updates
Wait up to 30s for other schema updates to complete.

* Switch the schema lock back to a file lock for now.
Make FileLock support indefinite locking without polling.
Add a warning to MysqlLock for scenarios where it won't work.

* Delete MysqlLock.php

* Removed MySQL lock tests
2017-07-17 19:35:08 +01:00
f02b551145 feature: Improved install experience (#6915)
always check that the base sql has been imported.
async db building
After this merge, we could move install.php to the end of the install documentation.  Makes a more natural flow.
2017-07-01 21:28:29 +01:00
23fa26b2b1 fix schema update calling set_lock() (#6563) 2017-05-03 11:15:54 -05:00
41e7689c77 refactor: DB Updates will now file level lock to stop duplicate updates (#6469)
* refactor: DB Updates will now file level lock to stop duplicate updates

* scrut fixes

* renamed function from clear_lock() to release_lock()
2017-05-03 14:48:23 +01:00
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
0f5091d273 fix: Alter the database to set the proper character set and collation (#6189) 2017-03-14 00:14:45 +00:00
da5783d917 feature: Add mysql failed query logging + fixed queries that break ONLY_FULL_GROUP_BY (#5327)
* feature: Add mysql failed query logging + fixed queries that break ONLY_FULL_GROUP_BY

* fix all schema errors and update system
2017-01-07 11:32:38 -06:00
9a33464c52 refactor: Centralize includes and initialization (#4991) 2016-11-21 20:12:59 +00:00
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
45e41ad02e fix: New installs would have multiple entries in dbSchema table (#4460) 2016-09-16 18:20:34 -05:00
7dec670494 refactor: Updated a lot of references to LibreNMS - copyright still left intact (#4339) 2016-09-08 08:12:23 -05:00
9284bc60ff Update code in includes to be PSR-2 compliant (#4220)
refactor: Update code in /includes to be psr2 compliant #4220
2016-08-28 18:32:58 +01:00
f0o
9ca926b9c6 SQLs are performed up to an execution time of 45s, then a page reload is induced to avoid fcgi/cgi/modphp timeouts. 2015-09-02 15:30:51 +01:00
f0o
501cf5a6ef Present all output+errors at the end 2015-09-02 15:30:21 +01:00
f0o
e64d145bf1 Gracefully break update 2015-09-02 15:29:10 +01:00
f0o
ca0f9ea2f9 Avoid useless I/O 2015-09-02 15:29:07 +01:00
f0o
2fd423f9fc Revert build.sql
Make update.php responsive
2015-09-02 15:29:06 +01:00
f0o
19059412da Make installer more responsive
Update each schema in update.php after applying
Packaged new build.sql bundling all updates up to 067
2015-09-02 15:29:02 +01:00
f0o
da9e071d7d Revert all PHP-Based MySQL Locks introduced in #1584 2015-09-02 14:46:42 +01:00
f0o
e11f613bdd Pause polling and discovery if there's an update-lock 2015-09-01 14:14:50 +01:00
f0o
ccfdddeae6 Added lock release for schema updates even if it gets aborted or received sigterm 2015-09-01 12:41:38 +01:00
f0o
29887af376 Remain PHP Backwards compatibility 2015-08-26 08:44:15 +01:00
33baea6d6a release schema lock 2015-08-25 11:35:25 -04:00
38af8b4c4c return instead of exit 2015-08-25 11:35:25 -04:00
d9efadb441 fix bailout comparison 2015-08-25 11:35:25 -04:00
e74a6db216 move lock checks after bail out 2015-08-25 11:35:25 -04:00
c5fcb87b51 bail if schema is already up to date 2015-08-25 11:35:24 -04:00
1379a13c76 wait for all locks to be free when updating schema 2015-08-25 11:35:24 -04:00
86e0f42dc7 bail out if we can't get a lock on schema_update 2015-08-25 11:35:24 -04:00
4792879ce5 Remove all unneeded if($debug)-statements and replace them with d_echo in the rest of the directories... 2015-08-21 16:10:01 +02:00
laf
a8c03ca786 Last fix 2015-08-12 19:55:37 +00:00
laf
4b49c148b6 Added mysqli support 2015-08-08 19:27:18 +00:00
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
laf
02792176fa Updated most files to use dbFacile 2014-03-12 22:21:33 +00:00
e490d32489 fix sql-schema update (derp)
git-svn-id: http://www.observium.org/svn/observer/trunk@3162 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-10 14:45:34 +00:00
c5e0f51ba2 don't show known errors for old sql updates
git-svn-id: http://www.observium.org/svn/observer/trunk@2886 61d68cd4-352d-0410-923a-c4978735b2b8
2012-03-08 10:25:22 +00:00
55c755e45f sigh
git-svn-id: http://www.observium.org/svn/observer/trunk@2883 61d68cd4-352d-0410-923a-c4978735b2b8
2012-03-05 21:39:07 +00:00
86697feede attempt to fix sql update issues
git-svn-id: http://www.observium.org/svn/observer/trunk@2882 61d68cd4-352d-0410-923a-c4978735b2b8
2012-03-05 10:00:31 +00:00
3ea756ae1b fix database upgrade path
git-svn-id: http://www.observium.org/svn/observer/trunk@2879 61d68cd4-352d-0410-923a-c4978735b2b8
2012-02-19 18:41:53 +00:00
cfb886a394 fix initial install issues with new sql updater
git-svn-id: http://www.observium.org/svn/observer/trunk@2878 61d68cd4-352d-0410-923a-c4978735b2b8
2012-02-19 17:14:57 +00:00
5ef2c689ba correctly run all sql update files for older revisions
git-svn-id: http://www.observium.org/svn/observer/trunk@2875 61d68cd4-352d-0410-923a-c4978735b2b8
2012-02-17 09:33:49 +00:00
6a6ee9cb7f fixes to graph widths
git-svn-id: http://www.observium.org/svn/observer/trunk@2874 61d68cd4-352d-0410-923a-c4978735b2b8
2012-02-17 00:19:18 +00:00
6494b0603b allow sql update to be run from commandline, remove now-bogus comment from menubar
git-svn-id: http://www.observium.org/svn/observer/trunk@2873 61d68cd4-352d-0410-923a-c4978735b2b8
2012-02-16 23:18:49 +00:00