jasonmcintosh / rabbitmq-zabbix

Zabbix RabbitMQ Configuration
Apache License 2.0
251 stars 168 forks source link

Override hostname #58

Closed emccormickva closed 7 years ago

emccormickva commented 7 years ago

Hello,

I've attempted to override the rabbitmq server hostname by setting HOSTNAME= in .rab.auth but it seems to use it. Rather it's using the default environment variable. Would it be possible to have an override put in or is there a way to do it that I'm missing? I have multiple interfaces and the one that rabbit listens on is different than the one associated with the system hostname.

Thanks, Erik

jasonmcintosh commented 7 years ago

Depends - are you talking the rabbitmq host name, or the hostname for the zabbix agent? Or both?

Note, that --hostname is used for the rabbitmq server connection and --senderhostname is used for the Zabbix host name.

There's also an option I believe in the zabbix config file for this vs modifying the configuration. You'll likely need to update the .sh files - not sure I ever added all the available options to the .sh files.

emccormickva commented 7 years ago

I am referring to the rabbitmq server hostname. For example, in your discovery script list, list_rabbit_nodes.sh, you have "--hostname=$HOSTNAME". $HOSTNAME is set by the system and doesn't get overridden by setting HOSTNAME in .rab.auth. Maybe it can't be, I'm not sure. Maybe we could just use another variable $HOST_NAME and set == $HOSTNAME if it's not explicitly set.

My situation is I have two 3 interfaces on this server for specific purposes. The interface that rabbit listens on is controller1.cc whereas the hostname is set to controller3 which applies to a management interface where DNS, NTP and various other things reside. I need to be able to specify which one to use so I don't have to have Rabbit listening everywhere. make sense?

jasonmcintosh commented 7 years ago

Odd... I'd say fiddle with it, see if it works? Not had time to really debug this much :( But changing the variable in the .rab.auth and .sh files to HOST_NAME should be pretty easy to do as a test.

jasonmcintosh commented 7 years ago

Closing as not heard much in a long while. If you need more help re-open