From 511fcff6b3c9f798e0e715597629704b278f45ef Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Fri, 26 Apr 2013 18:12:23 +0100 Subject: Remove cron related information from system plug-in The cron data does not belong in the system plug-in and it seems pointless to have a separate module just for crontabs (but not for cron!). Move the cron logs and tabs into a new plug-in named cron. Signed-off-by: Bryn M. Reeves --- sos/plugins/cron.py | 32 ++++++++++++++++++++++++++++++++ sos/plugins/crontab.py | 25 ------------------------- sos/plugins/system.py | 7 ------- 3 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 sos/plugins/cron.py delete mode 100644 sos/plugins/crontab.py diff --git a/sos/plugins/cron.py b/sos/plugins/cron.py new file mode 100644 index 00000000..f0f48560 --- /dev/null +++ b/sos/plugins/cron.py @@ -0,0 +1,32 @@ +### This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + +class Cron(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + """Crontab information + """ + + plugin_name = "cron" + + files = ('/etc/crontab') + + def setup(self): + self.add_copy_specs([ + "/etc/cron*", + "/var/log/cron*", + "/var/spool/cron" + ]) + self.add_cmd_output("crontab -l -u root", + suggest_filename = "root_crontab") diff --git a/sos/plugins/crontab.py b/sos/plugins/crontab.py deleted file mode 100644 index 7ec2270e..00000000 --- a/sos/plugins/crontab.py +++ /dev/null @@ -1,25 +0,0 @@ -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. - -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin - -class Crontab(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): - """Crontab information - """ - - plugin_name = "crontab" - - def setup(self): - self.add_copy_spec("/etc/cron*") - self.add_cmd_output("crontab -l -u root", suggest_filename = "root_crontab") diff --git a/sos/plugins/system.py b/sos/plugins/system.py index 9db5f51f..40c87805 100644 --- a/sos/plugins/system.py +++ b/sos/plugins/system.py @@ -23,9 +23,6 @@ class RedHatSystem(System, RedHatPlugin): def setup(self): self.add_copy_specs([ "/proc/sys", - "/etc/cron*", - "/var/spool/cron*", - "/var/log/cron*", "/etc/syslog.conf", "/etc/rsyslog.conf", "/etc/ntp.conf", @@ -36,7 +33,6 @@ class RedHatSystem(System, RedHatPlugin): self.add_forbidden_path( "/proc/sys/net/ipv6/neigh/*/base_reachable_time") - self.add_cmd_output("crontab -l") class DebianSystem(System, DebianPlugin, UbuntuPlugin): """core system related information for Debian and Ubuntu @@ -44,8 +40,6 @@ class DebianSystem(System, DebianPlugin, UbuntuPlugin): def setup(self): self.add_copy_specs([ "/proc/sys", - "/etc/cron*", - "/var/spool/cron*", "/etc/syslog.conf", "/etc/rsyslog.conf", "/etc/ntp.conf" ]) @@ -54,5 +48,4 @@ class DebianSystem(System, DebianPlugin, UbuntuPlugin): self.add_forbidden_path( "/proc/sys/net/ipv6/neigh/*/base_reachable_time") - self.add_cmd_output("crontab -l") -- cgit