Added config option for database port #5517

Merged
merged 10 commits into from Jan 27, 2017

Projects

None yet

5 participants

@geordish
Contributor
geordish commented Jan 19, 2017 edited

Fix for #5514

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.

  • Have you signed the Contributors agreement - please do NOT submit a pull request unless you have (signing the agreement in the same pull request is fine). Your commit message for signing the agreement must appear as per the docs.
  • Have you followed our code guidelines?
@geordish geordish Added config option for port
c960a36
@geordish geordish Missed some spots
ae75331
geordish added some commits Jan 19, 2017
@geordish geordish Fixed connection attempt 203250d
@geordish geordish Fixed another connection attempt
e6bee95
@geordish geordish Added option to docs
7cce743
@geordish geordish Fixed another connection attempt
c499616
@geordish geordish Set default port correctly
74e16ed
poller-wrapper.py
@@ -86,7 +87,6 @@ def get_config_data():
db_port = int(config['db_host'].rsplit(':')[1])
else:
@geordish
geordish Jan 19, 2017 edited Contributor

I'm tempted to just remove this elif completely, as I don't see how it could work with the rest of librenms?

@laf
laf Jan 23, 2017 Member

Probably a hangup from when we used mysql_connect which I think did/does accept :port

@geordish geordish Allowed port to be a string
30228eb
@laf
Member
laf commented Jan 20, 2017

./LibreNMS/IRCBot.php needs updating

Would also be good to do ./html/plugins/Weathermap/data-pick.php from the plugins repo. Happy to do that.

Looks ok to me, needs testing quite a bit though.

@geordish geordish Add port option to IRCBot.
ba691ee
@geordish geordish referenced this pull request in librenms-plugins/Weathermap Jan 20, 2017
Merged

Add mysql port config option #43

@laf
Member
laf commented Jan 23, 2017

Also needs:

./poller-service.py
./discovery-wrapper.py

@laf
Member
laf commented Jan 23, 2017

Running it in test install now.

@geordish geordish Updated python scripts
be5ee01
@scrutinizer-notifier

The inspection completed: No new issues

@laf
laf approved these changes Jan 23, 2017 View changes
@laf
Member
laf commented Jan 23, 2017

@librenms/reviewers Works for me. Anyone else want to test?

@laf laf merged commit 5dd030f into librenms:master Jan 27, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@VimCommando
Contributor
VimCommando commented Feb 2, 2017 edited

If you see poller-wrapper.py spit this error at you:

ERROR: Could not connect to MySQL database!

but validate.php and poller.php say the database connection is [OK]; double-check your db_host config. If you included the port previously (i.e. "localhost:3306") this update will break that.

The fix is to simply define db_port separately in config.php and poller-wrapper.py should work fine again.

@laf
Member
laf commented Feb 2, 2017

Sorry that this might have broken something for you - out of interest how did you have poller.php working on the non-standard port or is it just that you'd specified :3306 all along?

@aldemira aldemira added a commit to aldemira/librenms that referenced this pull request Feb 9, 2017
@geordish @aldemira geordish + aldemira refactor: Added config option for database port (#5517) 4430ef7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment