Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We have a corporate monitoring system based in Zabbix. Its MySQL monitoring is quite basic, so I want to add more info. To do so, I've done a script that retrieves this info from MySQL and sends it to Zabbix.

Among the retrieved info, I want to get current connections, but I've only managed to do so with the root user. I've created a zabbix user with SELECT and PROCESS permissions* and tried mysqladmin -u zabbix processlist, but I get Access denied; you need the PROCESS privilege for this operation.

show grants for 'zabbix'@'%';
+----------------------------------------------+
| Grants for zabbix@%                          |
+----------------------------------------------+
| GRANT SELECT, PROCESS ON *.* TO 'zabbix'@'%' |
+----------------------------------------------+
SELECT USER(), CURRENT_USER();
+----------------+----------------+
| USER()         | CURRENT_USER() |
+----------------+----------------+
| root@localhost | root@localhost |
+----------------+----------------+

How can I get zabbix user to retrieve processlist?

* Yes, I've flushed permissions

share|improve this question
    
Would you please edit and add: the particular query you're trying to run; also, the output of SELECT USER(), CURRENT_USER() –  Shlomi Noach Feb 5 '13 at 11:33

1 Answer 1

up vote 0 down vote accepted

Perhaps you can create a DB user whose sole purpose in life is to collect the processlist.

Your error message indicates that zabbix does not have the PROCESS privilege.

Without the PROCESS privilege, zabbix can only view the processlist of zabbix users. Not much fun, eh?

But WAIT, you said

mysqladmin -u zabbix processlist

That will attempt to connect as zabbix@localhost which you did not define. Please note:

  • zabbix@localhost will authenticate via the socket file
  • zabbix@'%' will authenticate via TCP/IP

Simply run

GRANT SELECT, PROCESS ON *.* TO 'zabbix'@'localhost';

and your troubles should be over.

Without adding another MySQL user, just specify the TCP/IP protocol

mysqladmin -u zabbix --protocol=tcp processlist
share|improve this answer
    
so, maybe this is a stupid question but... doesn't 'zabbix'@'%' include 'zabbix'@'localhost'? –  Juan Clavero Feb 5 '13 at 15:21
    
They are not the same. Using localhost will authenticate a DB Connection via socket file. Using % implies that TCP/IP must be used. See my post dba.stackexchange.com/a/17110/877 for a detailed explanation on user authentication. I also updated my answer to address authenticating with TCP/IP. –  RolandoMySQLDBA Feb 5 '13 at 15:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.