aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/anacron.py26
-rw-r--r--sos/plugins/cron.py (renamed from sos/plugins/crontab.py)18
-rw-r--r--sos/plugins/cups.py (renamed from sos/plugins/printing.py)6
-rw-r--r--sos/plugins/nfsserver.py23
-rw-r--r--sos/plugins/ntp.py6
-rw-r--r--sos/plugins/openswan.py4
-rw-r--r--sos/plugins/ppp.py5
-rw-r--r--sos/plugins/system.py32
8 files changed, 67 insertions, 53 deletions
diff --git a/sos/plugins/anacron.py b/sos/plugins/anacron.py
new file mode 100644
index 00000000..e5019a43
--- /dev/null
+++ b/sos/plugins/anacron.py
@@ -0,0 +1,26 @@
+
+### 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
+import os
+
+class Anacron(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
+
+ plugin_name = 'anaconda'
+
+ packages = ('anacron',)
+
+ def setup(self):
+ self.add_copy_spec("/etc/anacrontab")
diff --git a/sos/plugins/crontab.py b/sos/plugins/cron.py
index cde73f12..f0f48560 100644
--- a/sos/plugins/crontab.py
+++ b/sos/plugins/cron.py
@@ -14,15 +14,19 @@
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class Crontab(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
+class Cron(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Crontab information
"""
- plugin_name = "crontab"
+ plugin_name = "cron"
+
+ files = ('/etc/crontab')
def setup(self):
- self.add_copy_spec("/etc/cron*")
- self.add_cmd_output("crontab -l -u root", suggest_filename = "root_crontab")
- self.add_cmd_output("""for i in `ls /home/`;\
- do echo "User :" $i;crontab -l -u $i;\
- echo "---------------";done""", suggest_filename = "users_crontabs")
+ 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/printing.py b/sos/plugins/cups.py
index 0c3e29b8..aaa3971e 100644
--- a/sos/plugins/printing.py
+++ b/sos/plugins/cups.py
@@ -20,15 +20,17 @@ class Printing(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
plugin_name = 'printing'
+ packages = ('cups',)
option_list = [("cups", "max size (MiB) to collect per cups log file",
- "", 50)]
+ "", 15)]
def setup(self):
self.add_copy_specs([
"/etc/cups/*.conf",
"/etc/cups/lpoptions",
"/etc/cups/ppd/*.ppd"])
- self.add_copy_spec_limit("/var/log/cups", sizelimit=self.option_enabled("cupslogsize"))
+ self.add_copy_spec_limit("/var/log/cups",
+ sizelimit=self.option_enabled("cupslogsize"))
self.add_cmd_output("lpstat -t")
self.add_cmd_output("lpstat -s")
self.add_cmd_output("lpstat -d")
diff --git a/sos/plugins/nfsserver.py b/sos/plugins/nfsserver.py
index 4e87452d..7ae704ee 100644
--- a/sos/plugins/nfsserver.py
+++ b/sos/plugins/nfsserver.py
@@ -25,16 +25,20 @@ class NfsServer(Plugin, RedHatPlugin):
plugin_name = 'nfsserver'
def check_enabled(self):
- if self.policy().default_runlevel() in self.policy().runlevel_by_service("nfs"):
- return True
+ default_runlevel = self.policy().default_runlevel()
+ nfs_runlevels = self.policy().runlevel_by_service("nfs")
+ if default_runlevel in nfs_runlevels:
+ return True
- try:
- if os.stat("/etc/exports")[ST_SIZE] > 0 or os.stat("/var/lib/nfs/xtab")[ST_SIZE] > 0:
- return True
- except:
- pass
+ try:
+ exports = os.stat("/etc/exports")[ST_SIZE]
+ xtab = os.stat("/var/lib/nfs/xtab")[ST_SIZE]
+ if exports or xtab:
+ return True
+ except:
+ pass
- return False
+ return False
def setup(self):
self.add_copy_specs([
@@ -43,4 +47,5 @@ class NfsServer(Plugin, RedHatPlugin):
"/var/lib/nfs/xtab",
"/var/lib/nfs/rmtab"])
self.add_cmd_output("rpcinfo -p localhost")
- self.add_cmd_output("nfsstat -a")
+ self.add_cmd_output("nfsstat -o all")
+
diff --git a/sos/plugins/ntp.py b/sos/plugins/ntp.py
index dff9f985..639b292a 100644
--- a/sos/plugins/ntp.py
+++ b/sos/plugins/ntp.py
@@ -23,7 +23,11 @@ class Ntp(Plugin):
packages = ('ntp',)
def setup(self):
- self.add_copy_spec("/etc/ntp.conf")
+ self.add_copy_specs([
+ "/etc/ntp.conf",
+ "/etc/ntp/step-tickers",
+ "/etc/ntp/ntpservers"
+ ])
self.add_cmd_output("ntptime")
diff --git a/sos/plugins/openswan.py b/sos/plugins/openswan.py
index 1354e174..22214a5d 100644
--- a/sos/plugins/openswan.py
+++ b/sos/plugins/openswan.py
@@ -14,9 +14,9 @@
## 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
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class Openswan(Plugin, RedHatPlugin):
+class Openswan(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""ipsec related information
"""
diff --git a/sos/plugins/ppp.py b/sos/plugins/ppp.py
index 6f0c5caf..edb3eb43 100644
--- a/sos/plugins/ppp.py
+++ b/sos/plugins/ppp.py
@@ -14,15 +14,14 @@
## 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
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class Ppp(Plugin, RedHatPlugin):
+class Ppp(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""ppp, wvdial and rp-pppoe related information
"""
plugin_name = 'ppp'
- files = ('/etc/wvdial.conf',)
packages = ('ppp',)
def setup(self):
diff --git a/sos/plugins/system.py b/sos/plugins/system.py
index 7f8efe05..cc287e15 100644
--- a/sos/plugins/system.py
+++ b/sos/plugins/system.py
@@ -14,46 +14,20 @@
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class System(Plugin):
- plugin_name = "system"
-
-class RedHatSystem(System, RedHatPlugin):
+class System(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""core system related information
"""
- def setup(self):
- self.add_copy_specs([
- "/proc/sys",
- "/etc/cron*",
- "/etc/anacrontab",
- "/var/spool/cron*",
- "/var/log/cron*",
- "/etc/syslog.conf",
- "/etc/rsyslog.conf",
- "/etc/ntp.conf",
- "/etc/ntp/step-tickers",
- "/etc/ntp/ntpservers"])
- self.add_forbidden_path(
- "/proc/sys/net/ipv8/neigh/*/retrans_time")
- self.add_forbidden_path(
- "/proc/sys/net/ipv6/neigh/*/base_reachable_time")
- self.add_cmd_output("crontab -l")
+ plugin_name = "system"
-class DebianSystem(System, DebianPlugin, UbuntuPlugin):
- """core system related information for Debian and Ubuntu
- """
def setup(self):
self.add_copy_specs([
"/proc/sys",
- "/etc/cron*",
- "/var/spool/cron*",
"/etc/syslog.conf",
"/etc/rsyslog.conf",
- "/etc/ntp.conf" ])
+ ])
self.add_forbidden_path(
"/proc/sys/net/ipv8/neigh/*/retrans_time")
self.add_forbidden_path(
"/proc/sys/net/ipv6/neigh/*/base_reachable_time")
- self.add_cmd_output("crontab -l")
-