aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-11-29 19:18:31 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-11-29 19:18:31 +0000
commita13979fd02b3d71b0a38fd0bbcf7d03a9b43d018 (patch)
treefa4c7e792a2109722d7984d2a457eccbe5c139fe
parent771a5c7cd45e3c94273ea0859c26f1fbc33e161a (diff)
downloadsos-a13979fd02b3d71b0a38fd0bbcf7d03a9b43d018.tar.gz
Add basic cgroups module
Add a module to collect cgroups information. The file /proc/cgroups and directory tree mounted at /sys/fs/cgroup is collected on all supported platforms when the procfs file is present. Additional configuration files specific to Red Hat distributions are also collected.
-rw-r--r--sos/plugins/cgroups.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/sos/plugins/cgroups.py b/sos/plugins/cgroups.py
new file mode 100644
index 00000000..08557e55
--- /dev/null
+++ b/sos/plugins/cgroups.py
@@ -0,0 +1,39 @@
+### 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.plugintools import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+
+class cgroups(Plugin, DebianPlugin, UbuntuPlugin):
+ """cgroup subsystem information
+ """
+
+ files = ('/proc/cgroups',)
+
+ def setup(self):
+ self.addCopySpecs(["/proc/cgroups",
+ "/sys/fs/cgroup"])
+ return
+
+class RedHatCgroups(cgroups, RedHatPlugin):
+ """Red Hat specific cgroup subsystem information
+ """
+
+ def setup(self):
+ self.addCopySpecs(["/etc/sysconfig/cgconfig",
+ "/etc/sysconfig/cgred.conf",
+ "/etc/cgsnapshot_blacklist.conf",
+ "/etc/cgconfig.conf",
+ "/etc/cgrules.conf"])
+ cgroups.setup(self)
+