Bug #44748 Agent does not identify the instance in error messages
Submitted: 8 May 2009 12:56 Modified: 9 Jul 2010 8:04
Reporter: Harrison Fisk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S3 (Non-critical)
Version:2.0.5.7153 OS:Any
Assigned to: Mark Leith CPU Architecture:Any

[8 May 2009 12:56] Harrison Fisk
Description:
When giving error messages regarding a MySQL instance being monitored, the agent does not indicate which instance it is.  If the agent is monitoring a bunch of MySQL servers this makes it very hard to identify which one is having the problem.

For example:

2009-05-08 14:08:40: (critical) executing 'SHOW /*!50000 ENGINE */ INNODB STATUS' failed: Access denied; you need the PROCESS privilege for this operation
2009-05-08 14:08:40: (critical) last message repeated 1 times

How to repeat:
1.  Setup an agent to monitor multiple servers
2.  Cause one server to generate an error for the agent
3.  Try to figure out which one has the error

Suggested fix:
Output some identifying information regarding which server is having the problem.
[8 May 2009 15:53] Andy Bang
When monitoring multiple instances, please be aware of Bug #37258 (http://bugs.mysql.com/bug.php?id=37258) and Bug #31487 (http://bugs.mysql.com/bug.php?id=31487).
[8 May 2009 16:55] Simon Mudd
Thanks but:

You do not have access to bug #37258.
You do not have access to bug #31487.

So hard to be aware of these.
[8 May 2009 17:14] Simon Mudd
I'd suggest something like:

2009-05-08 14:08:40: (critical) executing 'SHOW /*!50000 ENGINE */ INNODB STATUS' failed:
Access denied; you need the PROCESS privilege for this operation reported to user <merlin_agent_user> accessing <monitored_host_name>:<port>.
[9 Apr 2010 7:37] Simon Mudd
Still broken in 2.1.2.1160. will this get fixed for 2.2?

2010-04-09 09:23:02: (critical) MySQL Monitor Agent 2.1.2.1160 started.
2010-04-09 09:23:02: (critical) network-io.c:311: successfully reconnected to dashboard at https://merlin_agent:XXXXXX@xxxxxxxxxx.prod.xxxx.xxxxxxx.com:443/heartbeat
2010-04-09 09:23:02: (critical) agent_mysqld.c:707: successfully connected to database at avrdbprod-vip2:3306 as user merlin_agent2 (with password: YES)
2010-04-09 09:23:02: (critical) agent_mysqld.c:707: successfully connected to database at bprdbprod-vip2:3306 as user merlin_agent2 (with password: YES)
2010-04-09 09:23:03: (critical) executing 'SHOW /*!50000 ENGINE */ INNODB STATUS' failed: Access denied; you need the PROCESS privilege for this operation (1227)
2010-04-09 09:23:03: (critical) last message repeated 1 times

Can this not be fixed?
This particular server has only 3 instances running, but other dev servers have up to 10 running on the same server so it's rather a nuisance to have to go looking around to find the offending configuration.

On further thought it might even be possible to suggest the required GRANT statement based on the user credentials:

To resolve this issue execute: GRANT PROCESS ON *.* TO 'merlin_agent2'@'XXXXX' (filling in the correct credentials (CURRENT_USER() ?)

This is trivial for you to do and ensures the DBA does not need to think or look up the required action elesewhere.
[25 Jun 2010 15:01] Enterprise Tools JIRA Robot
Mark Leith writes: 
Stealing this, patch pushed to 2.2:

1889 Mark Leith	2010-06-25
     Bug#44748 / EM-3269 Agent does not identify the instance in error messages
      - We were always setting m->isntancename->str to the directory name of the instances, i.e "mysql"
      - Set back to using socket, or host:port
      - Added the instancename to all other error messages around mysqld instances

   modified:
     src/agent-inst-config.c
     src/agent-inst-config.h
     src/agent_mysqld.c
     src/job_collect_mysql.c
[7 Jul 2010 21:08] Enterprise Tools JIRA Robot
Andy Bang writes: 
In build 2.2.2.1729.
[8 Jul 2010 18:19] Enterprise Tools JIRA Robot
Marcos Palacios writes: 
Verified fixed in agent build 2.2.2.1729.
[9 Jul 2010 8:04] MC Brown
A note has been added to the 2.2.2 changelog:

        When reporting errors related to multiple instances monitored                                                                                      
        by the same &merlin_agent;, the error message would not                                                                                            
        indicate which instance reported the error.