rackerlabs / recap

A system status reporting tool
GNU General Public License v2.0
91 stars 55 forks source link

option: mysql show processlist instead of show full processlist #231

Open mikegriffin opened 4 years ago

mikegriffin commented 4 years ago

It would be nice to have a non-FULL processlist configuration that continues to default to full processlist (call a new print_mysql_full_procs):

USEMYSQLFULLPROCESSLIST=yes

print_mysql_procs() ..

mysqladmin processlist

print_mysql_full_procs() mysqladmin -v processlist

Whether the above is implemented or not, it would be good to correct existing logging which incorrectly claims that "show processlist" was issued.

This feature request is to avoid having to suppress all error messages going to email from cron, when you regularly hit an error around max_allowed_packet, as might happen if you are often doing a large INSERT for bulk loading (eg you do not want to change the defaults for all local clients)

tonyskapunk commented 4 years ago

Hi @mikegriffin thanks for opening this request.

I see the concern, currently the USEMYSQLPROCESSLIST is using -v in the process list command in a couple of places:

https://github.com/rackerlabs/recap/blob/b4d296a5d0291a020ef15ce3243837dbc68d0590/src/core/mysql#L104

https://github.com/rackerlabs/recap/blob/b4d296a5d0291a020ef15ce3243837dbc68d0590/src/core/mysql#L121

I think is easy to create a new function to distinguish between PROCESSLIST and FULL PROCESSLIST.

USEMYSQL is not enabled by default nor USEMYSQLPROCESSLIST

https://github.com/rackerlabs/recap/blob/b4d296a5d0291a020ef15ce3243837dbc68d0590/src/recap#L95-L99

Anyone wanting to use the mysql functionality would need to choose the desired option.