Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-node Setup: Web class does not properly configure database port #69

Closed
rtizzy opened this issue Mar 31, 2015 · 4 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@rtizzy
Copy link
Contributor

rtizzy commented Mar 31, 2015

"database_port" is not properly set when web node is split from master node.

Puppet code:


# Zabbix Web Node

node 'MASTER' {
  file { '/etc/yum.conf':
    source => 'puppet:///modules/yum/yum.conf',
    owner  => root,
    group  => root,
  }
  class { 'apache':
      mpm_module => 'prefork',
  }
  class { 'apache::mod::php': }
  class { 'zabbix::web':
    zabbix_url      => '',
    zabbix_server   => 'MASTER',
    database_host   => 'MASTER',
    zabbix_api_user => 'whatever',
    zabbix_api_pass => 'crazysecurepassword',
    database_type   => 'mysql',
  }
}

Output:

/etc/zabbix/web/zabbix.conf.php

<?php
// Zabbix GUI configuration file
global $DB;

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = 'c2t06545.itcs.hp.com';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'zabbix_server';
$DB['USER']     = 'zabbix_server';
$DB['PASSWORD'] = 'zabbix_server';

// SCHEMA is relevant only for IBM_DB2 database
$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'c2t06545.itcs.hp.com';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'c2t06545.itcs.hp.com';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>
@rtizzy
Copy link
Contributor Author

rtizzy commented Mar 31, 2015

MySQL not binding address properly:

MySQL server seems to be using "127.0.0.1" when it should be binding to the IP/hostname when in multi-node setup.

NOTE: This can be handled by the user with mysql overrides. Not sure if that's ideal behavior.

@rtizzy
Copy link
Contributor Author

rtizzy commented Mar 31, 2015

Issue with zabbix.conf.php.erb:

Currently

$DB['PORT']     = '0';

Should probably be

$DB['PORT']     = '<%= @database_port %>';


@dj-wasabi dj-wasabi added the bug Something isn't working label Apr 2, 2015
@dj-wasabi dj-wasabi added this to the 1.3.0 milestone Apr 2, 2015
@dj-wasabi
Copy link
Contributor

Hi,

I just pushed an fix for this, would you please test it?

Kind regards,
Werner

@rtizzy
Copy link
Contributor Author

rtizzy commented Apr 6, 2015

Greetings Werner,

I've tested this fix and it appears to be working as expected both with and without the "database_port" parameter for the zabbix::web class.

Thanks for the fix!

Sincerely,

elricsfate

@rtizzy rtizzy closed this as completed Apr 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants