Bug #36568 Adjust Init Start/Stop Script to Start Multiple Agents on the Same Server
Submitted: 7 May 2008 15:29 Modified: 9 Jan 2015 14:33
Reporter: Chris Calender Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S4 (Feature request)
Version:All OS:Any
Assigned to: Jan Kneschke CPU Architecture:Any
Tags: init script, mem, multiple agents, start multiple agents, start script, stop script

[7 May 2008 15:29] Chris Calender
Description:
Please add a feature so that multiple agents are supported with the automatically deployed init script.

With MEM an init script is added to the system to start the agent.

The documentation mentions how multiple agents can be configured on a server and how to start them.  However no init script is created for this situation and indeed only the "main" agent is started.

We have a development server which runs about 10 instances and after rebooting none of the agents are restarted.

We use config file names such as /opt/mysql/enterprise/agent/etc/mysql-service-agent.<instance_name>.ini

It would be very convenient if the init script started ALL instances rather than the default one with the
/opt/mysql/enterprise/agent/etc/mysql-service-agent.ini file.

How to repeat:
N/A

Suggested fix:
N/A
[8 Jun 2009 19:21] Kay Roepke
I cannot see how this should work.
The init.d script cannot guess the naming scheme of the config files reliably, and it is a very simple change to the init.d script to make it work today.
[8 Jun 2009 20:54] Simon Mudd
Please first if you are going to support multiple instances running on the same server at the same time, and if you wish that these instances are started at the same time when the system is started.

If you want this I would suggest something like the oracle /etc/oratab (see http://www.orafaq.com/faq/what_is_oratab_and_what_is_it_used_for) file which basically has something to name an agent instance, it's path, the user to use and then whether it should be started on boot or not.

Then make the system start stop script use this file to determine which individual instances should be started.

The agent installers would then add an entry to the /etc/"merlintab" file if the entry does not exist. It would also allow you to start or stop an agent by name rather than having to worry about a full path to the local init script.

You could even adjust this concept so that if the installer is run from a non-root account a $HOME/etc/"merlintab" would be used instead, thus maintaining a consistent behaviour.

The "global" init script would then be used as 

whatevername start
whatevername status
whatevername stop
whatevername restart

all of these commands working on all "active" instances, but taking an optional "agent instance name" which would only affect the given name.

You could make the names start at merlin1, merlin2, .... unless some installation parameter is used to define a specific agent instance name.

This would be me functional description of what would be useful.
[11 Aug 2014 13:07] Daniƫl van Eeden
With the 3.0 agent it's possible to monitor multiple instances with one agent. Do we still need multiple agents? Perhaps if instances should report to different mem servers?
[11 Aug 2014 15:58] Simon Mudd
I did use multiple agents reporting to different MEM servers in the past in MEM2. That required some magic to tunnel one proxy connection thought the other one but it did work in my dev environment.

However, I don't see that MEM really supports this and wonder if we should just accept it won't work, or that they document clearly what to expect. (I'm not sure this is clearly documented one way or another).

I no longer need this functionality.