From 949190405cc0a648376e249ea0b5ae66221bb97e Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Mon, 23 Jun 2014 14:48:44 +0100 Subject: [PATCH 05/13] [mysql] limit log collection by default Only collect the main daemon log by default. Add an 'all_logs' option to request the old behaviour. --- sos/plugins/mysql.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py index e6bb6c6..c724be3 100644 --- a/sos/plugins/mysql.py +++ b/sos/plugins/mysql.py @@ -24,13 +24,19 @@ class mysql(sos.plugintools.PluginBase): optionList = [ ("dbuser", "username for database dumps", "", "mysql"), ("dbpass", "password for database dumps", "", ""), - ("dbdump", "collect a database dump", "", False) + ("dbdump", "collect a database dump", "", False), + ("all_logs", "collect all MySQL logs", "", False) ] def setup(self): self.addCopySpec("/etc/my.cnf") self.addCopySpec("/etc/ld.so.conf.d/mysql*") - self.addCopySpec("/var/log/mysql*") + + if not self.getOption("all_logs"): + self.addCopySpecLimit("/var/log/mysqld.log", 15) + else: + self.addCopySpec("/var/log/mysql*") + if self.getOption("dbdump"): dbuser = self.getOption("dbuser") dbpass = self.getOption("dbpass") -- 1.9.3