From 494f1de1db6c29a3f5f6d0e5cabc29b86eaf99e8 Mon Sep 17 00:00:00 2001
From: astokes
Date: Wed, 17 Feb 2010 16:27:19 +0000
Subject: -blah
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@777 ef72aa8b-4018-0410-8976-d6e080ef94d8
---
src/ChangeLog | 248 -----------
src/LICENSE | 340 --------------
src/MANIFEST.in | 10 -
src/Makefile | 90 ----
src/README | 35 --
src/README.rh-upload | 54 ---
src/TODO | 19 -
src/example_plugins/example.py | 94 ----
src/example_plugins/fsusage.py | 23 -
src/example_plugins/release.py | 21 -
src/example_plugins/runcommand.py | 45 --
src/extras/rh-upload | 283 ------------
src/extras/sos-open | 151 -------
src/extras/sysreport/functions | 132 ------
src/extras/sysreport/sysreport-fdisk | 8 -
src/extras/sysreport/sysreport.legacy | 766 --------------------------------
src/extras/sysreport/text.xsl | 33 --
src/gpgkeys/gpg.template | 14 -
src/lib/sos/__init__.py | 0
src/lib/sos/helpers.py | 176 --------
src/lib/sos/plugins/__init__.py | 0
src/lib/sos/plugins/acpid.py | 24 -
src/lib/sos/plugins/amd.py | 36 --
src/lib/sos/plugins/anaconda.py | 34 --
src/lib/sos/plugins/apache.py | 28 --
src/lib/sos/plugins/auditd.py | 27 --
src/lib/sos/plugins/autofs.py | 61 ---
src/lib/sos/plugins/bootloader.py | 32 --
src/lib/sos/plugins/cluster.py | 299 -------------
src/lib/sos/plugins/cobbler.py | 31 --
src/lib/sos/plugins/crontab.py | 27 --
src/lib/sos/plugins/cs.py | 50 ---
src/lib/sos/plugins/devicemapper.py | 66 ---
src/lib/sos/plugins/dhcp.py | 29 --
src/lib/sos/plugins/dovecot.py | 26 --
src/lib/sos/plugins/ds.py | 50 ---
src/lib/sos/plugins/emc.py | 218 ---------
src/lib/sos/plugins/filesys.py | 60 ---
src/lib/sos/plugins/ftp.py | 30 --
src/lib/sos/plugins/gdm.py | 22 -
src/lib/sos/plugins/general.py | 59 ---
src/lib/sos/plugins/hardware.py | 52 ---
src/lib/sos/plugins/hts.py | 23 -
src/lib/sos/plugins/i18n.py | 26 --
src/lib/sos/plugins/initrd.py | 28 --
src/lib/sos/plugins/ipa.py | 37 --
src/lib/sos/plugins/ipsec.py | 30 --
src/lib/sos/plugins/iscsi.py | 24 -
src/lib/sos/plugins/kdump.py | 31 --
src/lib/sos/plugins/kernel.py | 116 -----
src/lib/sos/plugins/kvm.py | 48 --
src/lib/sos/plugins/ldap.py | 50 ---
src/lib/sos/plugins/libraries.py | 26 --
src/lib/sos/plugins/logrotate.py | 27 --
src/lib/sos/plugins/lsbrelease.py | 30 --
src/lib/sos/plugins/memory.py | 30 --
src/lib/sos/plugins/mrggrid.py | 23 -
src/lib/sos/plugins/mrgmessg.py | 24 -
src/lib/sos/plugins/mysql.py | 32 --
src/lib/sos/plugins/named.py | 44 --
src/lib/sos/plugins/netdump.py | 28 --
src/lib/sos/plugins/networking.py | 78 ----
src/lib/sos/plugins/nfsserver.py | 44 --
src/lib/sos/plugins/nscd.py | 43 --
src/lib/sos/plugins/ntp.py | 23 -
src/lib/sos/plugins/oddjob.py | 31 --
src/lib/sos/plugins/openais.py | 39 --
src/lib/sos/plugins/openssl.py | 29 --
src/lib/sos/plugins/openswan.py | 32 --
src/lib/sos/plugins/pam.py | 25 --
src/lib/sos/plugins/postfix.py | 32 --
src/lib/sos/plugins/ppp.py | 32 --
src/lib/sos/plugins/printing.py | 30 --
src/lib/sos/plugins/process.py | 63 ---
src/lib/sos/plugins/psacct.py | 22 -
src/lib/sos/plugins/pxe.py | 34 --
src/lib/sos/plugins/quagga.py | 30 --
src/lib/sos/plugins/radius.py | 36 --
src/lib/sos/plugins/rhn.py | 89 ----
src/lib/sos/plugins/rpm.py | 33 --
src/lib/sos/plugins/s390.py | 74 ---
src/lib/sos/plugins/samba.py | 29 --
src/lib/sos/plugins/sanitize.py | 41 --
src/lib/sos/plugins/sar.py | 37 --
src/lib/sos/plugins/selinux.py | 51 ---
src/lib/sos/plugins/sendmail.py | 32 --
src/lib/sos/plugins/smartcard.py | 36 --
src/lib/sos/plugins/snmp.py | 31 --
src/lib/sos/plugins/soundcard.py | 30 --
src/lib/sos/plugins/squid.py | 29 --
src/lib/sos/plugins/ssh.py | 26 --
src/lib/sos/plugins/startup.py | 27 --
src/lib/sos/plugins/system.py | 33 --
src/lib/sos/plugins/systemtap.py | 35 --
src/lib/sos/plugins/tftpserver.py | 31 --
src/lib/sos/plugins/tomcat.py | 28 --
src/lib/sos/plugins/udev.py | 23 -
src/lib/sos/plugins/veritas.py | 221 ---------
src/lib/sos/plugins/vmware.py | 30 --
src/lib/sos/plugins/x11.py | 41 --
src/lib/sos/plugins/xen.py | 99 -----
src/lib/sos/plugins/xinetd.py | 32 --
src/lib/sos/plugins/yum.py | 60 ---
src/lib/sos/plugintools.py | 587 ------------------------
src/lib/sos/policyredhat.py | 377 ----------------
src/lib/sos/progressbar.py | 368 ---------------
src/po/af.po | 176 --------
src/po/am.po | 176 --------
src/po/ar.po | 191 --------
src/po/as.po | 195 --------
src/po/ast.po | 192 --------
src/po/be.po | 176 --------
src/po/bg.po | 176 --------
src/po/bn.po | 176 --------
src/po/bn_IN.po | 192 --------
src/po/bs.po | 176 --------
src/po/ca.po | 201 ---------
src/po/cs.po | 177 --------
src/po/cy.po | 176 --------
src/po/da.po | 191 --------
src/po/de.po | 194 --------
src/po/de_CH.po | 193 --------
src/po/el.po | 177 --------
src/po/en.po | 99 -----
src/po/en_GB.po | 190 --------
src/po/es.po | 192 --------
src/po/et.po | 177 --------
src/po/eu_ES.po | 176 --------
src/po/fa.po | 176 --------
src/po/fi.po | 186 --------
src/po/fr.po | 192 --------
src/po/gl.po | 176 --------
src/po/gu.po | 192 --------
src/po/he.po | 177 --------
src/po/hi.po | 192 --------
src/po/hr.po | 178 --------
src/po/hu.po | 191 --------
src/po/hy.po | 176 --------
src/po/id.po | 179 --------
src/po/ilo.po | 176 --------
src/po/is.po | 176 --------
src/po/it.po | 189 --------
src/po/ja.po | 191 --------
src/po/ka.po | 176 --------
src/po/kn.po | 192 --------
src/po/ko.po | 191 --------
src/po/ku.po | 176 --------
src/po/lo.po | 176 --------
src/po/lt.po | 178 --------
src/po/lv.po | 178 --------
src/po/mk.po | 176 --------
src/po/ml.po | 191 --------
src/po/mr.po | 192 --------
src/po/ms.po | 176 --------
src/po/my.po | 176 --------
src/po/nb.po | 177 --------
src/po/nl.po | 190 --------
src/po/nn.po | 177 --------
src/po/nso.po | 176 --------
src/po/or.po | 195 --------
src/po/pa.po | 191 --------
src/po/pl.po | 190 --------
src/po/pt.po | 191 --------
src/po/pt_BR.po | 188 --------
src/po/ro.po | 176 --------
src/po/ru.po | 193 --------
src/po/si.po | 192 --------
src/po/sk.po | 190 --------
src/po/sl.po | 178 --------
src/po/sos.pot | 178 --------
src/po/sq.po | 176 --------
src/po/sr.po | 191 --------
src/po/sr@latin.po | 191 --------
src/po/sv.po | 193 --------
src/po/ta.po | 190 --------
src/po/te.po | 191 --------
src/po/th.po | 189 --------
src/po/tr.po | 177 --------
src/po/uk.po | 195 --------
src/po/ur.po | 176 --------
src/po/vi.po | 177 --------
src/po/zh_CN.po | 192 --------
src/po/zh_TW.po | 190 --------
src/po/zu.po | 176 --------
src/pylintrc | 354 ---------------
src/setup.py | 37 --
src/sos.conf | 16 -
src/sos.spec | 339 --------------
src/sosreport | 815 ----------------------------------
src/sosreport.1 | 67 ---
src/tests/commons.py | 28 --
src/tests/testBasic.py | 39 --
src/tests/test_plugin_syntax.py | 32 --
src/tools/msgfmt.py | 203 ---------
src/tools/pygettext.py | 762 -------------------------------
195 files changed, 24605 deletions(-)
delete mode 100644 src/ChangeLog
delete mode 100644 src/LICENSE
delete mode 100644 src/MANIFEST.in
delete mode 100644 src/Makefile
delete mode 100644 src/README
delete mode 100644 src/README.rh-upload
delete mode 100644 src/TODO
delete mode 100755 src/example_plugins/example.py
delete mode 100644 src/example_plugins/fsusage.py
delete mode 100644 src/example_plugins/release.py
delete mode 100755 src/example_plugins/runcommand.py
delete mode 100755 src/extras/rh-upload
delete mode 100755 src/extras/sos-open
delete mode 100755 src/extras/sysreport/functions
delete mode 100755 src/extras/sysreport/sysreport-fdisk
delete mode 100755 src/extras/sysreport/sysreport.legacy
delete mode 100644 src/extras/sysreport/text.xsl
delete mode 100644 src/gpgkeys/gpg.template
delete mode 100644 src/lib/sos/__init__.py
delete mode 100755 src/lib/sos/helpers.py
delete mode 100644 src/lib/sos/plugins/__init__.py
delete mode 100644 src/lib/sos/plugins/acpid.py
delete mode 100644 src/lib/sos/plugins/amd.py
delete mode 100644 src/lib/sos/plugins/anaconda.py
delete mode 100644 src/lib/sos/plugins/apache.py
delete mode 100644 src/lib/sos/plugins/auditd.py
delete mode 100644 src/lib/sos/plugins/autofs.py
delete mode 100644 src/lib/sos/plugins/bootloader.py
delete mode 100644 src/lib/sos/plugins/cluster.py
delete mode 100644 src/lib/sos/plugins/cobbler.py
delete mode 100644 src/lib/sos/plugins/crontab.py
delete mode 100644 src/lib/sos/plugins/cs.py
delete mode 100644 src/lib/sos/plugins/devicemapper.py
delete mode 100644 src/lib/sos/plugins/dhcp.py
delete mode 100644 src/lib/sos/plugins/dovecot.py
delete mode 100644 src/lib/sos/plugins/ds.py
delete mode 100644 src/lib/sos/plugins/emc.py
delete mode 100644 src/lib/sos/plugins/filesys.py
delete mode 100644 src/lib/sos/plugins/ftp.py
delete mode 100644 src/lib/sos/plugins/gdm.py
delete mode 100644 src/lib/sos/plugins/general.py
delete mode 100644 src/lib/sos/plugins/hardware.py
delete mode 100644 src/lib/sos/plugins/hts.py
delete mode 100644 src/lib/sos/plugins/i18n.py
delete mode 100644 src/lib/sos/plugins/initrd.py
delete mode 100644 src/lib/sos/plugins/ipa.py
delete mode 100644 src/lib/sos/plugins/ipsec.py
delete mode 100644 src/lib/sos/plugins/iscsi.py
delete mode 100644 src/lib/sos/plugins/kdump.py
delete mode 100644 src/lib/sos/plugins/kernel.py
delete mode 100644 src/lib/sos/plugins/kvm.py
delete mode 100644 src/lib/sos/plugins/ldap.py
delete mode 100644 src/lib/sos/plugins/libraries.py
delete mode 100644 src/lib/sos/plugins/logrotate.py
delete mode 100644 src/lib/sos/plugins/lsbrelease.py
delete mode 100644 src/lib/sos/plugins/memory.py
delete mode 100644 src/lib/sos/plugins/mrggrid.py
delete mode 100644 src/lib/sos/plugins/mrgmessg.py
delete mode 100644 src/lib/sos/plugins/mysql.py
delete mode 100644 src/lib/sos/plugins/named.py
delete mode 100644 src/lib/sos/plugins/netdump.py
delete mode 100644 src/lib/sos/plugins/networking.py
delete mode 100644 src/lib/sos/plugins/nfsserver.py
delete mode 100644 src/lib/sos/plugins/nscd.py
delete mode 100644 src/lib/sos/plugins/ntp.py
delete mode 100644 src/lib/sos/plugins/oddjob.py
delete mode 100644 src/lib/sos/plugins/openais.py
delete mode 100644 src/lib/sos/plugins/openssl.py
delete mode 100644 src/lib/sos/plugins/openswan.py
delete mode 100644 src/lib/sos/plugins/pam.py
delete mode 100644 src/lib/sos/plugins/postfix.py
delete mode 100644 src/lib/sos/plugins/ppp.py
delete mode 100644 src/lib/sos/plugins/printing.py
delete mode 100644 src/lib/sos/plugins/process.py
delete mode 100644 src/lib/sos/plugins/psacct.py
delete mode 100644 src/lib/sos/plugins/pxe.py
delete mode 100644 src/lib/sos/plugins/quagga.py
delete mode 100644 src/lib/sos/plugins/radius.py
delete mode 100644 src/lib/sos/plugins/rhn.py
delete mode 100644 src/lib/sos/plugins/rpm.py
delete mode 100644 src/lib/sos/plugins/s390.py
delete mode 100644 src/lib/sos/plugins/samba.py
delete mode 100644 src/lib/sos/plugins/sanitize.py
delete mode 100644 src/lib/sos/plugins/sar.py
delete mode 100644 src/lib/sos/plugins/selinux.py
delete mode 100644 src/lib/sos/plugins/sendmail.py
delete mode 100644 src/lib/sos/plugins/smartcard.py
delete mode 100644 src/lib/sos/plugins/snmp.py
delete mode 100644 src/lib/sos/plugins/soundcard.py
delete mode 100644 src/lib/sos/plugins/squid.py
delete mode 100644 src/lib/sos/plugins/ssh.py
delete mode 100644 src/lib/sos/plugins/startup.py
delete mode 100644 src/lib/sos/plugins/system.py
delete mode 100644 src/lib/sos/plugins/systemtap.py
delete mode 100644 src/lib/sos/plugins/tftpserver.py
delete mode 100644 src/lib/sos/plugins/tomcat.py
delete mode 100644 src/lib/sos/plugins/udev.py
delete mode 100644 src/lib/sos/plugins/veritas.py
delete mode 100644 src/lib/sos/plugins/vmware.py
delete mode 100644 src/lib/sos/plugins/x11.py
delete mode 100644 src/lib/sos/plugins/xen.py
delete mode 100644 src/lib/sos/plugins/xinetd.py
delete mode 100644 src/lib/sos/plugins/yum.py
delete mode 100644 src/lib/sos/plugintools.py
delete mode 100755 src/lib/sos/policyredhat.py
delete mode 100644 src/lib/sos/progressbar.py
delete mode 100644 src/po/af.po
delete mode 100644 src/po/am.po
delete mode 100644 src/po/ar.po
delete mode 100644 src/po/as.po
delete mode 100644 src/po/ast.po
delete mode 100644 src/po/be.po
delete mode 100644 src/po/bg.po
delete mode 100644 src/po/bn.po
delete mode 100644 src/po/bn_IN.po
delete mode 100644 src/po/bs.po
delete mode 100644 src/po/ca.po
delete mode 100644 src/po/cs.po
delete mode 100644 src/po/cy.po
delete mode 100644 src/po/da.po
delete mode 100644 src/po/de.po
delete mode 100644 src/po/de_CH.po
delete mode 100644 src/po/el.po
delete mode 100644 src/po/en.po
delete mode 100644 src/po/en_GB.po
delete mode 100644 src/po/es.po
delete mode 100644 src/po/et.po
delete mode 100644 src/po/eu_ES.po
delete mode 100644 src/po/fa.po
delete mode 100644 src/po/fi.po
delete mode 100644 src/po/fr.po
delete mode 100644 src/po/gl.po
delete mode 100644 src/po/gu.po
delete mode 100644 src/po/he.po
delete mode 100644 src/po/hi.po
delete mode 100644 src/po/hr.po
delete mode 100644 src/po/hu.po
delete mode 100644 src/po/hy.po
delete mode 100644 src/po/id.po
delete mode 100644 src/po/ilo.po
delete mode 100644 src/po/is.po
delete mode 100644 src/po/it.po
delete mode 100644 src/po/ja.po
delete mode 100644 src/po/ka.po
delete mode 100644 src/po/kn.po
delete mode 100644 src/po/ko.po
delete mode 100644 src/po/ku.po
delete mode 100644 src/po/lo.po
delete mode 100644 src/po/lt.po
delete mode 100644 src/po/lv.po
delete mode 100644 src/po/mk.po
delete mode 100644 src/po/ml.po
delete mode 100644 src/po/mr.po
delete mode 100644 src/po/ms.po
delete mode 100644 src/po/my.po
delete mode 100644 src/po/nb.po
delete mode 100644 src/po/nl.po
delete mode 100644 src/po/nn.po
delete mode 100644 src/po/nso.po
delete mode 100644 src/po/or.po
delete mode 100644 src/po/pa.po
delete mode 100644 src/po/pl.po
delete mode 100644 src/po/pt.po
delete mode 100644 src/po/pt_BR.po
delete mode 100644 src/po/ro.po
delete mode 100644 src/po/ru.po
delete mode 100644 src/po/si.po
delete mode 100644 src/po/sk.po
delete mode 100644 src/po/sl.po
delete mode 100644 src/po/sos.pot
delete mode 100644 src/po/sq.po
delete mode 100644 src/po/sr.po
delete mode 100644 src/po/sr@latin.po
delete mode 100644 src/po/sv.po
delete mode 100644 src/po/ta.po
delete mode 100644 src/po/te.po
delete mode 100644 src/po/th.po
delete mode 100644 src/po/tr.po
delete mode 100644 src/po/uk.po
delete mode 100644 src/po/ur.po
delete mode 100644 src/po/vi.po
delete mode 100644 src/po/zh_CN.po
delete mode 100644 src/po/zh_TW.po
delete mode 100644 src/po/zu.po
delete mode 100644 src/pylintrc
delete mode 100644 src/setup.py
delete mode 100644 src/sos.conf
delete mode 100644 src/sos.spec
delete mode 100755 src/sosreport
delete mode 100644 src/sosreport.1
delete mode 100644 src/tests/commons.py
delete mode 100644 src/tests/testBasic.py
delete mode 100644 src/tests/test_plugin_syntax.py
delete mode 100644 src/tools/msgfmt.py
delete mode 100644 src/tools/pygettext.py
diff --git a/src/ChangeLog b/src/ChangeLog
deleted file mode 100644
index 92947fd9..00000000
--- a/src/ChangeLog
+++ /dev/null
@@ -1,248 +0,0 @@
-2007-06-15 Navid Sheikhol-Eslami
-
- * [BZ#241282] initial port to RHEL4 :) sos core now runs happily, plugins will probably need to be fixed as well.
- * Initial commit of XML reporting to gather details about commands executed and files gathered.
- * Exceptions in plugin.analyse() were not catched allowing a bad plugin to break sosreport.
-
-2007-06-15 Eugene Teo
-
- * lib/sos/plugins/apache.py, lib/sos/plugins/nfsserver.py, lib/sos/plugins/selinux.py, lib/sos/plugins/xinetd.py, lib/sos/plugins/ssh.py, lib/sos/plugins/sendmail.py, lib/sos/plugins/samba.py, lib/sos/plugins/named.py, lib/sos/plugins/cluster.py:
- - Edited apache.py to gather /var/log/httpd/* log files
- - Added nfsserver.py to gather NFS server-related debugging information
- - Edited selinux.py to gather /etc/selinux/* configuration files
- - Added xinetd.py to gather xinetd-related information
- - Added ssh.py to gather ssh-related information
- - Added sendmail.py to gather sendmail information
- - Edited samba.py to gather /var/log/samba/* log files
- - Edited named.py to gather /etc/sysconfig/named
- - Edited cluster.py to gather the output of fdisk -l to show the
- shared storage devices that should be available to each system
-
-2007-05-28 Eugene Teo
-
- * lib/sos/plugins/systemtap.py:
- - Added systemtap.py to gather SystemTap pre-requisites information
-
-2007-05-28 Eugene Teo
-
- * lib/sos/plugins/amd.py:
- - Added amd.py to gather Amd automounter information
-
-2007-05-25 Eugene Teo
-
- * lib/sos/plugins/xen.py, lib/sos/plugins/pam.py, lib/sos/plugins/memory.py:
- - Edited xen.py to determine if CPU has PAE/Intel VT/AMD-V support
- - Edited pam.py to gather configurations in /etc/security, and files
- listing of /lib/security/pam_*so
- - Edited memory.py to gather /proc/{vmstat,slabinfo}, and free -m
- output
-
-2007-04-23 Navid Sheikhol-Eslami
-
- * Running "multipath" without arguments might change the device-mapper maps, which we want to avoid if things are broken.
-
-2007-04-02 Navid Sheikhol-Eslami
-
- * Replaced xen plugin with (better) version from Chris Lalancette
-
-2007-03-29 Navid Sheikhol-Eslami
-
- * Added a checkenabled() function which can be used to disable a plugin at run-time.
- * Disable the progress-bar if verbosity is enabled.
-
-2007-03-27 Navid Sheikhol-Eslami
-
- * Fixed hardware plugin to use modules.pcimap instead of deprecated pcitable.
- * Added a random suffix to sosreport tree to avoid overwriting an existing tree with same name.
- * Better logging using python's logging module.
- * Verbose logs included in sosreport (sos_logs/sos.log)
-
-2007-03-15 Navid Sheikhol-Eslami
-
- * Implemented a progress bar (RFE BZ#219672) which can be disabled from the command line.
- * Added check to see if the loaded module matches the copy on the file-system
-
-2007-03-14 Navid Sheikhol-Eslami
-
- * fixed BZ#219877 (ncurses "Cancel" button makes sosreport exit)
-
-2007-03-07 Navid Sheikhol-Eslami
-
- * Allow passing multiple comma-separated plugin names to -n (--noplugin) and -o (--onlyplugin) options.
- * Added further commands' output to gather from lvm_dump
-
-
-2007-02-20 Navid Sheikhol-Eslami
-
- * Added a specialized plugin for device-mapper related configuration files and command outputs (device-mapper, LVM and multipath)
- * Added --onlyplugin option (-o) to selectively choose which plugins to load (complementary to existing --noplugin)
- * Exit if no valid plugin was selected (rather than building an empty sosreport).
-
-2007-02-16 Navid Sheikhol-Eslami
-
- * Strip out the shared secret (bindpw) from /etc/ldap.conf
- * Collect parsed configuration tree directly from ccsd (useful for troubleshooting parsing issues)
- * Scamble password information for fencing devices.
-
-2007-01-26 Navid Sheikhol-Eslami
-
- * Added doRegexSub() to be called in postproc() to apply a regexp substitution to files
- * Added radius plugin for freeradius data collection
- * Ask full name to prevent errors when moving the sos tree before packaging
- * Reformat tar file name is no ticket number is given
-
-2006-06-19 Steve Conklin
-
- * ChangeLog, LICENSE, setup.py, sos.spec:
- Added License file and bumped release
-
-2006-06-08 dlehman
-
- * example_plugins/example.py, example_plugins/fsusage.py, example_plugins/release.py, example_plugins/template.py, lib/sos/helpers.py, lib/sos/plugins/apache.py, lib/sos/plugins/bootloader.py, lib/sos/plugins/cluster.py, lib/sos/plugins/filesys.py, lib/sos/plugins/ftp.py, lib/sos/plugins/general.py, lib/sos/plugins/hardware.py, lib/sos/plugins/kernel.py, lib/sos/plugins/ldap.py, lib/sos/plugins/libraries.py, lib/sos/plugins/mail.py, lib/sos/plugins/memory.py, lib/sos/plugins/named.py, lib/sos/plugins/networking.py, lib/sos/plugins/pam.py, lib/sos/plugins/process.py, lib/sos/plugins/rhn.py, lib/sos/plugins/rpm.py, lib/sos/plugins/samba.py, lib/sos/plugins/selinux.py, lib/sos/plugins/squid.py, lib/sos/plugins/startup.py, lib/sos/plugins/system.py, lib/sos/plugins/tarball.py, lib/sos/plugins/x11.py, lib/sos/plugintools.py, lib/sos/policyredhat.py, setup.py, sosreport:
- - Flesh out rhn plugin to handle Proxy or Satellite
- - Add package queries to policyredhat.py (allPkgsByName, pkgByName, pkgNVRA)
- - Add policy instance to the commons dict for access from plugins
- - Use string objects' methods instead of the string module where possible
- - Remove imports of unused string module
- - Cleanup some typos, redundant initializations, &c
-
-2006-06-08 dlehman
-
- * example_plugins/example.py, example_plugins/fsusage.py, example_plugins/release.py, example_plugins/template.py, lib/sos/helpers.py, lib/sos/plugins/apache.py, lib/sos/plugins/bootloader.py, lib/sos/plugins/cluster.py, lib/sos/plugins/filesys.py, lib/sos/plugins/ftp.py, lib/sos/plugins/general.py, lib/sos/plugins/hardware.py, lib/sos/plugins/kernel.py, lib/sos/plugins/ldap.py, lib/sos/plugins/libraries.py, lib/sos/plugins/mail.py, lib/sos/plugins/memory.py, lib/sos/plugins/named.py, lib/sos/plugins/networking.py, lib/sos/plugins/pam.py, lib/sos/plugins/process.py, lib/sos/plugins/rhn.py, lib/sos/plugins/rpm.py, lib/sos/plugins/samba.py, lib/sos/plugins/selinux.py, lib/sos/plugins/squid.py, lib/sos/plugins/startup.py, lib/sos/plugins/system.py, lib/sos/plugins/tarball.py, lib/sos/plugins/x11.py, lib/sos/plugintools.py, lib/sos/policyredhat.py, setup.py, sosreport:
- - Flesh out rhn plugin to handle Proxy or Satellite
- - Add package queries to policyredhat.py (allPkgsByName, pkgByName, pkgNVRA)
- - Add policy instance to the commons dict for access from plugins
- - Use string objects' methods instead of the string module where possible
- - Remove imports of unused string module
- - Cleanup some typos, redundant initializations, &c
-
-2006-06-05 jwhiter
-
- * lib/sos/plugins/system.py:
- adding the abilit to capture the autofs maps to system.py
-
-2006-05-31 Steve Conklin
-
- * ChangeLog, Makefile: New Makefile and ChangeLog (autogenerated)
-
- * Changelog, setup.py, sos.spec:
- Removed old Changelog file and sync'd version and Changelog in spec file
-
- * lib/sos/plugins/networking.py, TODO, setup.py, sos.spec:
- Final patches and version change before submission to Fedora
-
-2006-05-31 Steve Conklin
-
- * Changelog, setup.py, sos.spec:
- Removed old Changelog file and sync'd version and Changelog in spec file
-
- * lib/sos/plugins/networking.py, TODO, setup.py, sos.spec:
- Final patches and version change before submission to Fedora
-
-2006-05-26 Steve Conklin
-
- * Changelog, lib/sos/helpers.py, lib/sos/plugintools.py, setup.py, sosreport:
- Added pamadio's curses UI for selecting plugin options
- Added flushing stdout after informational messages
-
-2006-05-26 jwhiter
-
- * lib/sos/plugins/filesys.py:
- - making the filesys.py plugin call 'blkid' when running at the request of L1, this will allow us to map labels with actual devices.
-
- * lib/sos/plugins/tarball.py, lib/sos/plugintools.py, sosreport:
- - Adding tarball.py to create a tarball of the report after it is run
- - Updated sosreport to call postproc() in all the plugins, which handles the post run
- - Added runExeInd() which will just run the exe and return the status to plugintools.py
- - Added postproc() to plugintools.py so that plugins can implement it
-
-2006-05-25 Steve Conklin
-
- * lib/sos/plugintools.py, sosreport:
- Fixed file naming for commands to eliminate special chars and prevent
- name collisions. Added sorting of plugins by name before reporting.
-
- * TODO, lib/sos/plugins/kernel.py, lib/sos/plugintools.py, setup.py:
- Fixed option handling
-
-2006-05-23 jwhiter
-
- * Changelog, lib/sos/plugins/kernel.py, setup.py:
- Adding jwb's patch to have sosreport grab sysrq data.
-
-2006-05-22 Steve Conklin
-
- * lib/sos/plugins/apache.py: oops, forgot this file
-
- * lib/sos/plugins/bootloader.py, lib/sos/plugins/filesys.py, lib/sos/plugins/ftp.py, lib/sos/plugins/general.py, lib/sos/plugins/hardware.py, lib/sos/plugins/kernel.py, lib/sos/plugins/ldap.py, lib/sos/plugins/mail.py, lib/sos/plugins/memory.py, lib/sos/plugins/named.py, lib/sos/plugins/samba.py, lib/sos/plugins/squid.py, lib/sos/plugins/x11.py, sos.spec:
- Patch from jwb
-
- * lib/sos/plugins/filesys.py, lib/sos/plugins/kernel.py:
- jwb's patches for kernel.py and filesys.py
-
- * sosreport: minor fix to the dir perms patch
-
- * lib/sos/plugins/bootloader.py, lib/sos/plugins/cluster.py, lib/sos/plugins/filesys.py, lib/sos/plugins/general.py, lib/sos/plugins/hardware.py, lib/sos/plugins/kernel.py, lib/sos/plugins/libraries.py, lib/sos/plugins/memory.py, lib/sos/plugins/networking.py, lib/sos/plugins/pam.py, lib/sos/plugins/process.py, lib/sos/plugins/rhn.py, lib/sos/plugins/rpm.py, lib/sos/plugins/selinux.py, lib/sos/plugins/startup.py, lib/sos/plugins/system.py, lib/sos/plugins/template.py, lib/sos/plugins/x11.py, Changelog, example_plugins/template.py, lib/sos/plugintools.py, setup.py, sosreport:
- Merged all of jwb's weekend patches. Make output dirs world readable, check before
- executing executables, and added a lot of plugins.
-
-2006-05-19 Steve Conklin
-
- * lib/sos/plugins/template.py: Removed unneeded variabled from plugin.
-
- * Changelog, TODO, example_plugins/example.py, example_plugins/fsusage.py, example_plugins/release.py, example_plugins/runcommand.py, lib/sos/plugins/template.py, lib/sos/plugintools.py, setup.py, sosreport:
- Applied jwb's fix, added his examples, improved html output
-
-2006-05-18 Steve Conklin
-
- * example_plugins/example.py, example_plugins/runcommand.py, lib/sos/plugins/template.py:
- Put instance variables in plugins in addition to base class
-
- * example_plugins/example.py, example_plugins/runcommand.py, lib/sos/plugins/template.py, lib/sos/plugintools.py, setup.py, sosreport:
- Removed separate pit class, and put everything having to do with the plugin in
- pluginBase. Still incorrectly aggregates data across all plugins.
-
- * README: Added Jwb as a contributor
-
- * Changelog, TODO, lib/sos/plugins/template.py, lib/sos/plugintools.py, sosreport:
- Implemented a base class for plugins
-
-2006-05-17 Steve Conklin
-
- * Changelog, TODO, lib/sos/helpers.py, lib/sos/plugins/template.py, lib/sos/plugintools.py, sosreport, tests/maketesttree.sh:
- Cleaned up code, added comments, fixed dir copying bug, changed option
- handling. See Changelog
-
-2006-05-16 Steve Conklin
-
- * lib/sos/helpers.py, lib/sos/plugintools.py:
- Missed an edit to change log file descriptor to the dictionary. Fixed.
-
- * TODO: Added documentation to list
-
- * TODO: Added need for example plugin
-
-2006-05-15 Steve Conklin
-
- * README, TODO, lib/sos/plugins/template.py, lib/sos/plugintools.py, setup.py, sosreport:
- Added a dictionary of things that need to be known to all, like paths for
- reports.
-
- Added Pierre Amadio's command line arg handling
-
- Fixed incorrect handling of command completion status
-
- Added html generation
-
-2006-05-09 Steve Conklin
-
- * TODO: changed it
-
- * setup.cfg: removed RFC file
-
- * MANIFEST.in, Notes.txt, README, TODO, lib/sos/__init__.py, lib/sos/helpers.py, lib/sos/plugins/__init__.py, lib/sos/plugins/template.py, lib/sos/plugintools.py, lib/sos/policyredhat.py, setup.cfg, setup.py, sosreport:
- Initial checkin of the sos project
-
- * MANIFEST.in, Notes.txt, README, TODO, lib/sos/__init__.py, lib/sos/helpers.py, lib/sos/plugins/__init__.py, lib/sos/plugins/template.py, lib/sos/plugintools.py, lib/sos/policyredhat.py, setup.cfg, setup.py, sosreport:
- New file.
-
diff --git a/src/LICENSE b/src/LICENSE
deleted file mode 100644
index 7a8e8abf..00000000
--- a/src/LICENSE
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/src/MANIFEST.in b/src/MANIFEST.in
deleted file mode 100644
index a48fa116..00000000
--- a/src/MANIFEST.in
+++ /dev/null
@@ -1,10 +0,0 @@
-recursive-include po *.mo
-recursive-include extras *
-recursive-include tests *
-include sosreport*
-include README*
-include LICENSE
-include TODO
-include ChangeLog
-include gpgkeys/*.pub
-include sos.conf
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index a49d9219..00000000
--- a/src/Makefile
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# Makefile for sos system support tools
-#
-
-NAME = sos
-VERSION = 1.8
-#RELEASE = 6
-REPO = http://svn.fedorahosted.org/svn/sos
-#SVNTAG = r$(subst .,-,$(VERSION))_$(RELEASE)
-SRCDIR = $(PWD)
-# Needs to be changed to reflect
-# your rpm development tree.
-TOPDIR = $(HOME)/redhat/$(NAME)
-TMPDIR = /tmp/$(NAME)-$(VERSION)
-MANPAGE = $(PWD)/sosreport.1
-SOURCE1 = $(PWD)/sos.conf
-SOURCE2 = $(PWD)/sosreport.1.gz
-SOURCE3 = $(PWD)/gpgkeys/rhsupport.pub
-
-all:
-
-.PHONY: tarball install clean rpm
-
-tarball: clean mo gpgkey
- @echo "Build Archive"
- @test -f $(SOURCE2) || gzip -c $(MANPAGE) > $(SOURCE2)
- @mkdir $(TMPDIR)
- @python setup.py sdist -d $(TMPDIR)
- @mkdir $(PWD)/dist
- @cp $(TMPDIR)/* $(PWD)/dist
- @echo " "
- @echo "The final archive is $(PWD)/dist/"
-
-install:gpgkey mo
- python setup.py install
- @rm -rf build/lib
-
-clean:
- @rm -fv *~ .*~ changenew ChangeLog.old $(NAME)-$(VERSION).tar.gz
- @rm -rfv {dist,build}
- @rm -rf MANIFEST
- @rm -rfv $(TMPDIR)
- @rm -rf {$(SOURCE2),$(SOURCE3)}
- @for i in `ls po`; do \
- if [ -d po/$$i ]; then \
- rm -rf po/$$i; \
- fi; \
- done; \
-
-# TODO: This needs work
-internal-rpm: gpgkey
- @test -f sos-internal.spec
- @mkdir -p $(TOPDIR)/SOURCES $(TOPDIR)/SRPMS $(TOPDIR)/RPMS $(TOPDIR)/BUILD $(SRCDIR)/dist
- cp gpgkeys/rhsupport.pub gpgkeys/rhsupport.key $(TOPDIR)/SOURCES
-
-# this builds an RPM from the current working copy
- @cd $(TOPDIR)/BUILD ; \
- rm -rf $(NAME)-$(VERSION) ; \
- ln -s $(SRCDIR) $(NAME)-$(VERSION) ; \
- tar --gzip --exclude=.svn --exclude=svn-commit.tmp --exclude=$(NAME)-$(VERSION)/build --exclude=$(NAME)-$(VERSION)/dist \
- --exclude gpgkeys/rhsupport.pub --exclude gpgkeys/rhsupport.key \
- -chSpf $(TOPDIR)/SOURCES/$(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) ; \
- rm -f $(NAME)-$(VERSION)
-
- rpmbuild -ba --define="_topdir $(TOPDIR)" sos-internal.spec
- @mv $(TOPDIR)/RPMS/noarch/$(NAME)-internal-*.rpm $(TOPDIR)/SRPMS/$(NAME)-internal-*.rpm dist/
- cp gpgkeys/rhsupport.key dist/
-
-rpm: tarball
- @test -d $(TOPDIR) || mkdir -p $(TOPDIR)
- @mv dist/* $(TOPDIR)
- @test -f sos.spec
- rpmbuild -ba sos.spec
-
-pot:
- python tools/pygettext.py -o po/sos.pot sosreport lib/sos/policyredhat.py
-
-mo:
- @echo "Generating mo files"
- @for i in `ls po`; do \
- if [ $$i != 'sos.pot' ]; then \
- mkdir po/$${i%.po}; \
- python tools/msgfmt.py -o po/$${i%.po}/sos.mo po/$$i; \
- fi; \
- done; \
-
-gpgkey:
- @echo "Building gpg key"
- @test -f gpgkeys/rhsupport.pub && echo "GPG key already exists." || \
- gpg --batch --gen-key gpgkeys/gpg.template
diff --git a/src/README b/src/README
deleted file mode 100644
index d46c33fd..00000000
--- a/src/README
+++ /dev/null
@@ -1,35 +0,0 @@
-This set of tools is designed to provide information to support
-organizations in an extensible manner, allowing third parties,
-package maintainers, and anyone else to provide plugins that will
-collect, analyze, and report information that is useful for supporting
-software packages.
-
-This project is hosted at http://fedorahosted.org/sos
-For the latest version, to contribute, and for more information, please visit there.
-
-To access to the public source code repository for this project run:
-
- svn export http://svn.fedorahosted.org/svn/sos/trunk sos --username guest
-
-to install locally (as root) ==> make install
-to build an rpm ==> make rpm
-
-See the Makefile.
-
-Maintainer:
-
- Adam Stokes
-
-Developers and Contributors:
-
- Steve Conklin
- Pierre Amadio
- John Berninger
- Navid Sheikhol-Eslami
-
-Thanks to:
-
- Eva Schaller for providing an Italian translation
- Marco Ceci for helping me out with the cluster plugin
- Leonardo Macchia for being my personal regexp generator
- Imed Chihi for providing Arabic and French translations
diff --git a/src/README.rh-upload b/src/README.rh-upload
deleted file mode 100644
index 6dd36aef..00000000
--- a/src/README.rh-upload
+++ /dev/null
@@ -1,54 +0,0 @@
-
-rh-upload
-
-This is a script provided with the SOS RPM which provides some automation for RHEL kernel vmcore file
-handling. The script is capable of compressing, encrypting, checksumming, splitting and uploading a
-vmcore file by passing a few options and answering two questions.
-
-The script requires that the system (it is run on) has lftp, openssl, and gzip installed otherwise it
-will die.
-
-#### Recommendations ####
-
-Red Hat absolutely recommends that you perform an md5checksum and provide the result file to your
-technician. This only takes a few extra minutes and can save a lot of headaches if the file somehow
-is corrupted during transfer.
-
-It is not recommended to split the core file unless you are on an unreliable or low throughput
-connection. Lftp will automatically resume uploads if there are connection interruptions but in
-some cases splitting the core file into smaller hunks may be desirable.
-
-Because your core could potentially contain data sensitive to your company it is recommended that
-core file encryption is at least considered. While it's not very likely that someone could sniff
-that sensitive information while in transit it is possible. Even with very large core files it takes
-less time to encrypt a compressed core file than it does to actually compress it the core file.
-The 10 or so extra minutes it takes may be worth it.
-
-It's likely that you will be running the script remotely so it is recommended that you launch a
-screen session _before_ kicking off this script. That way if your connection is dropped for some
-reason the script will continue until it's ready to prompt for destination input.
-
-#### Questions ####
-
-A couple of comments regarding choices made in the design of the script.
-
-Why use gzip instead of bzip2?
-While bzip2 /does/ compress tighter than gzip it is significantly slower on large files like
-vmcore files. When compressing a core file speed is more of the essence rather than overall
-compression ratio.
-
-Why not have a switch to provide the ticket number and/or upload destination?
-Good question. While there isn't really a technical reason it seemed more logical to prompt
-for this information at the beginning and end of the script run.
-
-Do I have to use this script to upload kernel vmcore files?
-No you don't have to use it; however, we would prefer you did. It standardizes the core file
-naming convention on the dropbox for one thing. Secondly it allows you to run this script
-and then go work on something else while all of the file operations run; however, if you wish to
-stare blankly at a screen waiting for compression to complete so you can upload that's entirely
-your perogative. ;-)
-
-I have a suggestion for this script who do I give it to?
-Open a ticket with Red Hat support with your request. It will certainly be considered. That said,
-this was written in a shell script with the idea being that anyone could alter it in any way
-they see fit.
diff --git a/src/TODO b/src/TODO
deleted file mode 100644
index fd3c8f38..00000000
--- a/src/TODO
+++ /dev/null
@@ -1,19 +0,0 @@
-To Do List:
-
- * --batch option
-
- * Gather statistics (time, files collected, commands run) per plugin
-
- * Choose sane defaults to satisfy Red Hat support requirements (ie. what
- plugins should be loaded by default, with what options, etc)
-
- * Display on screen what files/commands are being gathered.
-
- * Allow to use a different rootdir than /
-
- * Make it easier to select a policy module and perhaps optionally include
- plugins from the library, to allow per-distribution customization.
-
- * Documentation - plugin howto doc, inline doc in plugin template
-
- * Review and test error handling for things like a full tmp file system
diff --git a/src/example_plugins/example.py b/src/example_plugins/example.py
deleted file mode 100755
index 1e650417..00000000
--- a/src/example_plugins/example.py
+++ /dev/null
@@ -1,94 +0,0 @@
-## example.py
-## An example sos plugin
-
-### 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.
-
-import sos.plugintools
-
-# Class name must be the same as file name and method names must not change
-class example(sos.plugintools.PluginBase):
- """This is an example plugin for sos. Plugins gather, analyze, and report on various aspects
- of system operation that are of interest. plugins are based on the PluginBase class, which
- you should inspect if you wish to override any methods in your plugin. The methods of use
- to plugin developers are:
- collect() - use the functions sosCp and sosRunExe to gether information
- analyze() - perform any special analysis you require beyond just saving the
- information gathered by collect(). Use sosAlert() and sosAddCustomText()
- to add information to the report.
- report() - override this method if you wish to replace the default reporting
-
- All plugins will use collect(), some will use analyze(), few will override report()
- """
-
- # Add your options here, indicate whether they are slow to run, and set whether they are enabled by default
- # Options are python dictionaries that conatin a short name, long description, speed, and whether they are enabled by default
- optionList = [("init.d", 'Gathers the init.d directory', 'slow', 0),
- ('follicles', 'Gathers information about each follicle on every toe', 'slow', 0),
- ('color', 'Gathers toenail polish color', 'fast', 0)]
-
- def setup(self):
- ''' First phase - Collect all the information we need.
- Directories are copied recursively. arbitrary commands may be
- executed using the susRunExe method. Information is automatically saved, and
- links are presented in the report to each file or directory which has been
- copied to the saved tree. Also, links are provided to the output from each command.
- '''
- # Here's how to copy files and directory trees
- self.addCopySpec("/etc/hosts")
- # this one saves a file path to the copy for later analysis
- # FIXME: Need to figure out how to do this
- # self.fooFilePath = self.copyFileOrDir("/proc/cpuinfo")
-
- # Here's how to test your options and execute if enabled
- if self.isOptionEnabled("init.d"):
- self.addCopySpec("/etc/init.d") # copies a whole directory tree
-
- # Here's how to execute a command
- # you can save the path to the copied file for later analysis if desired
- # FIXME: Need to figure out how to do this
- self.psCmdDstFileName = self.runExe("/bin/ps -ef")
- return
-
- def analyze(self):
- ''' This is optional and need not be defined.
- If you wish to perform some analysis on either files
- that were gathered or on the output of commands, then save the filenames on the
- destination file system when gathering that information in the collect() method
- and use them here
- '''
- # This is an example of opening and reading the output of a command that
- # was run in the collect() method. Note that the output of the command is
- # included in the report anyway
- fd = open(self.fooFilePath)
- lines = fd.readlines()
- fd.close()
- for line in lines:
- if line.count("vendor_id"):
- self.addCustomText("Vendor ID string is: %s \n" % line)
- #
- # Alerts can optionally be generated, and will be included in the
- # report automatically
- #
- self.addAlert("This is an alert")
- return
-
-# def report(self):
-# """ Usually, this doesn't even need to be defined, and you can inherit the
-# base class, unless you want to replace what sosGetResults()
-# does with your own custom report generator. If you are going to do that, have a good
-# look at that method to see what it does. Custom text and alerts can still be added
-# here using sosAddCustomText() and sosAddAlert()
-# This method returns html that will be included inline in the report
-# """
diff --git a/src/example_plugins/fsusage.py b/src/example_plugins/fsusage.py
deleted file mode 100644
index 2532c5f7..00000000
--- a/src/example_plugins/fsusage.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-
-### 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.
-
-import sos.plugintools
-
-# Class name must be the same as file name and method names must not change
-class fsusage(sos.plugintools.PluginBase):
- def setup(self):
- self.psCmdDstFileName = self.collectExtOutput("/bin/df -al")
- return
diff --git a/src/example_plugins/release.py b/src/example_plugins/release.py
deleted file mode 100644
index db4d7581..00000000
--- a/src/example_plugins/release.py
+++ /dev/null
@@ -1,21 +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.
-
-import sos.plugintools
-
-# Class name must be the same as file name and method names must not change
-class release(sos.plugintools.PluginBase):
- def setup(self):
- self.addCopySpec("/etc/redhat-release")
- return
diff --git a/src/example_plugins/runcommand.py b/src/example_plugins/runcommand.py
deleted file mode 100755
index df8951d2..00000000
--- a/src/example_plugins/runcommand.py
+++ /dev/null
@@ -1,45 +0,0 @@
-## runcommand.py
-## An example plugin for sos
-
-### 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.
-
-import sos.plugintools
-
-# Class name must be the same as file name and method names must not change
-class runcommand(sos.plugintools.PluginBase):
- """This is a very simple example plugin that just runs one command in a shell. That
- command could be a script supplied with your package which outputs information of interest
- to support. When the script or command is run, stdout is collected and included in the
- report generated by sosreport, and stderr is collected and copied into the sos log.
-
- This is useful for people who have minimal knowledge of python, who wish to write
- collection tools in other languages, or who have existing tools.
-
- If your script or command generates output files that you want included in the sosreport
- collection of files, include sosCp calls to include them.
-
- The only method required for this simple plugin is collect().
-
- Your finished plugin should be included with your package and installed in python's
- site-packages/sos/plugins/ directory
- """
- def setup(self):
- ''' Run a command. Output is automatically included in the report.
- '''
- self.collectExtOutput("/path/to/my/script --myoption --anotheroption")
-
- # if (for example) that command created files /foo/bar/baz.txt and
- # we want to include that in our report, we include the next line:
- #self.pit.sosCp("/foo/bar/baz.txt")
diff --git a/src/extras/rh-upload b/src/extras/rh-upload
deleted file mode 100755
index 75a86f43..00000000
--- a/src/extras/rh-upload
+++ /dev/null
@@ -1,283 +0,0 @@
-#!/bin/bash
-
-#################################################################################
-# #
-# rh-upload #
-# Version - 0.3 #
-# Copyright (c) 2007 Red Hat, Inc. All rights reserved. #
-# #
-# #
-# Written by David Mair #
-# Cleanup and generalized for any kind of file by Olivier Arsac #
-# Idea stolen from Chris Snook :-) #
-# #
-# Purpose - To help in the automatic upload of files. #
-# Specifically, this script will compress, encrypt, md5sum, #
-# and upload the file automatically when invoked. #
-# Items are optional and specified by command line switch. #
-# ###############################################################################
-
-
-## Global directives
-umask 0077
-
-## Declare some variables
-Date=`/bin/date -u +%G%m%d%k%M%S | /usr/bin/tr -d ' '`
-Destination="dropbox.redhat.com"
-
-function usage {
-cat <&2
-}
-
-# echo unless in verbosity is too low
-function echov(){
- local level="$1"
- shift
- if [[ $Verbose -ge "$level" ]]; then echo -e "$@"; fi
-}
-
-# Parse command line options (and perform some checks)
-function parse(){
- if [ $# == 0 ]; then
- usage
- exit 0
- fi
-
- TEMP=`getopt -o heuczqs:f:n --long help,encrypt,quiet,noupload,checksum,compress,split:,file: -n 'rh-upload' -- "$@"`
-
- if [ $? != 0 ]; then
- echo "Options error -- Terminating..." >&2
- usage
- exit 1
- fi
-
- eval set -- "$TEMP"
- Upload=1
- Split=0
- Verbose=1
- Compress=0
- Encrypt=0
- Force=0
- while true; do
- case "$1" in
- -h|--help) usage; exit 0;;
- -e|--encrypt) Encrypt=1; shift;;
- -N|--noupload) Upload=0; shift;;
- -c|--checksum) Checksum=1; shift;;
- -q|--quiet) Verbose=0; shift;;
- -z|--compress) Compress=1; shift;;
- -s|--split)
- case $2 in
- "") echoe "You must specify a hunk size."; exit 1 ;;
- *) Split=$2; shift 2;;
- esac ;;
- -F|--force) Force=1; shift;;
- -f|--file)
- case "$2" in
- "") echoe "You must specify a file name."; exit 1 ;;
- *) File=$2; shift 2;;
- esac ;;
- --) shift; break ;;
- *) echoe "Wrong options or flag specified"; usage; exit 1;;
- esac
- done
-
- # Ensure the -f||--file flag was passed or die
- if [ -z "$File" ]; then
- echoe "The -f or --file flag is required! Terminating."
- usage
- exit 1
- fi
-
- # Validate the file exists or die
- if [ ! -f "$File" ]; then
- echoe "Invalid filename or file not found. Terminating."
- exit 1
- fi
- File_dirname=${File%/*}
- File_basename=${File##*/}
- File_ext=${File_basename##*.}
- Src_file="$File"
- Dst_file="$File_basename"
-}
-
-function ticket(){
- echov 1
- echov 1 "We'll need to use your issue-tracker ticket number for a couple of things."
- echo -n "Please enter ticket number: "
- read Ticket_number
- Dst_file="${Ticket_number}-${Date}-${File_basename}"
-}
-
-# Compress the file
-function compress(){
- if [ "$Compress" != 0 ]; then
- echov 1 "Starting file compression. This may take some time."
- # Begin compression of file
- if [ ! -x /usr/bin/gzip ]; then
- echoe "Cannot find gzip in /usr/bin/. Terminating."
- exit 1
- else
- /usr/bin/gzip --fast "$Src_file"
- fi
- Src_file="${Src_file}.gz"
- Dst_file="${Dst_file}.gz"
- fi
-}
-
-# Encrypt the file
-function encrypt(){
- if [ "$Encrypt" != 0 ]; then
- echov 1 "Encrypting file. This should only take a few minutes."
- if [ ! -x /usr/bin/openssl ]; then
- echoe "Cannot find openssl in /usr/bin. Terminating."
- exit 1
- fi
- # Use the ticket number as the ssl keyfile name
- Key_file="${Ticket_number}-${Date}.key"
- /usr/bin/openssl rand -out "$Key_file" -base64 48
- echov 1 "You have chosen to encrypt your file. Your passkey file is: $Key_file"
- echov 1 "Please attach this key to your ticket."
- /usr/bin/openssl aes-128-cbc -in $Src_file -out $Src_file.aes -pass file:"$Key_file"
- Src_file="$Src_file.aes"
- Dst_file="$Dst_file.aes"
- fi
-}
-
-function checksum(){
- if [ "$Checksum" != 0 ]; then
- echov 1 "Cheksuming $Src_file... (This should only take a few minutes)"
- if [ ! -x /usr/bin/md5sum ]; then
- echoe "Cannot find md5sum in /usr/bin. Terminating."
- exit 1
- fi
- MD5_file="${Ticket_number}-${Date}-checksum.out"
- MD5_result=`/usr/bin/md5sum "$Src_file" | awk '{print $1}'`
- echo "$MD5_result" > "$MD5_file"
- echov 1 "The MD5 checksum is $MD5_result (in $MD5_file)."
- fi
-}
-
-function split(){
- if [ "$Split" -eq 0 ]; then
- return
- fi
- local hunk_size="$Split"
- if [[ "$hunk_size" -gt 0 ]] && [[ "$hunk_size" -lt 1001 ]]; then
- if [ ! -x /usr/bin/split ]; then
- echoe "Cannot find split in /usr/bin. Terminating."
- exit 1
- fi
- Split_dir="${Ticket_number}-${Date}"
- # We need to make a directory to keep things sane
- echov 1 "Creating directory $Split_dir to house file hunks..."
- /bin/mkdir "$Split_dir"
- echov 1 "Splitting $Src_file..."
- /usr/bin/split -b "$hunk_size"m -d "$Src_file" "${Split_dir}/${Dst_file}"
- else
- echoe "Invalid hunk size argument. Please enter a number greater than 0 and less than 1001. Terminating."
- exit 1
- fi
-}
-
-function upload(){
- if [ "$Upload" -eq 0 ]; then
- echov 1 "All file operations are complete. The file(s) is ready to upload at your convenience."
- return
- fi
- echov 1 "The file(s) will now be uploaded."
- echo -n "Please enter the destination host (default is $Destination): "
- local destination_input
- read destination_input
- if [ "$destination_input" != "" ]; then
- Destination=$destination_input
- fi
- echov 1
- echov 1 "Uploading to $Destination... (This could take quite a while)."
- if [ ! -x /usr/bin/lftp ]; then
- # No lftp installed
- echov 1 "lftp could not be found in /usr/bin. The file(s) will need to be uploaded manually."
- Ftp_res=255
- else
- # Make the lftp script first
- local script="/tmp/rh-upload-lftp.$$"
- echo "lftp $Destination < $script
- echo "cd incoming" >> $script
- if [ "$Split" != 0 ]; then
- echo "lcd $Split_dir" >> $script
- echo "mirror -R" >> $script
- else
- echo "put $Src_file -o $Dst_file" >> $script
- fi
- echo "exit" >> $script
- echo "EOF" >> $script
- /usr/bin/lftp -f $script
- Ftp_res=$?
- fi
-}
-
-function closure(){
- if [ "$Encrypt" != 0 ]; then
- echov 1 "## File was encrypted with key $Key_file."
- echov 1 "Please upload this key file to Issue Tracker or send it to your support representative for decryption after upload."
- fi
-
- if [ "$Checksum" != 0 ]; then
- echov 1 "## A checksum was performed on your file."
- echov 1 "The MD5 checksum is $MD5_result (in $MD5_file)."
- echov 1 "Please include this when updating your ticket so your support representative can verify the copy uploaded."
- fi
-
- if [ "$Split" != 0 ]; then
- echov 1 "## Your file was split and the hunks are in: $Split_dir/ "
- fi
-
- if [ -n "$Ftp_res" ] && [ "$Ftp_res" -eq 0 ]; then
- echov 1 "This script has completed successfully the upload."
- if [ "$Compress" != 0 ] || [ "$Split" != 0 ]; then
- echov 1 "You performed file encryption and/or file splitting."
- echov 1 "You may consider removing those temporary files."
- fi
- else
- echoe "Sorry unable to upload the files to $Destination. You may want to retry or do it manually."
- fi
-
- if [ "$Compress" != 0 ]; then
- echov 1 "It is NOT recommended to remove the gzipped copy of the file."
- echov 1 "This is the only remaining copy of the file on your system."
- echov 1 "It is recommended to retain the file until your support representative indicates that the problem has been identified and/or resolved."
- fi
-}
-
-function main(){
- # Run through the functions
- parse $@
- ticket
- compress
- encrypt
- checksum
- split
- upload
- closure
-}
-
-main $@
diff --git a/src/extras/sos-open b/src/extras/sos-open
deleted file mode 100755
index ffc9f051..00000000
--- a/src/extras/sos-open
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/python
-
-import os, commands, getopt, sys, tarfile
-
-# FILES NEEDED BY CHECKSYSREPORT: /etc/redhat-release /etc/sysconfig/rhn/up2date rpm-Va installed-rpms uname lsmod
-
-CONFIG = {}
-report_dirs = []
-
-CONFIG["outdir"] = "/tmp/sysreports"
-CONFIG["extract_reports"] = []
-CONFIG["spawn_terminal"] = False
-if not sys.stdin.isatty(): CONFIG["spawn_terminal"] = True
-else: CONFIG["spawn_terminal"] = False
-
-def cat(fname):
- try:
- fp = open(fname,"r")
- print fp.read()
- fp.close()
- except: pass
-
-try:
- opts, args = getopt.getopt(sys.argv[1:], "hi:w:vxf", ["help", "input="])
-except getopt.GetoptError:
- # print help information and exit:
- usage()
- sys.exit(2)
-
-for o, a in opts:
- if o == "-v":
- verbose = True
- if o == "-f":
- CONFIG["spawn_terminal"] = False
- if o == "-x":
- CONFIG["spawn_terminal"] = True
- sys.argv[sys.argv.index("-x")] = "-f"
- if o in ("-h", "--help"):
- usage()
- sys.exit()
- if o in ("-d"):
- CONFIG["outdir"] = a
- if o in ("-w"):
- a = os.path.abspath(a)
- try: os.stat(a)
- except: print "ERROR: could not open", a
- else: report_dirs.append(a)
-
- if o in ("-i"):
- a = os.path.abspath(a)
- try: os.stat(a)
- except: print "ERROR: could not open", a
-
-if CONFIG["spawn_terminal"]:
- print "spawning new terminal"
- sys.argv[0] = os.path.abspath(sys.argv[0])
- os.system("gnome-terminal -e '%s'" % (' '.join(sys.argv)))
- sys.exit()
-
-CONFIG["extract_reports"] = [os.path.abspath(a) for a in args]
-
-if not os.path.isdir(CONFIG["outdir"]):
- if not os.path.exists(CONFIG["outdir"]):
- exit("ERROR: working directory path exists but it's not a directory")
- else:
- try: os.mkdir(CONFIG["outdir"])
- except: exit("ERROR: could not create working directory")
-
-try: os.chdir(CONFIG["outdir"])
-except: exit("ERROR: could not chdir into working directory, please check permissions")
-
-for report in CONFIG["extract_reports"]:
- report_ext = report.rsplit(".",1)[-1]
-
- if report_ext == "gpg":
- clear_fname = os.path.join(CONFIG["outdir"],os.path.basename(report.rsplit(".",1)[0]))
- status, output = commands.getstatusoutput("gpg --output %s %s" % (clear_fname,report))
- if status:
- sys.exit("ERROR: could not decrypt using gpg" + output )
- report = clear_fname
- report_ext = clear_fname.rsplit(".",1)[-1]
- del clear_fname
-
- outdir = None
- tar = tarfile.open(report, "r")
- for tarinfo in tar:
- if tarinfo.isdir(): outdir = tarinfo.name ; break
- tar.close()
-
- if not outdir:
- print("INFO: archive doesn't appear to be either a sysreport or sosreport")
- cddir = os.path.basename(report)
- for sout in [ ".tar.gz", ".tgz", ".tar.bz2" ]:
- if cddir.endswith(sout): cddir = cddir[:-len(sout)]
- cddir = os.path.abspath(os.path.join(CONFIG["outdir"],"extract_" + cddir))
- outdir = cddir
- else:
- cddir = CONFIG["outdir"]
- outdir = os.path.abspath(os.path.join(CONFIG["outdir"], outdir))
-
- extract = True
- if os.path.isdir(outdir):
- extract = False
- yorno = False
- print "This report already seems to have been extracted in:"
- print " " + outdir
- print
- while yorno not in ['y','n']: yorno = raw_input("Do you want to replace it with a fresh copy ? (y/n) ").lower()
- if yorno == 'y':
- print "Deleting previous copy..."
- os.system("chmod -R u+rw %s" % outdir)
- os.system("rm -rf %s" % outdir)
- extract = True
-
- if extract:
- print "Extracting..."
- if not os.path.isdir(cddir):
- os.mkdir(cddir)
- if report_ext == "bz2":
- status, output = commands.getstatusoutput("tar xCfj %s %s" % (cddir,report))
- elif report_ext == "gz" or report_ext == "tgz" :
- status, output = commands.getstatusoutput("tar xCfz %s %s" % (cddir,report))
-
- if status:
- print("ERROR: there was some problem extracting the report (%s)" % report)
-
- report_dirs.append(os.path.abspath(outdir))
-
-if len(report_dirs) == 1 and os.path.isdir(report_dirs[0]):
- os.chdir(report_dirs[0])
-
- if os.path.isfile("sos_reports/diagnose.txt"):
- print
- print "Diagnostics messages available:"
- print
- fp = open("sos_reports/diagnose.txt","r")
- for line in fp.readlines():
- print " " + line.strip("\n")
- fp.close()
- print
-
- report_dirs[0]
-
- print
- print "The extracted report is located in: "
- print " " + report_dirs[0]
- print "Once finished, press exit to return."
- print
- cat("uname")
- os.system("PS1='[SoS \W]\$ ' HOME='%s' /bin/bash -l" % (report_dirs[0]) )
- sys.exit(-1)
diff --git a/src/extras/sysreport/functions b/src/extras/sysreport/functions
deleted file mode 100755
index fff52ccd..00000000
--- a/src/extras/sysreport/functions
+++ /dev/null
@@ -1,132 +0,0 @@
-#! /bin/sh
-export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
-export LANG=C
-export LC_ALL=C
-export LC_CTYPE=C
-
-log="sysreport.log"
-
-fixupfile() {
- if [ -f $2 ] ; then
- /bin/sed -e$1 $2 > $2.newfile
- /bin/mv $2.newfile $2
- fi
- return 0
-}
-
-getpartinfo() {
- # Get fdisk -l output from all disks/partitionable raid devices from /proc/partitions
- raiddevs=`/bin/cat /proc/partitions | /bin/egrep -v "^major|^$" | /bin/awk '{print $4}' | /bin/grep \/ | /bin/egrep -v "p[0123456789]$"`
- disks=`/bin/cat /proc/partitions | /bin/egrep -v "^major|^$" | /bin/awk '{print $4}' | /bin/grep -v / | /bin/egrep -v "[0123456789]$"`
- echo "fdisk -l output"
- for d in $raiddevs $disks ; do
- echo "<---- Disk: /dev/${d} ---->"
- echo ""
- /sbin/fdisk -l /dev/${d} 2>&1
- echo ""
- echo "<---- END ---->"
- done
-}
-
-getpciinfo() {
-( echo "lspci"
- echo
- /sbin/lspci
- echo
- echo "lspci -n"
- echo
- /sbin/lspci -n
- echo
- echo "lspci -nv"
- echo
- /sbin/lspci -nv
- echo
- echo "lspci -nvv"
- echo
- /sbin/lspci -nvv ) 2>&1
-}
-
-catiffile() {
- if [ -d $1 ]; then
- /bin/cp -p -x --parents -R $1 $ROOT 2>>$ROOT/$log
- find $ROOT/$1 -type b -o -type c | xargs rm -f 2>/dev/null || :
- echo -n $STATUS
- echo_success
- return 1
- fi
- if [ -f $1 ]; then
- /bin/cp -p --parents $1 $ROOT 2>>$ROOT/$log
- echo -n $STATUS
- echo_success
- return 1
- fi
-
- return 0
-}
-
-catifexec() {
- if [ -x $1 ]; then
- echo -n $STATUS
- echo "$*" >> $ROOT/`/bin/basename $1`
- $* >> $ROOT/`/bin/basename $1` 2>&1
- echo_success
- return 1
- fi
- return 0
-}
-
-# The following was borrowed from the Red Hat 6.x init scripts function
-# to aid in letting the user know the application was still working.
-#
-# Get a sane screen width
-[ -z "$COLUMNS" ] && COLUMNS=80
-
-# Read in our configuration
-if [ -z "$BOOTUP" ]; then
- if [ -f /etc/sysconfig/init ]; then
- . /etc/sysconfig/init
- else
- # This all seem confusing? Look in /etc/sysconfig/init,
- # or in /usr/doc/initscripts-*/sysconfig.txt
- BOOTUP=color
- RES_COL=60
- MOVE_TO_COL="echo -en \\033[300C\\033[$[${COLUMNS}-${RES_COL}]D"
- SETCOLOR_SUCCESS="echo -en \\033[1;32m"
- SETCOLOR_FAILURE="echo -en \\033[1;31m"
- SETCOLOR_WARNING="echo -en \\033[1;33m"
- SETCOLOR_NORMAL="echo -en \\033[0;39m"
- LOGLEVEL=1
- fi
-fi
-
-echo_success() {
- [ "$BOOTUP" = "color" ] && $MOVE_TO_COL
- echo -n "[ "
- [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS
- echo -n "OK"
- [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
- echo " ]"
- return 0
-}
-
-echo_failure() {
- [ "$BOOTUP" = "color" ] && $MOVE_TO_COL
- echo -n "["
- [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
- echo -n "FAILED"
- [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
- echo "]"
- return 1
-}
-
-echo_passed() {
- [ "$BOOTUP" = "color" ] && $MOVE_TO_COL
- echo -n "["
- [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING
- echo -n "PASSED"
- [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
- echo "]"
- return 1
-}
-
-
diff --git a/src/extras/sysreport/sysreport-fdisk b/src/extras/sysreport/sysreport-fdisk
deleted file mode 100755
index 451cb535..00000000
--- a/src/extras/sysreport/sysreport-fdisk
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh
-
-/sbin/fdisk -l /dev/hd[a-g]
-/sbin/fdisk -l /dev/sd[a-p]
-/sbin/fdisk -l /dev/md[0-9] /dev/md[1][0-5]
-for i in `/bin/ls /dev/rd/ | /bin/grep -v p[0-9]`; do
- /sbin/fdisk -l /dev/rd/"$i" 2>&1
-done
diff --git a/src/extras/sysreport/sysreport.legacy b/src/extras/sysreport/sysreport.legacy
deleted file mode 100755
index 043ba026..00000000
--- a/src/extras/sysreport/sysreport.legacy
+++ /dev/null
@@ -1,766 +0,0 @@
-#! /bin/bash
-#
-# System Report
-# Copyright (c) 1999-2006 Red Hat, Inc. All rights reserved.
-#
-# Written by:
-# Wil Harris
-# Peter Jones
-# Preston Brown
-# Than Ngo
-
-umask 0077
-UTILDIR=/usr/share/sysreport
-VER=`/bin/uname -r`
-PATH=""
-PROGNAME="sysreport"
-DATE=`/bin/date -u +%G%m%d%k%M%S | /usr/bin/tr -d ' '`
-
-function usage {
- echo "Sysreport is a utility that gathers information about a system's"
- echo "hardware and configuration. The information can then be used for"
- echo "diagnostic purposes and debugging. Sysreport is commonly used to help"
- echo "support technicians and developers by providing a "snapshot" of a"
- echo "system's current layout."
- echo
- echo "Usage: sysreport [OPTION]"
- echo " -help : show help"
- echo " -norpm : omit collecting information about currently installed packages"
- echo " -dmidecode: enable dmidecode, getting information about the hardware"
- echo " -firewall : collecting the system firewall rules"
- echo " -home : place sysreport outputs within home directory"
- echo " -usesysrq : collecting information about sysrq-trigger"
- echo
- exit 0
-}
-
-[ $# -lt 6 ] || usage
-for i
-do
- case "$i" in
- -help) usage;;
- -norpm) NORPM=yes;;
- -dmidecode) DMIDECODE=yes;;
- -firewall) FIREWALL=yes;;
- -home) HOMEDIR=yes;;
- -sysrq) SYSRQ_TRIGGER=yes;;
- -usesysrq) SYSRQ_TRIGGER=yes;;
- *) usage;;
- esac
-done
-
-if [ -f $UTILDIR/functions ]; then
- . $UTILDIR/functions
-else
- echo "Sysreport is not properly installed"
- exit 1
-fi
-if [ $UID != 0 ]; then
- echo "You must be root to use this utility"
- exit 1
-fi
-
-if [ "$HOMEDIR" = yes ] ; then
- TEMPDIR=$HOME
- ROOT=$HOME/sysreport-$DATE
- /bin/mkdir $ROOT >& /dev/null
-else
- TEMPDIR=/tmp
- ROOT=`/bin/mktemp -dq /tmp/sysreport.XXXXXXXX`
-fi
-if [ $? != 0 ] ; then
- echo "Cannot make temp dir"
- exit 1
-fi
-
-trap "{ rm -rf $ROOT ; exit ; }" EXIT
-
-if [ -f /etc/fedora-release ] ; then
- release_name="Fedora Core"
-else
- release_name="Red Hat Linux"
-fi
-
-echo
-echo "This utility will go through and collect some detailed information "
-echo "about the hardware and setup of your $release_name system."
-echo "This information will be used to diagnose problems with your system"
-echo "and will be considered confidential information. Red Hat will use"
-echo "this information for diagnostic purposes ONLY. "
-echo
-echo "Please wait while we collect information about your system."
-echo
-echo "This process may take a while to complete...."
-echo "No changes will be made to your system during this process."
-echo
-echo "NOTE: You can safely ignore a failed message. This only means a file"
-echo "we were checking for did not exist."
-echo
-echo "If your system hangs while gathering rpm information, please abort"
-echo "the script with CTRL-C and run it again after adding -norpm to the"
-echo "sysreport command line"
-echo
-echo "Press ENTER to continue, or CTRL-C to quit."
-read IGNORE
-
-echo
-echo "Getting system configuration information."
-echo
-STATUS="Determining $release_name version:"
-catiffile "/etc/redhat-release"
-
-STATUS="Determinding your current hostname: "
-catifexec "/bin/hostname"
-
-STATUS="Getting the date:"
-catifexec "/bin/date"
-
-STATUS="Checking your systems current uptime and load average:"
-catifexec "/usr/bin/uptime"
-
-STATUS="Checking available memory:"
-catifexec "/usr/bin/free"
-
-STATUS="Checking free disk space:"
-catifexec "/bin/df" "-al"
-
-STATUS="Checking currently running processes:"
-catifexec "/bin/ps" "-e -o euser,pid,ppid,tty,%cpu,%mem,rss,vsz,start_time,time,state,wchan,cmd"
-
-STATUS="Checking current process tree:"
-catifexec "/usr/bin/pstree"
-
-STATUS="Collecting information about ld.so.conf:"
-catiffile "/etc/ld.so.conf"
-
-STATUS="Collecting information about ld.so.conf.d:"
-catiffile "/etc/ld.so.conf.d"
-
-STATUS="Collecting IPC-related information:"
-catifexec "/usr/bin/ipcs" "-a"
-
-STATUS="Collecting information about chkconfig --list:"
-catifexec "/sbin/chkconfig" "--list"
-
-STATUS="Collecting information about /etc/rc.d:"
-catiffile "/etc/rc.d"
-/bin/ls /etc/rc.d/rc*.d/ > $ROOT/etc/rc.d/ls-output
-
-if [ -x /usr/sbin/lsof ] ; then
- STATUS="Lists information about files opened (lsof)"
- catifexec "/usr/sbin/lsof" "-b +M -n -l"
-fi
-
-STATUS="Collecting interprocess communication facilities status"
-catifexec "/usr/bin/ipcs" "-u"
-catifexec "/usr/bin/ipcs" "-l"
-
-# check to see if we want to run rpm, under some circumstances
-# rpm can hang and never complete
-# yes, command line parsing needs some work
-if [ "$NORPM" != "yes" ]; then
- echo "Collecting information about currently installed packages:"
- echo -n "This may take several minutes...."
- /bin/rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n" > $ROOT/installed-rpms
- /bin/rpm -Va > $ROOT/rpm-Va 2>&1
- echo_success
-fi
-
-STATUS="Getting bootloader information:"
-/bin/ls -alR /boot > $ROOT/ls-boot 2>&1
-
-# This covers sparc, alpha, and intel (respectively)
-# updated for grub -mpg
-if [ -f /etc/silo.conf ]; then
- STATUS="Collecting information about the boot process (silo):"
- catiffile "/etc/silo.conf"
-fi
-if [ -f /etc/milo.conf ]; then
- STATUS="Collecting information about the boot process (milo):"
- catiffile "/etc/milo.conf"
-fi
-if [ -f /etc/lilo.conf ]; then
- STATUS="Collecting information about the boot process (lilo):"
- catiffile "/etc/lilo.conf"
- catifexec "/sbin/lilo" "-q"
-fi
-if [ -d /boot/grub -a -f /boot/grub/grub.conf -a -f /boot/grub/device.map ]; then
- STATUS="Collecting information about the boot process (grub.conf):"
- catiffile "/boot/grub/grub.conf"
- STATUS="Collecting information about the boot process (grub.map):"
- catiffile "/boot/grub/device.map"
-fi
-if [ -f /etc/cluster.conf -o -f /etc/cluster.xml -o -f /etc/cluster/cluster.conf ] ; then
- STATUS="Gathering information on cluster setup"
- # 2.1 AS
- if [ -f /etc/cluster.conf ] ; then
- catiffile "/etc/cluster.conf"
- fi
- # Taroon
- if [ -f /etc/cluster.xml ] ; then
- catiffile "/etc/cluster.xml"
- fi
- # RHEL4
- if [ -d /etc/cluster ]; then
- catiffile "/etc/cluster"
- fi
-fi
-STATUS="Collecting init configuration:"
-catiffile "/etc/inittab"
-
-STATUS="Collecting information about X:"
-catiffile "/etc/X11"
-
-STATUS="Gathering sysctl information (/proc/sys):"
-catifexec "/sbin/sysctl" "-a"
-STATUS="Gathering sysctl information (/etc/sysctl.conf):"
-catiffile "/etc/sysctl.conf"
-
-for x in `/bin/ls -d /etc/cron*` ; do
- STATUS="Collecting information about cron ($(/bin/basename $x)):"
- catiffile "$x"
-done
-
-STATUS="Gathering Syslog config information:"
-catiffile "/etc/syslog.conf"
-
-STATUS="Gathering ntp configuration (/etc/ntp.conf):"
-catiffile "/etc/ntp.conf"
-STATUS="Gathering ntp configuration (/etc/ntp/step-tickers):"
-catiffile "/etc/ntp/step-tickers"
-STATUS="Gathering ntp configuration (/etc/ntp/ntpservers):"
-catiffile "/etc/ntp/ntpservers"
-
-STATUS="Gathering IP information (/sbin/ifconfig):"
-catifexec "/sbin/ifconfig" "-a"
-
-STATUS="Checking network routes:"
-catifexec "/sbin/route" "-n"
-
-STATUS="Collecting Name Service Switch config information:"
-catiffile "/etc/nsswitch.conf"
-STATUS="Collecting NIS client information:"
-catiffile "/etc/yp.conf"
-
-STATUS="Collecting system configuration information:"
-catiffile "/etc/sysconfig"
-fixupfile 's/\(.*Password=\)\(.*\)/\1********/' $ROOT/etc/sysconfig/rhn/up2date
-
-STATUS="Collecting information about system authentication (pam):"
-catiffile "/etc/pam.d"
-
-echo
-echo "Getting information about the kernel."
-echo
-STATUS="Getting kernel version:"
-catifexec "/bin/uname" "-a"
-STATUS="Checking module information:"
-catifexec "/sbin/lsmod"
-for x in $(/sbin/lsmod | /bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null ) ; do
- STATUS="Checking module information $x:"
- catifexec "/sbin/modinfo" "$x"
-done
-
-STATUS="Currently getting ksysms information:"
-catifexec "/sbin/ksyms"
-
-STATUS="Gathering information about your filesystems:"
-catiffile "/proc/filesystems"
-
-STATUS="Gathering information about your system stat:"
-catiffile "/proc/stat"
-
-STATUS="Gathering information about your partitions:"
-catiffile "/proc/partitions"
-
-STATUS="Gathering information about your ksysms:"
-catiffile "/proc/ksyms"
-
-STATUS="Gathering information about slabinfo:"
-catiffile "/proc/slabinfo"
-
-# Added support to cover for the new modules.conf layout in Red Hat 7
-STATUS="Collecting information regarding kernel modules"
-catiffile "/lib/modules/$VER/modules.dep"
-if [ -f /etc/conf.modules ]; then
- STATUS="Collecting information regarding kernel modules (conf.modules)"
- catiffile "/etc/conf.modules"
-fi
-if [ -f /etc/modules.conf ]; then
- STATUS="Collecting information regarding kernel modules (modules.conf)"
- catiffile "/etc/modules.conf"
-fi
-if [ -f /etc/modprobe.conf ]; then
- STATUS="Collecting information regarding kernel modules (modeprobe.conf)"
- catiffile "/etc/modprobe.conf"
-fi
-
-if [ "$DMIDECODE" == "yes" ] ; then
- echo "Getting information about the hardware."
- echo
- if [ -x /usr/sbin/dmidecode ] ; then
- STATUS="Gathering DMI information:"
- catifexec "/usr/sbin/dmidecode"
- fi
-fi
-
-# dkms status
-STATUS="Gathering current status of modules, versions and kernels (dkms):"
-if [ -x /usr/sbin/dkms ] ; then
- catifexec "/usr/sbin/dkms" "status"
-fi
-
-if [ -f /etc/sysconfig/isdncard ] ; then
- STATUS="Gathering information about ISDN:"
- catiffile "/etc/sysconfig/isdncard"
-fi
-
-STATUS="Collecting information from the proc directory:"
-catiffile "/proc/pci"
-
-STATUS="Getting kernel command line"
-catiffile "/proc/cmdline"
-
-STATUS="Gathering information about your CPU:"
-catiffile "/proc/cpuinfo"
-
-STATUS="Gathering information about your Ram:"
-catiffile "/proc/meminfo"
-
-STATUS="Gathering information about your ioports:"
-catiffile "/proc/ioports"
-
-STATUS="Gathering information about your interrupts:"
-catiffile "/proc/interrupts"
-
-STATUS="Gathering information about your scsi devices:"
-catiffile "/proc/scsi"
-
-STATUS="Gathering information about your dma:"
-catiffile "/proc/dma"
-
-STATUS="Gathering information about your devices (/proc/devices):"
-catiffile "/proc/devices"
-
-STATUS="Gathering information about your rtc:"
-catiffile "/proc/rtc"
-
-STATUS="Gathering information about your ide drivers:"
-catiffile "/proc/ide"
-
-STATUS="Gathering information about your bus:"
-getpciinfo > $ROOT/lspci
-catiffile "/proc/bus"
-
-STATUS="Gathering info on udev configuration:"
-catiffile "/etc/udev"
-
-echo
-echo "Getting disk and filesystem information."
-echo
-
-STATUS="Collecting information from /etc/fstab:"
-catiffile "/etc/fstab"
-
-STATUS="Collecting disk partition information:"
-PATH=/bin getpartinfo > $ROOT/fdisk-l
-
-STATUS="Checking mounted file systems (mount) "
-catifexec "/bin/mount"
-
-STATUS="Checking mounted file systems (/proc/mounts)"
-catiffile "/proc/mounts"
-
-STATUS="Collecting Software RAID information (/proc/mdstat)"
-catiffile "/proc/mdstat"
-
-STATUS="Collecting Software RAID information (/etc/raidtab)"
-catiffile "/etc/raidtab"
-
-STATUS="Collecting Software RAID information (/etc/mdadm.conf)"
-catiffile "/etc/mdadm.conf"
-
-STATUS="Collecting Software RAID information (mdadm -D /dev/md*)"
-catifexec "/sbin/mdadm" "-D /dev/md*"
-
-STATUS="Collecting Automount information (auto.master)"
-catiffile "/etc/auto.master"
-
-STATUS="Collecting Automount information (auto.misc)"
-catiffile "/etc/auto.misc"
-
-STATUS="Collecting Automount information (auto.net)"
-catiffile "/etc/auto.net"
-
-STATUS="Collecting LVM information:"
-catifexec "/usr/sbin/vgdisplay" "-vv"
-
-STATUS="Gathering LVM setup"
-catiffile "/etc/lvm"
-
-STATUS="Collecting SCSI Tape information (/etc/stinit.def)"
-catiffile "/etc/stinit.def"
-
-if [ -x /sbin/lsusb ] ; then
- STATUS="Collecting USB devices list (lsusb):"
- catifexec "/sbin/lsusb"
-fi
-
-if [ -x /usr/bin/lshal ] ; then
- STATUS="Collecting global devices list (lshal):"
- catifexec "/usr/bin/lshal"
-fi
-
-echo
-echo "collecting information about commonly used network services"
-echo
-# This covers backwards compatiablity for systems with inetd while keeping
-# support for the new 7.x xinetd
-if [ -f /etc/inetd.conf ]; then
- STATUS="Collecting information about system services (inetd.conf)"
- catiffile "/etc/inetd.conf"
-elif [ -f /etc/xinetd.conf ]; then
- STATUS="Collecting information about system services (xinetd.conf)"
- catiffile "/etc/xinetd.conf"
- for x in `/bin/ls -d /etc/xinetd.d/*`; do
- STATUS="Collecting information about system services ($(/bin/basename $x))"
- catiffile "$x"
- done
-fi
-for x in `/bin/ls -d /etc/host*` ; do
- STATUS="Collecting information from $x:"
- catiffile "$x"
-done
-
-STATUS="Collecting information about the ftp servers:"
-ftpconfigfiles=`/bin/ls -d /etc/ftp* /etc/vsftpd/* 2>/dev/null`
-for x in $ftpconfigfiles; do
- STATUS="Collecting information about the ftp servers ($(/bin/basename $x)):"
- catiffile "$x"
-done
-
-STATUS="Collecting information about ypbind configuration:"
-catiffile "/etc/yp.conf"
-
-if [ "$FIREWALL" == "yes" ]; then
- KERNELMIN=`/bin/uname -r | /bin/sed -e 's,[^\.]*\.,,' -e 's,\..*,,'`
- ipchainsmod=`/sbin/lsmod 2>/dev/null| /bin/grep ipchains`
-
- if [ "$KERNELMIN" -lt 3 ] || [ -n "${ipchainsmod}" ] ; then
- STATUS="Getting ipchains information:"
- catifexec "/sbin/ipchains" "-nvL"
- elif [ "$KERNELMIN" -gt 3 ]; then
- STATUS="Getting iptables information:"
- if [ -f /etc/sysconfig/iptables-config ] ; then
- catiffile "/etc/sysconfig/iptables-config"
- fi
- STATUS="Getting iptables information (filter):"
- catifexec "/sbin/iptables" "-t filter -nvL"
- STATUS="Getting iptables information (mangle):"
- catifexec "/sbin/iptables" "-t mangle -nvL"
- STATUS="Getting iptables information (nat):"
- catifexec "/sbin/iptables" "-t nat -nvL"
- fi
-fi
-
-# ldap client and server config
-if [ -f /etc/ldap.conf ] ; then
- STATUS="Getting LDAP configuration (ldap.conf)"
- catiffile "/etc/ldap.conf"
-fi
-if [ -d /etc/openldap ] ; then
- for x in `/bin/ls -d /etc/openldap/*` ; do
- if [ -f $x ] ; then
- STATUS="Getting LDAP configuration ($(/bin/basename $x))"
- catiffile "$x"
- fi
- done
-fi
-
-# ssh
-STATUS="Getting ssh configuration (ssh_config)"
-catiffile "/etc/ssh/ssh_config"
-STATUS="Getting sshd configuration (sshd_config)"
-catiffile "/etc/ssh/sshd_config"
-
-# sendmail
-SENDMAIL_CF_FILE=/etc/mail/sendmail.cf
-SENDMAIL_CW_FILE=/etc/mail/sendmail.cw
-
-if [ -f /etc/sendmail.cf ] ; then
- SENDMAIL_CF_FILE=/etc/sendmail.cf
-fi
-
-if [ -f /etc/sendmail.cw ] ; then
- SENDMAIL_CW_FILE=/etc/sendmail.cw
-fi
-
-STATUS="Sendmail Configuration ($SENDMAIL_CF_FILE):"
-catiffile "$SENDMAIL_CF_FILE"
-if [ -f $SENDMAIL_CW_FILE ]; then
- STATUS="Sendmail Machine aliases ($SENDMAIL_CW_FILE):"
- catiffile "$SENDMAIL_CW_FILE"
-fi
-
-STATUS="Sendmail User aliases (/etc/aliases):"
-catiffile "/etc/aliases"
-
-for f in `/bin/ls -d /etc/mail/* | /bin/grep -v \.db`; do
- STATUS="Getting files from ($(/bin/basename $f))"
- catiffile $f
-done
-
-STATUS="Collecting Postfix Configuration (main.cf)"
-catiffile "/etc/postfix/main.cf"
-
-STATUS="Collecting Postfix Configuration (master.cf)"
-catiffile "/etc/postfix/master.cf"
-
-STATUS="Collecting exim configuration directory"
-catiffile "/etc/exim"
-
-STATUS="Collecting host resolution information"
-catiffile "/etc/resolv.conf"
-
-# Make sure we have support for both versions of bind
-if [ -f /etc/named.boot ]; then
- STATUS="Collecting information about the nameserver (named.boot)"
- catiffile "/etc/named.boot"
-elif [ -f /etc/named.conf ]; then
- STATUS="Collecting information about the nameserver (named.conf)"
- catiffile "/etc/named.conf"
-fi
-
-DNSDIR=""
-if [ -f /etc/named.conf ]; then
- DNSDIR=$(/bin/grep -i directory /etc/named.conf |/bin/gawk '{ print $2 ;}'|\
- /bin/sed s/\"//g|/bin/sed s/\;//g)
-elif [ -f /etc/named.boot ]; then
- DNSDIR=$(/bin/grep -i directory /etc/named.boot|/bin/gawk '{ print $2 ;}')
-fi
-
-if [ -n "$DNSDIR" -a -d "$DNSDIR" ]; then
- STATUS="Collecting information about the nameserver ($DNSDIR)"
- catiffile "$DNSDIR"
-fi
-
-if [ -f /etc/exports ] ; then
- STATUS="Collecting information about the NFS:"
- catiffile "/etc/exports"
-fi
-
-SAMBADIR="/etc/samba"
-if [ -d $SAMBADIR ]; then
- STATUS="Getting samba informations ($SAMBADIR)"
- for x in `/bin/ls -d $SAMBADIR/* | grep -vE 'smbpasswd|secrets\.tdb|\.bak|\.rpmnew'` ; do
- STATUS="Getting samba informations ($(/bin/basename $x))"
- catiffile "$x"
- done
- /bin/ls -alR $SAMBADIR > $ROOT/ls-samba 2>&1
- if [ -x /usr/bin/wbinfo ] ; then
- STATUS="Getting samba informations (wbinfo -g):"
- catifexec "/usr/bin/wbinfo" "-g"
- STATUS="Getting samba informations (wbinfo -u):"
- catifexec "/usr/bin/wbinfo" "-u"
- fi
-fi
-
-STATUS="Getting /etc/securetty"
-catiffile "/etc/securetty"
-
-STATUS="Getting /etc/shells"
-catiffile "/etc/shells"
-
-STATUS="Getting ulimit info"
-catiffile "/etc/security/limits.conf"
-
-STATUS="Getting nscd configuration"
-catiffile "/etc/nscd.conf"
-
-STATUS="Getting Kerberos informations (/etc/krb5.conf)"
-catiffile "/etc/krb5.conf"
-
-STATUS="Getting Kerberos informations (/etc/krb.conf)"
-catiffile "/etc/krb.conf"
-
-STATUS="Getting Kerberos informations (/etc/krb.realms)"
-catiffile "/etc/krb.realms"
-
-STATUS="Getting information about apache"
-catiffile "/etc/httpd/conf/httpd.conf"
-
-for x in `/bin/ls -d /etc/httpd/conf.d/*.conf 2>/dev/null` ; do
- STATUS="Getting information about apache ($(/bin/basename $x))"
- catiffile "$x"
-done
-
-STATUS="Getting information about squid"
-catiffile "/etc/squid/squid.conf"
-
-STATUS="Getting information about CUPS"
-for x in `/bin/ls -d /etc/cups/*.conf 2>/dev/null` ; do
- STATUS="Getting information about CUPS ($x)"
- catiffile "$x"
-done
-
-echo
-echo "Gathering information from system logs"
-echo
-STATUS="Collecting information from dmesg:"
-catiffile "/var/log/dmesg"
-
-if [ "$SYSRQ_TRIGGER" == "yes" ]; then
- STATUS="Collecting information from /proc/sysrq-trigger"
- if [ -f /proc/sysrq-trigger -a -f /proc/sys/kernel/sysrq ] ; then
- sysr_state="$(/bin/cat /proc/sys/kernel/sysrq)"
- echo 1 > /proc/sys/kernel/sysrq
- for key in m p t ; do
- echo $key > /proc/sysrq-trigger
- done
- echo $sysr_state > /proc/sys/kernel/sysrq
- fi
-fi
-
-for x in `/bin/ls /var/log/messages*` ; do
- STATUS="Collecting messages files ($x)"
- catiffile "$x"
-done
-for x in `/bin/ls /var/log/maillog*` ; do
- STATUS="Collecting maillog files ($x)"
- catiffile "$x"
-done
-
-
-STATUS="Collecting information (/var/log/sa)"
-catiffile "/var/log/sa"
-
-for x in `/bin/ls -d /var/log/Xorg.*.log /var/log/XFree86.*.log 2>/dev/null` ; do
- STATUS="Collecting X logs ($x)"
- catiffile "$x"
-done
-
-STATUS="Collecting information (/var/log/rpmpkgs)"
-catiffile "/var/log/rpmpkgs"
-
-STATUS="Collecting information (/var/log/boot.log)"
-catiffile "/var/log/boot.log"
-
-STATUS="Collecting information (/var/log/up2date)"
-catiffile "/var/log/up2date"
-
-STATUS="Collecting information (/var/log/secure)"
-catiffile "/var/log/secure"
-
-STATUS="Collecting log files from Apache"
-catiffile "/var/log/httpd"
-
-STATUS="Collecting log files from RHN"
-if `/bin/ls /var/log/rhn* >& /dev/null` ; then
- catiffile "/var/log/rhn*"
-fi
-
-# General monitoring moc logs
-if [ -d /opt/notification ] ; then
- for x in `/bin/ls -d /opt/notification/var/*.log* 2>/dev/null` ; do
- STATUS="Collecting monitoring moc logs ($(/bin/basename $x))"
- catiffile "$x"
- done
- for x in `/bin/ls -d /var/tmp/ack_handler.log* 2>/dev/null` ; do
- STATUS="Collecting monitoring moc logs ($(/bin/basename $x))"
- catiffile "$x"
- done
- for x in `/bin/ls -d /var/tmp/enqueue.log* 2>/dev/null` ; do
- STATUS="Collecting monitoring moc logs ($(/bin/basename $x))"
- catiffile "$x"
- done
-fi
-
-# monitoring scout logs
-if [ -d /home/nocpulse/var ] ; then
- for x in `/bin/ls -d /home/nocpulse/var/*.log* 2>/dev/null` ; do
- STATUS="Collecting monitoring scout logs ($(/bin/basename $x))"
- catiffile "$x"
- done
- for x in `/bin/ls -d /home/nocpulse/var/commands/*.log* 2>/dev/null` ; do
- STATUS="Collecting monitoring scout logs ($(/bin/basename $x))"
- catiffile "$x"
- done
-fi
-
-/bin/echo
-/bin/echo "Getting information about RHN"
-/bin/echo
-RHNDIR=/etc/sysconfig/rhn
-/bin/mkdir -p $ROOT/$RHNDIR 2>/dev/null
-catiffile "/etc/rhn"
-if [ -f $RHNDIR/systemid ] ; then
- echo -n "Gathering systemid information:"
- if [ -x /usr/bin/xsltproc ] ; then
- /usr/bin/xsltproc $UTILDIR/text.xsl $RHNDIR/systemid > $ROOT/$RHNDIR/systemid 2>/dev/null
- echo_success
- else
- catiffile "$RHNDIR/systemid"
- fi
-fi
-
-# Get hardware profile information (for verification with system state and RHN)
-if [ -x /usr/share/rhn/up2date_client/hardware.py ] ; then
- STATUS="Gathering RHN hardware profile information"
- catifexec /usr/share/rhn/up2date_client/hardware.py
-fi
-if [ -x /usr/bin/rhn-schema-version ] ; then
- STATUS="Gathering schema version"
- catifexec "/usr/bin/rhn-schema-version"
-fi
-if [ -x /usr/bin/rhn-charsets ] ; then
- STATUS="Gathering database charactersets"
- catifexec "/usr/bin/rhn-charsets"
-fi
-
-# Get SELinux information
-echo
-echo "Gathering information on SELinux setup"
-echo
-catifexec "/usr/bin/selinuxconfig"
-catifexec "/usr/sbin/sestatus"
-catifexec "rpm" "-q -V selinux-policy-targeted"
-catifexec "rpm" "-q -V selinux-policy-strict"
-
-cd $TEMPDIR
-/bin/echo
-/bin/echo -n "Please enter your case number (if you have one): "
-
-while read CASENUM
-do
- case $CASENUM in
- *[^0-9]*)
- /bin/echo -e "\nError: Your input contains non-numeric characters!"
- /bin/echo -e "Please enter your case number (if you have one): "
- ;;
- *)
- break ;;
- esac
-done
-if [ ! $CASENUM ]; then
- NAME=$PROGNAME-$HOSTNAME.$DATE
-else
- NAME="$PROGNAME-$HOSTNAME-$CASENUM.$DATE"
-fi
-/bin/rm -Rf $NAME
-/bin/mv $ROOT $NAME
-/bin/tar Scf $NAME.tar $NAME
-if [ -x /usr/bin/bzip2 ]; then
- /usr/bin/bzip2 $NAME.tar
- SUFFIX="tar.bz2"
-else
- /bin/gzip -9 $NAME.tar
- SUFFIX="tar.gz"
-fi
-
-/bin/rm -Rf $NAME
-/bin/echo
-/bin/echo "Please send $TEMPDIR/${NAME}.${SUFFIX} to your support"
-/bin/echo "representative."
-/bin/echo
-
-exit 0
diff --git a/src/extras/sysreport/text.xsl b/src/extras/sysreport/text.xsl
deleted file mode 100644
index c381b3a8..00000000
--- a/src/extras/sysreport/text.xsl
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
- [
-
-
-
- ,
-
-
- ]
-
-
-
-
-
-
-
-
- :
-
-
-
-
-
-
-
-
-
diff --git a/src/gpgkeys/gpg.template b/src/gpgkeys/gpg.template
deleted file mode 100644
index 261f5b31..00000000
--- a/src/gpgkeys/gpg.template
+++ /dev/null
@@ -1,14 +0,0 @@
-%echo Generating key...
-Key-Type: DSA
-Key-Length: 1024
-Subkey-Type: ELG-E
-Subkey-Length: 1024
-Name-Real: Red Hat Support
-Name-Comment: SoS Encryption Key
-Name-Email: support@redhat.com
-Expire-Date: 0
-Passphrase: redhat
-%pubring gpgkeys/rhsupport.pub
-%secring gpgkeys/rhsupport.key
-%commit
-%echo done
diff --git a/src/lib/sos/__init__.py b/src/lib/sos/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/lib/sos/helpers.py b/src/lib/sos/helpers.py
deleted file mode 100755
index 52e5e52d..00000000
--- a/src/lib/sos/helpers.py
+++ /dev/null
@@ -1,176 +0,0 @@
-## helpers.py
-## Implement policies required for the sos system support tool
-
-## Copyright (C) 2006 Steve Conklin
-
-### 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.
-
-## Some code adapted from "Python Cookbook, 2nd ed", by Alex
-## Martelli, Anna Martelli Ravenscroft, and David Ascher
-## (O'Reilly Media, 2005) 0-596-00797-3
-##
-
-"""
-helper functions used by sosreport and plugins
-"""
-import os, fcntl, select, sys, commands, signal
-from time import time, sleep
-import logging
-from tempfile import mkdtemp
-
-def importPlugin(pluginname, name):
- """ Import a plugin to extend capabilities of sosreport
- """
- try:
- plugin = __import__(pluginname, globals(), locals(), [name])
- except ImportError:
- return None
- return getattr(plugin, name)
-
-
-def sosFindTmpDir():
- """Find a temp directory to form the root for our gathered information
- and reports.
- """
- workingBase = mkdtemp("","sos_")
- return workingBase
-
-
-def makeNonBlocking(afd):
- """ Make the file descriptor non-blocking. This prevents deadlocks.
- """
- fl = fcntl.fcntl(afd, fcntl.F_GETFL)
- try:
- fcntl.fcntl(afd, fcntl.F_SETFL, fl | os.O_NDELAY)
- except AttributeError:
- fcntl.fcntl(afd, fcntl.F_SETFL, fl | os.FNDELAY)
-
-
-def sosGetCommandOutput(command, timeout = 300):
- """ Execute a command and gather stdin, stdout, and return status.
- """
- soslog = logging.getLogger('sos')
-
- # Log if binary is not runnable or does not exist
- for path in os.environ["PATH"].split(":"):
- cmdfile = command.strip("(").split()[0]
- # handle both absolute or relative paths
- if ( ( not os.path.isabs(cmdfile) and os.access(os.path.join(path,cmdfile), os.X_OK) ) or \
- ( os.path.isabs(cmdfile) and os.access(cmdfile, os.X_OK) ) ):
- break
- else:
- soslog.log(logging.VERBOSE, "binary '%s' does not exist or is not runnable" % cmdfile)
- return (127, "", 0)
-
- # these are file descriptors, not file objects
- r, w = os.pipe()
-
- pid = os.fork()
-
- if pid:
- # we are the parent
- os.close(w) # use os.close() to close a file descriptor
- r_fd = os.fdopen(r) # turn r into a file object
- stime=time()
- txt = ""
- sts = -1
- soslog.log(logging.VERBOSE2, 'forked command "%s" with pid %d, timeout is %d' % (command, pid, timeout) )
- while True:
- # read output from pipe
- ready = select.select([r], [], [], 1)
- if r in ready[0]:
- txt = txt + r_fd.read()
- # is child still running ?
- try: os.waitpid(pid, os.WNOHANG)
- except:
- # not running, make sure the child process gets cleaned up
- try: sts = os.waitpid(pid, 0)[1]
- except: pass
- break
- # has timeout passed ?
- if time() - stime > timeout:
- soslog.log(logging.VERBOSE, 'killing hung child with pid %s after %d seconds (command was "%s")' % (pid,timeout,command) )
- try: os.kill(pid, signal.SIGKILL)
- except: pass
- break
- if txt[-1:] == '\n': txt = txt[:-1]
- return (sts, txt, time()-stime)
- else:
- # we are the child
- os.dup2(r, 0)
- os.dup2(w, 1)
- os.dup2(w, 2)
-
- import resource
- maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
- if not hasattr(resource, "RLIM_INFINITY"):
- resource.RLIM_INFINITY = -1L
- if (maxfd == resource.RLIM_INFINITY):
- maxfd = MAXFD
- for fd in range(3, maxfd):
- try: os.close(fd)
- except OSError: pass
- os.execl("/bin/sh", "/bin/sh", "-c", command)
- os._exit(127)
-
-# FIXME: this needs to be made clean and moved to the plugin tools, so
-# that it prints nice color output like sysreport if the progress bar
-# is not enabled.
-def sosStatus(stat):
- """ Complete a status line that has been output to the console,
- providing pass/fail indication.
- """
- if not stat:
- print " [ OK ]"
- else:
- print " [ FAILED ]"
- sys.stdout.flush()
- return
-
-
-def allEqual(elements):
- ''' return True if all the elements are equal, otherwise False. '''
- first_element = elements[0]
- for other_element in elements[1:]:
- if other_element != first_element:
- return False
- return True
-
-def commonPrefix(l1, l2, common = []):
- ''' return a list of common elements at the start of all sequences,
- then a list of lists that are the unique tails of each sequence. '''
- if len(l1) < 1 or len(l2) < 1 or l1[0] != l2[0]: return common, [l1, l2]
- return commonPrefix(l1[1:], l2[1:], common+[l1[0]])
-
-def sosRelPath(path1, path2, sep=os.path.sep, pardir=os.path.pardir):
- ''' return a relative path from path1 equivalent to path path2.
- In particular: the empty string, if path1 == path2;
- path2, if path1 and path2 have no common prefix.
- '''
- try:
- common, (u1, u2) = commonPrefix(path1.split(sep), path2.split(sep))
- except AttributeError:
- return path2
-
- if not common:
- return path2 # leave path absolute if nothing at all in common
- return sep.join( [pardir]*len(u1) + u2 )
-
-def sosReadFile(fname):
- ''' reads a file and returns its contents'''
- fp = open(fname,"r")
- content = fp.read()
- fp.close()
- return content
diff --git a/src/lib/sos/plugins/__init__.py b/src/lib/sos/plugins/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/lib/sos/plugins/acpid.py b/src/lib/sos/plugins/acpid.py
deleted file mode 100644
index 7e94e650..00000000
--- a/src/lib/sos/plugins/acpid.py
+++ /dev/null
@@ -1,24 +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.
-
-import sos.plugintools
-
-class acpid(sos.plugintools.PluginBase):
- """acpid related information
- """
- def setup(self):
- self.addCopySpec("/var/log/acpid*")
- self.addCopySpec("/etc/acpi/events/power.conf")
- return
-
diff --git a/src/lib/sos/plugins/amd.py b/src/lib/sos/plugins/amd.py
deleted file mode 100644
index d2e85f09..00000000
--- a/src/lib/sos/plugins/amd.py
+++ /dev/null
@@ -1,36 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Eugene Teo
-
-### 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.
-
-import sos.plugintools
-import os
-
-class amd(sos.plugintools.PluginBase):
- """Amd automounter information
- """
- def checkenabled(self):
- if self.isInstalled("am-utils") or os.path.exists("/etc/rc.d/init.d/amd"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/amd.*")
- self.addCopySpec("/etc/rc.d/init.d/amd")
- self.addCopySpec("/etc/sysconfig/amd")
- self.collectExtOutput("/bin/rpm -qV am-utils")
- self.collectExtOutput("/bin/egrep -e 'automount|pid.*nfs' /proc/mounts")
- self.collectExtOutput("/bin/mount | egrep -e 'automount|pid.*nfs'")
- return
-
diff --git a/src/lib/sos/plugins/anaconda.py b/src/lib/sos/plugins/anaconda.py
deleted file mode 100644
index 27132fb2..00000000
--- a/src/lib/sos/plugins/anaconda.py
+++ /dev/null
@@ -1,34 +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.
-
-import sos.plugintools
-import os
-
-class anaconda(sos.plugintools.PluginBase):
- """Anaconda / Installation information
- """
- def checkenabled(self):
- if os.path.exists("/var/log/anaconda.log"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/root/anaconda-ks.cfg")
- self.addCopySpec("/root/install.log")
- self.addCopySpec("/root/install.log.syslog")
- self.addCopySpec("/var/log/anaconda.log")
- self.addCopySpec("/var/log/anaconda.syslog")
- self.addCopySpec("/var/log/anaconda.xlog")
- return
-
diff --git a/src/lib/sos/plugins/apache.py b/src/lib/sos/plugins/apache.py
deleted file mode 100644
index bae93562..00000000
--- a/src/lib/sos/plugins/apache.py
+++ /dev/null
@@ -1,28 +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.
-
-import sos.plugintools
-
-class apache(sos.plugintools.PluginBase):
- """Apache related information
- """
- optionList = [("log", "gathers all apache logs", "slow", False)]
-
- def setup(self):
- self.addCopySpec("/etc/httpd/conf/httpd.conf")
- self.addCopySpec("/etc/httpd/conf.d/*.conf")
- if self.getOption("log"):
- self.addCopySpec("/var/log/httpd/*")
- return
-
diff --git a/src/lib/sos/plugins/auditd.py b/src/lib/sos/plugins/auditd.py
deleted file mode 100644
index 7dd4cad8..00000000
--- a/src/lib/sos/plugins/auditd.py
+++ /dev/null
@@ -1,27 +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.
-
-import sos.plugintools
-
-class auditd(sos.plugintools.PluginBase):
- """Auditd related information
- """
-
- optionList = [("syslogsize", "max size (MiB) to collect per syslog file", "", 15)]
-
- def setup(self):
- self.addCopySpec("/etc/audit/auditd.conf")
- self.addCopySpec("/etc/audit/audit.rules")
- self.addCopySpecLimit("/var/log/audit*", sizelimit = self.getOption("syslogsize"))
- return
diff --git a/src/lib/sos/plugins/autofs.py b/src/lib/sos/plugins/autofs.py
deleted file mode 100644
index bb7c6182..00000000
--- a/src/lib/sos/plugins/autofs.py
+++ /dev/null
@@ -1,61 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Adam Stokes
-
-### 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.
-
-import sos.plugintools
-import os, re
-
-class autofs(sos.plugintools.PluginBase):
- """autofs server-related information
- """
- def checkenabled(self):
- if self.policy().runlevelDefault() in self.policy().runlevelByService("autofs"):
- return True
- return False
-
- def checkdebug(self):
- """ testing if autofs debug has been enabled anywhere
- """
- # Global debugging
- optlist=[]
- opt = self.fileGrep(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)", "/etc/sysconfig/autofs")
- for opt1 in opt:
- for opt2 in opt1.split(" "):
- optlist.append(opt2)
- for dtest in optlist:
- if dtest == "--debug" or dtest == "debug":
- return True
-
- def getdaemondebug(self):
- """ capture daemon debug output
- """
- debugout = self.fileGrep(r"^(daemon.*)\s+(\/var\/log\/.*)", "/etc/sysconfig/autofs")
- for i in debugout:
- return i[1]
-
- def setup(self):
- self.addCopySpec("/etc/auto*")
- self.addCopySpec("/etc/sysconfig/autofs")
- self.addCopySpec("/etc/init.d/autofs")
- self.collectExtOutput("/bin/rpm -qV autofs")
- self.collectExtOutput("/etc/init.d/autofs status")
- self.collectExtOutput("ps auxwww | grep automount")
- self.collectExtOutput("/bin/egrep -e 'automount|pid.*nfs' /proc/mounts")
- self.collectExtOutput("/bin/mount | egrep -e 'automount|pid.*nfs'")
- self.collectExtOutput("/sbin/chkconfig --list autofs")
- if self.checkdebug():
- self.addCopySpec(self.getdaemondebug())
- return
-
diff --git a/src/lib/sos/plugins/bootloader.py b/src/lib/sos/plugins/bootloader.py
deleted file mode 100644
index 5eb811cd..00000000
--- a/src/lib/sos/plugins/bootloader.py
+++ /dev/null
@@ -1,32 +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.
-
-import sos.plugintools
-
-class bootloader(sos.plugintools.PluginBase):
- """Bootloader information
- """
- def setup(self):
- self.addCopySpec("/etc/lilo.conf")
- self.addCopySpec("/etc/milo.conf")
- self.addCopySpec("/etc/silo.conf")
- self.addCopySpec("/boot/efi/efi/redhat/elilo.conf")
- self.addCopySpec("/boot/grub/grub.conf")
- self.addCopySpec("/boot/grub/device.map")
- self.addCopySpec("/boot/yaboot.conf")
-
- self.collectExtOutput("/sbin/lilo -q")
- self.collectExtOutput("/bin/ls -laR /boot")
- return
-
diff --git a/src/lib/sos/plugins/cluster.py b/src/lib/sos/plugins/cluster.py
deleted file mode 100644
index 2e531532..00000000
--- a/src/lib/sos/plugins/cluster.py
+++ /dev/null
@@ -1,299 +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.
-
-import sos.plugintools
-import commands, os, re
-import time, libxml2
-import glob
-
-class cluster(sos.plugintools.PluginBase):
- """cluster suite and GFS related information
- """
-
- optionList = [("gfslockdump", 'gather output of gfs lockdumps', 'slow', False),
- ('lockdump', 'gather dlm lockdumps', 'slow', False)]
-
- def checkenabled(self):
- rhelver = self.policy().rhelVersion()
- if rhelver == 4:
- self.packages = [ "ccs", "cman", "cman-kernel", "magma", "magma-plugins",
- "rgmanager", "fence", "dlm", "dlm-kernel", "gulm",
- "GFS", "GFS-kernel", "lvm2-cluster" ]
- elif rhelver == 5:
- self.packages = [ "rgmanager", "luci", "ricci", "system-config-cluster",
- "gfs-utils", "gnbd", "kmod-gfs", "kmod-gnbd", "lvm2-cluster" ]
-
- self.files = [ "/etc/cluster/cluster.conf", "/proc/cluster" ]
- return sos.plugintools.PluginBase.checkenabled(self)
-
- def has_gfs(self):
- return (len(self.doRegexFindAll(r'^\S+\s+\S+\s+gfs\s+.*$', "/etc/mtab")) > 0)
-
- def diagnose(self):
- rhelver = self.policy().rhelVersion()
-
- # check if the minimum set of packages is installed
- # for RHEL4 RHCS(ccs, cman, cman-kernel, magma, magma-plugins, (dlm, dlm-kernel) || gulm, perl-Net-Telnet, rgmanager, fence)
- # RHEL4 GFS (GFS, GFS-kernel, ccs, lvm2-cluster, fence)
-
- pkgs_check = []
- mods_check = []
- serv_check = []
-
- if rhelver == 4:
- pkgs_check.extend( [ "ccs", "cman", "magma", "magma-plugins", "perl-Net-Telnet", "rgmanager", "fence" ] )
- mods_check.extend( [ "cman", "dlm" ] )
- if self.has_gfs():
- mods_check.append("gfs")
- serv_check.extend( [ "cman", "ccsd", "rgmanager", "fenced" ] )
- if self.has_gfs():
- serv_check.extend( ["gfs", "clvmd"] )
- elif rhelver == 5:
- pkgs_check.extend ( [ "cman", "perl-Net-Telnet", "rgmanager" ] )
- mods_check.extend( [ "dlm" ] )
- if self.has_gfs():
- mods_check.extend( ["gfs", "gfs2"] )
- serv_check.extend( [ "cman", "rgmanager" ] )
- if self.has_gfs():
- serv_check.extend( ["gfs", "clvmd"] )
-
- # check that kernel module packages are installed for
- # running kernel version
-
- for modname in mods_check:
- found = 0
-
- if self.policy().allPkgsByNameRegex( "^" + modname ):
- found = 1
-
- status, output = commands.getstatusoutput('/sbin/modinfo -F vermagic ' + modname)
-
- if status == 0:
- found = 2
-
- if len(self.fileGrep("^%s\s+" % modname, "/proc/modules")) > 0:
- found = 3
-
- if found == 0:
- self.addDiagnose("required kernel module is missing: %s" % modname)
- elif found == 1:
- self.addDiagnose("required module is not available for current kernel: %s" % modname)
- elif found == 2:
- self.addDiagnose("required module is available but not loaded: %s" % modname)
-
- for pkg in pkgs_check:
- if not self.isInstalled(pkg):
- self.addDiagnose("required package is missing: %s" % pkg)
-
- if rhelver == "4":
- # (dlm, dlm-kernel) || gulm
- if not ((self.isInstalled("dlm") and self.isInstalled("dlm-kernel")) or self.isInstalled("gulm")):
- self.addDiagnose("required packages are missing: (dlm, dlm-kernel) || gulm")
-
- # check if all the needed daemons are active at sosreport time
- # check if they are started at boot time in RHEL4 RHCS (cman, ccsd, rgmanager, fenced)
- # and GFS (gfs, ccsd, clvmd, fenced)
-
- for service in serv_check:
- status, output = commands.getstatusoutput("/sbin/service %s status &> /dev/null" % service)
- if status != 0:
- self.addDiagnose("service %s is not running" % service)
-
- if not self.policy().runlevelDefault() in self.policy().runlevelByService(service):
- self.addDiagnose("service %s is not started in default runlevel" % service)
-
- # FIXME: missing important cman services
- # FIXME: any cman service whose state != run ?
- # Fence Domain: "default" 2 2 run -
-
- # is cluster quorate
- if not self.is_cluster_quorate():
- self.addDiagnose("cluster node is not quorate")
-
- # if there is no cluster.conf, diagnose() finishes here.
- try:
- os.stat("/etc/cluster/cluster.conf")
- except:
- self.addDiagnose("/etc/cluster/cluster.conf is missing")
- return
-
- # setup XML xpath context
- xml = libxml2.parseFile("/etc/cluster/cluster.conf")
- xpathContext = xml.xpathNewContext()
-
- # make sure that the node names are valid according to RFC 2181
- for hostname in xpathContext.xpathEval('/cluster/clusternodes/clusternode/@name'):
- if not re.match('^[a-zA-Z]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$', hostname.content):
- self.addDiagnose("node name (%s) contains invalid characters" % hostname.content)
-
- # do not rely on DNS to resolve node names, must have them in /etc/hosts
- for hostname in xpathContext.xpathEval('/cluster/clusternodes/clusternode/@name'):
- if len(self.fileGrep(r'^.*\W+%s' % hostname.content , "/etc/hosts")) == 0:
- self.addDiagnose("node %s is not defined in /etc/hosts" % hostname.content)
-
- # check fencing (warn on no fencing)
- if len(xpathContext.xpathEval("/cluster/clusternodes/clusternode[not(fence/method/device)]")):
- if self.has_gfs():
- self.addDiagnose("one or more nodes have no fencing agent configured: fencing is required for GFS to work")
- else:
- self.addDiagnose("one or more nodes have no fencing agent configured: the cluster infrastructure might not work as intended")
-
- # check fencing (warn on manual)
- if len(xpathContext.xpathEval("/cluster/clusternodes/clusternode[/cluster/fencedevices/fencedevice[@agent='fence_manual']/@name=fence/method/device/@name]")):
- self.addDiagnose("one or more nodes have manual fencing agent configured (data integrity is not guaranteed)")
-
- # if fence_ilo or fence_drac, make sure acpid is not running
- hostname = commands.getoutput("/bin/uname -n").split(".")[0]
- if len(xpathContext.xpathEval('/cluster/clusternodes/clusternode[@name = "%s" and /cluster/fencedevices/fencedevice[@agent="fence_rsa" or @agent="fence_drac"]/@name=fence/method/device/@name]' % hostname )):
- status, output = commands.getstatusoutput("/sbin/service acpid status")
- if status == 0 or self.policy().runlevelDefault() in self.policy().runlevelByService("acpid"):
- self.addDiagnose("acpid is enabled, this may cause problems with your fencing method.")
-
- # check for fs exported via nfs without nfsid attribute
- if len(xpathContext.xpathEval("/cluster/rm/service//fs[not(@fsid)]/nfsexport")):
- for xmlNode in xpathContext.xpathEval("/cluster/rm/service//fs[not(@fsid)]"):
- fsRefAttribute = xmlNode.xpathEval("@ref")
- if (len(fsRefAttribute) > 0) :
- fsRefName = fsRefAttribute[0].content
- if len(xpathContext.xpathEval("cluster/rm/resources/fs[@name='%s'][not(@fsid)]" % fsRefName)):
- self.addDiagnose("one or more nfs export do not have a fsid attribute set.")
- break
-
- # cluster.conf file version and the in-memory cluster configuration version matches
- status, cluster_version = commands.getstatusoutput("cman_tool status | grep 'Config version'")
- if not status: cluster_version = cluster_version[16:]
- else: cluster_version = None
- conf_version = xpathContext.xpathEval("/cluster/@config_version")[0].content
-
- if status == 0 and conf_version != cluster_version:
- self.addDiagnose("cluster.conf and in-memory configuration version differ (%s != %s)" % (conf_version, cluster_version) )
-
- status, output = commands.getstatusoutput("/usr/sbin/rg_test test /etc/cluster/cluster.conf")
- if output.find("Error: ") > 0:
- self.addDiagnose("configuration errors are present according to rg_test")
-
- # make sure the first part of the lock table matches the cluster name
- # and that the locking protocol is sane
- cluster_name = xpathContext.xpathEval("/cluster/@name")[0].content
-
- for fs in self.fileGrep(r'^[^#][/\w]*\W*[/\w]*\W*gfs', "/etc/fstab"):
- # for each gfs entry
- fs = fs.split()
- lockproto = self.get_gfs_sb_field(fs[0], "sb_lockproto")
- if lockproto and lockproto != self.get_locking_proto():
- self.addDiagnose("gfs mountpoint (%s) is using the wrong locking protocol (%s)" % (fs[0], lockproto) )
-
- locktable = self.get_gfs_sb_field(fs[0], "sb_locktable")
- try: locktable = locktable.split(":")[0]
- except: continue
- if locktable != cluster_name:
- self.addDiagnose("gfs mountpoint (%s) is using the wrong locking table" % fs[0])
-
- # Test fence groups for valid id and state
- self.test_fence_id()
-
- # Check for existence of weak-updates in gfs2 prior to 2.6.18-128
- if rhelver == 5:
- vermagic = commands.getoutput("modinfo -F vermagic gfs2")
- # just kernel release from vermagic line
- vermagic = vermagic.split()[0].lstrip('2.6.18-')
- vermagic = vermagic[:vermagic.find('.')]
- if int(vermagic) < 128:
- self.addDiagnose('GFS2 is being used via weak-updates, kmod-gfs2 should be uninstalled and system reboot' \
- 'to allow for kernel provided gfs2 module to be used.')
-
- def setup(self):
- self.collectExtOutput("/sbin/fdisk -l")
- self.addCopySpec("/etc/cluster.conf")
- self.addCopySpec("/etc/cluster.xml")
- self.addCopySpec("/etc/cluster")
- self.collectExtOutput("/usr/sbin/rg_test test /etc/cluster/cluster.conf")
- self.addCopySpec("/proc/cluster")
- self.collectExtOutput("cman_tool status")
- self.collectExtOutput("cman_tool services")
- self.collectExtOutput("cman_tool -af nodes")
- self.collectExtOutput("ccs_tool lsnode")
- self.collectExtOutput("openais-cfgtool -s")
- self.collectExtOutput("clustat")
-
- self.collectExtOutput("/sbin/ipvsadm -L")
-
- if self.getOption('gfslockdump'): self.do_gfslockdump()
- if self.getOption('lockdump'): self.do_lockdump()
-
- return
-
- def do_lockdump(self):
- status, output = commands.getstatusoutput("cman_tool services")
- if status:
- # command somehow failed
- return False
-
- rhelver = self.get_redhat_release()
-
- if rhelver == "4":
- regex = r'^DLM Lock Space:\s*"([^"]*)".*$'
- elif rhelver == "5Server" or rhelver == "5Client":
- regex = r'^dlm\s+[^\s]+\s+([^\s]+)\s.*$'
-
- reg=re.compile(regex,re.MULTILINE)
- for lockspace in reg.findall(output):
- commands.getstatusoutput("echo %s > /proc/cluster/dlm_locks" % lockspace)
- self.collectOutputNow("cat /proc/cluster/dlm_locks", root_symlink = "dlm_locks_%s" % lockspace)
-
- def get_locking_proto(self):
- # FIXME: what's the best way to find out ?
- return "lock_dlm"
- return "lock_gulm"
-
- def do_gfslockdump(self):
- for mntpoint in self.doRegexFindAll(r'^\S+\s+([^\s]+)\s+gfs\s+.*$', "/proc/mounts"):
- self.collectExtOutput("/sbin/gfs_tool lockdump %s" % mntpoint, root_symlink = "gfs_lockdump_" + self.mangleCommand(mntpoint) )
-
- def do_rgmanager_bt(self):
- # FIXME: threads backtrace via SIGALRM
- return
-
- def postproc(self):
- for cluster_conf in glob.glob("/etc/cluster/cluster.conf*"):
- self.doRegexSub(cluster_conf, r"(\s*\
-
-### 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.
-
-#############################################################
-# This plugin assumes default location of Certificate System 7.x on RHEL4
-# Certificate System 7.x is not supported on RHEL5.
-# Any improvemts for this plugin are appreciated. Please send them to
-# klamb@redhat.com
-# thanks,
-# kent lamb
-#############################################################
-
-
-import sos.plugintools
-import os
-
-class cs(sos.plugintools.PluginBase):
- """Certificate System 7.x Diagnostic Information
- """
- # check for default location of pki services (/var/lib.rhpki-*).
- # If default path exists, assume rhpki- glob and grap all installed
- # subsystems. If customer has a custom install path, then ln -s the
- # custom path to /var/lib/rhkpi-installed_subsystem (/var/lib/rhpki-ca,
- # /var/lib/rhpki-kra ect).
-
- def checkenabled(self):
- if self.isInstalled("rhpki-common") or os.path.exists("/var/lib/rhpki-*"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/var/lib/rhpki-*/conf/*cfg*")
- self.addCopySpec("/var/lib/rhpki-*/conf/*.ldif")
- self.addCopySpec("/var/lib/rhpki-*/logs/*")
- return
-
-
diff --git a/src/lib/sos/plugins/devicemapper.py b/src/lib/sos/plugins/devicemapper.py
deleted file mode 100644
index d1795352..00000000
--- a/src/lib/sos/plugins/devicemapper.py
+++ /dev/null
@@ -1,66 +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.
-
-import sos.plugintools
-import os
-from sos.helpers import sosGetCommandOutput
-
-class devicemapper(sos.plugintools.PluginBase):
- """device-mapper related information (dm, lvm, multipath)
- """
-
- optionList = [("lvmdump", 'collect raw metadata from PVs', 'slow', False)]
- dmraidOptions = ['V','b','r','s','tay','rD']
-
- def do_lvmdump(self):
- """Collects raw metadata directly from the PVs using dd
- """
- sosGetCommandOutput("lvmdump -d %s" % os.path.join(self.cInfo['dstroot'],"lvmdump"))
-
- def setup(self):
- self.collectExtOutput("/sbin/dmsetup info -c")
- self.collectExtOutput("/sbin/dmsetup table")
- self.collectExtOutput("/sbin/dmsetup status")
-
- self.collectExtOutput("/usr/sbin/vgdisplay -vv", root_symlink = "vgdisplay")
- self.collectExtOutput("/usr/sbin/vgscan -vvv")
- self.collectExtOutput("/usr/sbin/pvscan -v")
- self.collectExtOutput("/usr/sbin/lvs -a -o +devices")
- self.collectExtOutput("/usr/sbin/pvs -a -v")
- self.collectExtOutput("/usr/sbin/vgs -v")
- self.collectExtOutput("/sbin/mdadm -D /dev/md*")
-
- self.addCopySpec("/etc/lvm")
-
- self.addCopySpec("/etc/multipath.conf")
- self.addCopySpec("/var/lib/multipath/bindings")
- self.collectExtOutput("/sbin/multipath -v4 -ll")
-
- self.collectExtOutput("/usr/bin/systool -v -c -b scsi")
-
- self.collectExtOutput("/bin/ls -laR /dev")
- self.collectExtOutput("/bin/ls -laR /sys/block")
-
- if self.getOption('lvmdump'):
- self.do_lvmdump()
-
- if os.path.isdir("/sys/block"):
- for disk in os.listdir("/sys/block"):
- if disk in [ ".", ".." ] or disk.startswith("ram"):
- continue
- self.collectExtOutput("/usr/bin/udevinfo -ap /sys/block/%s" % (disk))
- for opt in self.dmraidOptions:
- self.collectExtOutput("/sbin/dmraid -%s" % (opt,))
-
- return
diff --git a/src/lib/sos/plugins/dhcp.py b/src/lib/sos/plugins/dhcp.py
deleted file mode 100644
index 872377cf..00000000
--- a/src/lib/sos/plugins/dhcp.py
+++ /dev/null
@@ -1,29 +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.
-
-import sos.plugintools
-
-class dhcp(sos.plugintools.PluginBase):
- """DHCP related information
- """
- def checkenabled(self):
- self.files = ['/etc/rc.d/init.d/dhcpd']
- self.packages = ['dhcp']
- return sos.plugintools.PluginBase.checkenabled(self)
-
- def setup(self):
- self.addCopySpec("/etc/sysconfig/dhcrelay")
- self.addCopySpec("/etc/sysconfig/dhcpd")
- self.addCopySpec("/etc/dhcpd.conf")
- return
diff --git a/src/lib/sos/plugins/dovecot.py b/src/lib/sos/plugins/dovecot.py
deleted file mode 100644
index 553ff3e1..00000000
--- a/src/lib/sos/plugins/dovecot.py
+++ /dev/null
@@ -1,26 +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.
-
-import sos.plugintools
-import os
-
-class dovecot(sos.plugintools.PluginBase):
- """dovecot server related information
- """
- def setup(self):
- if os.path.exists("/etc/dovecot.conf"):
- self.addCopySpec("/etc/dovecot*")
- self.collectExtOutput("/usr/sbin/dovecot -n")
- return
-
diff --git a/src/lib/sos/plugins/ds.py b/src/lib/sos/plugins/ds.py
deleted file mode 100644
index 6f24cb8c..00000000
--- a/src/lib/sos/plugins/ds.py
+++ /dev/null
@@ -1,50 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Kent Lamb
-
-## 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.
-
-import sos.plugintools
-import os
-
-class ds(sos.plugintools.PluginBase):
- """Directory Server information
- """
-
- def check_version(self):
- if self.isInstalled("redhat-ds-base") or \
- os.path.exists("/etc/dirsrv"):
- return "ds8"
- elif self.isInstalled("redhat-ds-7") or \
- os.path.exists("/opt/redhat-ds"):
- return "ds7"
- return False
-
- def checkenabled(self):
- if self.isInstalled("redhat-ds-base") or \
- os.path.exists("/etc/dirsrv"):
- return True
- elif self.isInstalled("redhat-ds-7") or \
- os.path.exists("/opt/redhat-ds"):
- return True
- return False
-
- def setup(self):
- if "ds8" in self.check_version():
- self.addCopySpec("/etc/dirsrv/slapd*")
- self.addCopySpec("/var/log/dirsrv/*")
- if "ds7" in self.check_version():
- self.addCopySpec("/opt/redhat-ds/slapd-*/config")
- self.addCopySpec("/opt/redhat-ds/slapd-*/logs")
- return
-
diff --git a/src/lib/sos/plugins/emc.py b/src/lib/sos/plugins/emc.py
deleted file mode 100644
index 16f039a8..00000000
--- a/src/lib/sos/plugins/emc.py
+++ /dev/null
@@ -1,218 +0,0 @@
-## emc.py
-## Captures EMC specific information during a sos run.
-
-## Copyright (C) 2008 EMC Corporation. Keith Kearnan
-
-### 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
-
-## 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.
-
-import commands, sos.plugintools, os, sys
-
-class emc(sos.plugintools.PluginBase):
- """EMC related information (PowerPath, Solutions Enabler CLI and Navisphere CLI)
- """
-
- def about_emc(self):
- """ EMC Corporation specific information
- """
- self.addCustomText('
EMC²®')
- self.addCustomText(' where information lives®
')
- self.addCustomText("EMC Corporation is the world's leading developer and provider of information ")
- self.addCustomText("infrastructure technology and solutions that enable organizations of all sizes to transform ")
- self.addCustomText("the way they compete and create value from their information. ")
- self.addCustomText("Information about EMC's products and services can be found at ")
- self.addCustomText('www.EMC.com.
')
- return
-
- def get_pp_files(self):
- """ EMC PowerPath specific information - files
- """
- self.collectExtOutput("/sbin/powermt version")
- self.addCopySpec("/etc/init.d/PowerPath")
- self.addCopySpec("/etc/powermt.custom")
- self.addCopySpec("/etc/emcp_registration")
- self.addCopySpec("/etc/emc/mpaa.excluded")
- self.addCopySpec("/etc/emc/mpaa.lams")
- self.addCopySpec("/etc/emcp_devicesDB.dat")
- self.addCopySpec("/etc/emcp_devicesDB.idx")
- self.addCopySpec("/etc/emc/powerkmd.custom")
- self.addCopySpec("/etc/modprobe.conf.pp")
- return
-
- def get_pp_config(self):
- """ EMC PowerPath specific information - commands
- """
- self.collectExtOutput("/sbin/powermt display")
- self.collectExtOutput("/sbin/powermt display dev=all")
- self.collectExtOutput("/sbin/powermt check_registration")
- self.collectExtOutput("/sbin/powermt display options")
- self.collectExtOutput("/sbin/powermt display ports")
- self.collectExtOutput("/sbin/powermt display paths")
- self.collectExtOutput("/sbin/powermt dump")
- return
-
- def get_symcli_files(self):
- """ EMC Solutions Enabler SYMCLI specific information - files
- """
- self.addCopySpec("/var/symapi/db/symapi_db.bin")
- self.addCopySpec("/var/symapi/config/[a-z]*")
- self.addCopySpec("/var/symapi/log/[a-z]*")
- return
-
- def get_symcli_config(self):
- """ EMC Solutions Enabler SYMCLI specific information - Symmetrix/DMX - commands
- """
- self.collectExtOutput("/usr/symcli/bin/symcli -def")
- self.collectExtOutput("/usr/symcli/bin/symdg list")
- self.collectExtOutput("/usr/symcli/bin/symdg -v list")
- self.collectExtOutput("/usr/symcli/bin/symcg list")
- self.collectExtOutput("/usr/symcli/bin/symcg -v list")
- self.collectExtOutput("/usr/symcli/bin/symcfg list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -v list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -db")
- self.collectExtOutput("/usr/symcli/bin/symcfg -semaphores list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -dir all -v list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -connections list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -app -v list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -fa all -port list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -ra all -port list")
- self.collectExtOutput("/usr/symcli/bin/symcfg -sa all -port list")
- self.collectExtOutput("/usr/symcli/bin/symcfg list -lock")
- self.collectExtOutput("/usr/symcli/bin/symcfg list -lockn all")
- self.collectExtOutput("/usr/symcli/bin/syminq")
- self.collectExtOutput("/usr/symcli/bin/syminq -v")
- self.collectExtOutput("/usr/symcli/bin/syminq -symmids")
- self.collectExtOutput("/usr/symcli/bin/syminq hba -fibre")
- self.collectExtOutput("/usr/symcli/bin/syminq hba -scsi")
- self.collectExtOutput("/usr/symcli/bin/symhost show -config")
- self.collectExtOutput("/usr/symcli/bin/stordaemon list")
- self.collectExtOutput("/usr/symcli/bin/stordaemon -v list")
- self.collectExtOutput("/usr/symcli/bin/sympd list")
- self.collectExtOutput("/usr/symcli/bin/sympd list -vcm")
- self.collectExtOutput("/usr/symcli/bin/symdev list")
- self.collectExtOutput("/usr/symcli/bin/symdev -v list")
- self.collectExtOutput("/usr/symcli/bin/symdev -rdfa list")
- self.collectExtOutput("/usr/symcli/bin/symdev -rdfa -v list")
- self.collectExtOutput("/usr/symcli/bin/symbcv list")
- self.collectExtOutput("/usr/symcli/bin/symbcv -v list")
- self.collectExtOutput("/usr/symcli/bin/symrdf list")
- self.collectExtOutput("/usr/symcli/bin/symrdf -v list")
- self.collectExtOutput("/usr/symcli/bin/symrdf -rdfa list")
- self.collectExtOutput("/usr/symcli/bin/symrdf -rdfa -v list")
- self.collectExtOutput("/usr/symcli/bin/symsnap list")
- self.collectExtOutput("/usr/symcli/bin/symsnap list -savedevs")
- self.collectExtOutput("/usr/symcli/bin/symclone list")
- self.collectExtOutput("/usr/symcli/bin/symevent list")
- self.collectExtOutput("/usr/symcli/bin/symmask list hba")
- self.collectExtOutput("/usr/symcli/bin/symmask list logins")
- self.collectExtOutput("/usr/symcli/bin/symmaskdb list database")
- self.collectExtOutput("/usr/symcli/bin/symmaskdb -v list database")
- return
-
- def get_navicli_config(self):
- """ EMC Navisphere Host Agent NAVICLI specific information - files
- """
- self.addCopySpec("/etc/Navisphere/agent.config")
- self.addCopySpec("/etc/Navisphere/Navimon.cfg")
- self.addCopySpec("/etc/Navisphere/Quietmode.cfg")
- self.addCopySpec("/etc/Navisphere/messages/[a-z]*")
- self.addCopySpec("/etc/Navisphere/log/[a-z]*")
- return
-
- def get_navicli_SP_info(self,SP_address):
- """ EMC Navisphere Host Agent NAVICLI specific information - CLARiiON - commands
- """
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getall" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getsptime -spa" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getsptime -spb" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getlog" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getdisk" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getcache" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getlun" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getlun -rg -type -default -owner -crus -capacity" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s lunmapinfo" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s getcrus" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s port -list -all" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s storagegroup -list" % SP_address)
- self.collectExtOutput("/opt/Navisphere/bin/navicli -h %s spportspeed -get" % SP_address)
- return
-
- def setup(self):
- ## About EMC Corporation default no if no EMC products are installed
- add_about_emc="no"
-
- ## If PowerPath is installed collect PowerPath specific information
- emc_pp_installed = commands.getoutput("/bin/rpm -qa | /bin/grep -i EMCpower")
- if emc_pp_installed != "":
- print "EMC PowerPath is installed."
- print " Gathering EMC PowerPath information..."
- self.addCustomText("EMC PowerPath is installed. ")
- self.get_pp_files()
- add_about_emc = "yes"
-
- ## If PowerPath is running collect additional PowerPath specific information
- if os.path.isdir("/proc/emcp"):
- print "EMC PowerPath is running."
- print " Gathering additional EMC PowerPath information..."
- self.get_pp_config()
-
- ## If Solutions Enabler is installed collect Symmetrix/DMX specific information
- emc_symcli_installed = commands.getoutput("/bin/rpm -qa | /bin/grep -i symcli-symcli")
- if emc_symcli_installed != "":
- print "EMC Solutions Enabler SYMCLI is installed."
- print " Gathering EMC Solutions Enabler SYMCLI information..."
- self.addCustomText("EMC Solutions Enabler is installed. ")
- self.get_symcli_files()
- self.get_symcli_config()
- add_about_emc = "yes"
-
- ## If Navisphere Host Agent is installed collect CLARiiON specific information
- if os.path.isdir("/opt/Navisphere/bin"):
- print ""
- print "The EMC CLARiiON Navisphere Host Agent is installed."
- self.addCustomText("EMC CLARiiON Navisphere Host Agent is installed. ")
- self.get_navicli_config()
- print " Gathering Navisphere NAVICLI Host Agent information..."
- print " Please enter a CLARiiON SP IP address. In order to collect"
- print " information for both SPA and SPB as well as multiple"
- print " CLARiiON arrays (if desired) you will be prompted multiple times."
- print " To exit simply press [Enter]"
- print ""
- add_about_emc = "yes"
- CLARiiON_IP_address_list = []
- CLARiiON_IP_loop = "stay_in"
- while CLARiiON_IP_loop == "stay_in":
- ans = raw_input("CLARiiON SP IP Address or [Enter] to exit: ")
- ## Check to make sure the CLARiiON SP IP address provided is valid
- status, output = commands.getstatusoutput("/opt/Navisphere/bin/navicli -h %s getsptime" % ans)
- if status == 0:
- CLARiiON_IP_address_list.append(ans)
- else:
- if ans != "":
- print "The IP address you entered, %s, is not to an active CLARiiON SP." % ans
- if ans == "":
- CLARiiON_IP_loop = "get_out"
- ## Sort and dedup the list of CLARiiON IP Addresses
- CLARiiON_IP_address_list.sort()
- for SP_address in CLARiiON_IP_address_list:
- if CLARiiON_IP_address_list.count(SP_address) > 1:
- CLARiiON_IP_address_list.remove(SP_address)
- for SP_address in CLARiiON_IP_address_list:
- if SP_address != "":
- print " Gathering NAVICLI information for %s..." % SP_address
- self.get_navicli_SP_info(SP_address)
-
- ## Only provide About EMC if EMC products are installed
- if add_about_emc != "no":
- self.about_emc()
- return
diff --git a/src/lib/sos/plugins/filesys.py b/src/lib/sos/plugins/filesys.py
deleted file mode 100644
index 79a34c59..00000000
--- a/src/lib/sos/plugins/filesys.py
+++ /dev/null
@@ -1,60 +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.
-
-import sos.plugintools
-import os
-import re
-import commands
-
-class filesys(sos.plugintools.PluginBase):
- """information on filesystems
- """
- def setup(self):
- self.addCopySpec("/proc/filesystems")
- self.addCopySpec("/etc/fstab")
- self.addCopySpec("/proc/self/mounts")
- self.addCopySpec("/proc/mounts")
- self.addCopySpec("/proc/mdstat")
- self.addCopySpec("/etc/raidtab")
- mounts = self.collectOutputNow("/bin/mount -l", root_symlink = "mount")
- self.addCopySpec("/etc/mdadm.conf")
-
- self.collectExtOutput("/bin/df -al", root_symlink = "df")
- self.collectExtOutput("/usr/sbin/lsof -b +M -n -l", root_symlink = "lsof")
- self.collectExtOutput("/sbin/blkid")
-
- part_titlep = re.compile("^major")
- blankp = re.compile("^$")
- partlist = []
- devlist = []
- try:
- for line in open('/proc/partitions'):
- if((bool(part_titlep.match(line))) | (bool(blankp.match(line)))):
- continue
- partlist.append('/dev/' + line.split()[-1])
- except IOError:
- exit(1)
- for dev in partlist:
- hdparm = commands.getstatusoutput('/sbin/hdparm -g %s' %(dev))
- if(hdparm[0] == 0):
- start_geo = hdparm[1].strip().split("\n")[-1].strip().split()[-1]
- if(start_geo == "0"):
- devlist.append(dev)
- for i in devlist:
- self.collectExtOutput("/sbin/parted -s %s print" % (i))
-
- for extfs in self.doRegexFindAll(r"^(/dev/.+) on .+ type ext.\s+", mounts):
- self.collectExtOutput("/sbin/dumpe2fs %s" % (extfs))
- return
-
diff --git a/src/lib/sos/plugins/ftp.py b/src/lib/sos/plugins/ftp.py
deleted file mode 100644
index 5bed5667..00000000
--- a/src/lib/sos/plugins/ftp.py
+++ /dev/null
@@ -1,30 +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.
-
-import sos.plugintools
-import os
-
-class ftp(sos.plugintools.PluginBase):
- """FTP server related information
- """
- def checkenabled(self):
- if self.isInstalled("vsftpd") or os.path.exists("/etc/vsftpd"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/ftp*")
- self.addCopySpec("/etc/vsftpd")
- return
-
diff --git a/src/lib/sos/plugins/gdm.py b/src/lib/sos/plugins/gdm.py
deleted file mode 100644
index bf75ea33..00000000
--- a/src/lib/sos/plugins/gdm.py
+++ /dev/null
@@ -1,22 +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.
-
-import sos.plugintools
-
-class gdm(sos.plugintools.PluginBase):
- """gdm related information
- """
- def setup(self):
- self.addCopySpec("/etc/gdm/*")
- return
diff --git a/src/lib/sos/plugins/general.py b/src/lib/sos/plugins/general.py
deleted file mode 100644
index 2f6a8e7b..00000000
--- a/src/lib/sos/plugins/general.py
+++ /dev/null
@@ -1,59 +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.
-
-import os
-import sos.plugintools
-import glob
-import commands
-
-class general(sos.plugintools.PluginBase):
- """basic system information
- """
-
- optionList = [("syslogsize", "max size (MiB) to collect per syslog file", "", 15),
- ("all_logs", "collect all log files defined in syslog.conf", "", False)]
-
- def setup(self):
- self.addCopySpec("/etc/redhat-release")
- self.addCopySpec("/etc/fedora-release")
- self.addCopySpec("/etc/inittab")
- self.addCopySpec("/etc/sos.conf")
- self.addCopySpec("/etc/sysconfig")
- self.addCopySpec("/proc/stat")
- # Capture dmesg from system start
- self.addCopySpec("/var/log/dmesg")
- # Capture second dmesg from time of sos run
- self.collectExtOutput("/bin/dmesg", suggest_filename="dmesg_now")
- self.addCopySpecLimit("/var/log/messages*", sizelimit = self.getOption("syslogsize"))
- self.addCopySpecLimit("/var/log/secure*", sizelimit = self.getOption("syslogsize"))
- self.addCopySpec("/var/log/sa")
- self.addCopySpec("/var/log/pm/suspend.log")
- self.addCopySpec("/var/log/up2date")
- self.addCopySpec("/etc/exports")
- self.collectExtOutput("/bin/hostname", root_symlink = "hostname")
- self.collectExtOutput("/bin/date", root_symlink = "date")
- self.collectExtOutput("/usr/bin/uptime", root_symlink = "uptime")
-
- if self.getOption('all_logs'):
- rhelver = self.policy().rhelVersion()
- if rhelver == 5 or rhelver == 4:
- logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/syslog.conf")
- for i in logs:
- if not os.path.isfile(i): continue
- self.addCopySpec(i)
- return
-
- def postproc(self):
- self.doRegexSub("/etc/sysconfig/rhn/up2date", r"(\s*proxyPassword\s*=\s*)\S+", r"\1***")
- return
diff --git a/src/lib/sos/plugins/hardware.py b/src/lib/sos/plugins/hardware.py
deleted file mode 100644
index 7b99e063..00000000
--- a/src/lib/sos/plugins/hardware.py
+++ /dev/null
@@ -1,52 +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.
-
-import sos.plugintools
-
-class hardware(sos.plugintools.PluginBase):
- """hardware related information
- """
- def setup(self):
- self.addCopySpec("/proc/partitions")
- self.addCopySpec("/proc/cpuinfo")
- self.addCopySpec("/proc/meminfo")
- self.addCopySpec("/proc/ioports")
- self.addCopySpec("/proc/interrupts")
- self.addCopySpec("/proc/scsi")
- self.addCopySpec("/proc/dma")
- self.addCopySpec("/proc/devices")
- self.addCopySpec("/proc/rtc")
- self.addCopySpec("/proc/ide")
- self.addCopySpec("/proc/bus")
- self.addCopySpec("/etc/stinit.def")
- self.addCopySpec("/etc/sysconfig/hwconf")
- self.addCopySpec("/proc/chandev")
- self.addCopySpec("/proc/dasd")
- self.addCopySpec("/proc/s390dbf/tape")
- self.addCopySpec("/sys/bus/scsi")
- self.addCopySpec("/sys/state")
- self.collectExtOutput("/usr/share/rhn/up2date_client/hardware.py")
- self.collectExtOutput("""/bin/echo -e "lspci:\n" ; /sbin/lspci ; /bin/echo -e "\nlspci -nvv:\n" ; /sbin/lspci -nvv ; /bin/echo -e "\nlspci -tv:\n" ; /sbin/lspci -tv""", suggest_filename = "lspci", root_symlink = "lspci")
-
- self.collectExtOutput("/usr/sbin/dmidecode", root_symlink = "dmidecode")
-
- if self.policy().getArch().endswith("386"):
- self.collectExtOutput("/usr/sbin/x86info -a")
-
- self.collectExtOutput("/sbin/lsusb")
- self.collectExtOutput("/usr/bin/lshal")
- self.collectExtOutput("/usr/bin/systool -c fc_host -v")
- self.collectExtOutput("/usr/bin/systool -c scsi_host -v")
- return
-
diff --git a/src/lib/sos/plugins/hts.py b/src/lib/sos/plugins/hts.py
deleted file mode 100644
index 4d5cf652..00000000
--- a/src/lib/sos/plugins/hts.py
+++ /dev/null
@@ -1,23 +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.
-
-import sos.plugintools
-
-class hts(sos.plugintools.PluginBase):
- """Red Hat Hardware Test Suite related information
- """
- def setup(self):
- self.addCopySpec("/etc/httpd/conf.d/hts.conf")
- self.addCopySpec("/var/hts")
- return
diff --git a/src/lib/sos/plugins/i18n.py b/src/lib/sos/plugins/i18n.py
deleted file mode 100644
index 0a793d0f..00000000
--- a/src/lib/sos/plugins/i18n.py
+++ /dev/null
@@ -1,26 +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.
-
-import sos.plugintools
-import os
-
-class i18n(sos.plugintools.PluginBase):
- """i18n related information
- """
- def setup(self):
- self.addCopySpec("/etc/sysconfig/i18n")
- self.addCopySpec("/etc/X11/xinit/xinput.d/*")
- self.collectExtOutput("/usr/bin/locale")
- return
-
diff --git a/src/lib/sos/plugins/initrd.py b/src/lib/sos/plugins/initrd.py
deleted file mode 100644
index 7bd7e1f3..00000000
--- a/src/lib/sos/plugins/initrd.py
+++ /dev/null
@@ -1,28 +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.
-
-import sos.plugintools
-import glob
-
-class initrd(sos.plugintools.PluginBase):
- """initrd related information
- """
- def setup(self):
- for initrd in glob.glob('/boot/initrd-*.img'):
- self.collectExtOutput("/bin/zcat "+initrd+" | /bin/cpio "+
- "--extract --to-stdout init" )
- return
-
- def defaultenabled(self):
- return False
diff --git a/src/lib/sos/plugins/ipa.py b/src/lib/sos/plugins/ipa.py
deleted file mode 100644
index 2c6ca9b6..00000000
--- a/src/lib/sos/plugins/ipa.py
+++ /dev/null
@@ -1,37 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Kent Lamb
-
-## 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.
-
-import sos.plugintools
-import os
-
-class ipa(sos.plugintools.PluginBase):
- """IPA diagnostic information
- """
- # ntp and dirserver stuff are covered in existing sos plugins, so we really only
- # need to get kerberos and ipa specific addons.
-
- def checkenabled(self):
- if self.isInstalled("ipa-server") or os.path.exists("/etc/ipa"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/dirsrv/ds.keytab")
- self.addCopySpec("/etc/ipa/ipa.conf")
- self.addCopySpec("/etc/krb5.conf")
- self.addCopySpec("/etc/krb5.keytab")
- return
-
diff --git a/src/lib/sos/plugins/ipsec.py b/src/lib/sos/plugins/ipsec.py
deleted file mode 100644
index 87671b87..00000000
--- a/src/lib/sos/plugins/ipsec.py
+++ /dev/null
@@ -1,30 +0,0 @@
-## Copyright (C) 2007 Sadique Puthen
-
-### 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.
-
-import sos.plugintools
-from os.path import exists
-
-class ipsec(sos.plugintools.PluginBase):
- """ipsec related information
- """
- def checkenabled(self):
- if self.isInstalled("ipsec-tools") or exists("/etc/racoon/racoon.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/racoon")
- return
diff --git a/src/lib/sos/plugins/iscsi.py b/src/lib/sos/plugins/iscsi.py
deleted file mode 100644
index 1b4ce67d..00000000
--- a/src/lib/sos/plugins/iscsi.py
+++ /dev/null
@@ -1,24 +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.
-
-import sos.plugintools
-
-class iscsi(sos.plugintools.PluginBase):
- """iscsi-initiator related information
- """
- def setup(self):
- self.addCopySpec("/etc/iscsi/iscsid.conf")
- self.addCopySpec("/etc/iscsi/initiatorname.iscsi")
- self.addCopySpec("/var/lib/iscsi")
- return
diff --git a/src/lib/sos/plugins/kdump.py b/src/lib/sos/plugins/kdump.py
deleted file mode 100644
index d9f248a4..00000000
--- a/src/lib/sos/plugins/kdump.py
+++ /dev/null
@@ -1,31 +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.
-
-import sos.plugintools
-from os.path import exists
-
-class kdump(sos.plugintools.PluginBase):
- """Kdump related information
- """
- def checkenabled(self):
- if self.isInstalled("kexec-tools") or exists("/etc/kdump.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/kdump.conf")
- self.addCopySpec("/etc/sysconfig/kdump")
- self.addCopySpec("/proc/cmdline")
- self.addCopySpec("/etc/udev/rules.d/*kexec.rules")
- return
diff --git a/src/lib/sos/plugins/kernel.py b/src/lib/sos/plugins/kernel.py
deleted file mode 100644
index 3e928244..00000000
--- a/src/lib/sos/plugins/kernel.py
+++ /dev/null
@@ -1,116 +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.
-
-import sos.plugintools
-import commands, os, re
-
-class kernel(sos.plugintools.PluginBase):
- """kernel related information
- """
- optionList = [("modinfo", 'gathers information on all kernel modules', 'fast', True)]
- moduleFile = ""
- taintList = [
- {'regex':'mvfs*', 'description':'Clearcase module'},
- {'regex':'vnode*', 'description':'Clearcase module'},
- {'regex':'vxfs*', 'description':'Veritas file system module'},
- {'regex':'vxportal*', 'description':'Veritas module'},
- {'regex':'vxdmp*', 'description':'Veritas dynamic multipathing module'},
- {'regex':'vxio*', 'description':'Veritas module'},
- {'regex':'vxspec*', 'description':'Veritas module'},
- {'regex':'dcd*', 'description':'Dell OpenManage Server Administrator module'},
- {'regex':'ocfs', 'description':'Oracle cluster filesystem module'},
- {'regex':'oracle*', 'description':'Oracle module'},
- {'regex':'vmnet*', 'description':'VMware module'},
- {'regex':'vmmon*', 'description':'VMware module'},
- {'regex':'egenera*', 'description':'Egenera module'},
- {'regex':'emcp*', 'description':'EMC module'},
- {'regex':'ocfs*', 'description':'OCFS module'},
- {'regex':'nvidia', 'description':'NVidia module'},
- {'regex':'ati-', 'description':'ATI module'}
- ]
-
- def setup(self):
- self.collectExtOutput("/bin/uname -a", root_symlink = "uname")
- self.moduleFile = self.collectOutputNow("/sbin/lsmod", root_symlink = "lsmod")
-
- if self.getOption('modinfo'):
- runcmd = ""
- for kmod in commands.getoutput('/sbin/lsmod | /bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null').split('\n'):
- if '' != kmod.strip():
- runcmd = runcmd + " " + kmod
- if len(runcmd):
- self.collectExtOutput("/sbin/modinfo " + runcmd)
-
- self.collectExtOutput("/sbin/sysctl -a")
- self.collectExtOutput("/sbin/ksyms")
- self.addCopySpec("/sys/module/*/parameters")
- self.addCopySpec("/proc/filesystems")
- self.addCopySpec("/proc/ksyms")
- self.addCopySpec("/proc/slabinfo")
- self.addCopySpec("/lib/modules/%s/modules.dep" % self.policy().kernelVersion())
- self.addCopySpec("/etc/conf.modules")
- self.addCopySpec("/etc/modules.conf")
- self.addCopySpec("/etc/modprobe.conf")
- self.collectExtOutput("/usr/sbin/dkms status")
- self.addCopySpec("/proc/cmdline")
- self.addCopySpec("/proc/driver")
- self.addCopySpec("/proc/zoneinfo")
- self.addCopySpec("/proc/sys/kernel/tainted")
- self.addCopySpec("/proc/buddyinfo")
-
- return
-
- def diagnose(self):
-
- infd = open("/proc/modules", "r")
- for modname in infd.readlines():
- modname=modname.split(" ")[0]
- modinfo_srcver = commands.getoutput("/sbin/modinfo -F srcversion %s" % modname)
- if not os.access("/sys/module/%s/srcversion" % modname, os.R_OK):
- continue
- infd = open("/sys/module/%s/srcversion" % modname, "r")
- sys_srcver = infd.read().strip("\n")
- infd.close()
- if modinfo_srcver != sys_srcver:
- self.addDiagnose("loaded module %s differs from the one present on the file-system" % modname)
-
- # this would be a good moment to check the module's signature
- # but at the moment there's no easy way to do that outside of
- # the kernel. i will probably need to write a C lib (derived from
- # the kernel sources to do this verification.
-
- infd.close()
-
- def analyze(self):
-
- savedtaint = os.path.join(self.cInfo['dstroot'], "/proc/sys/kernel/tainted")
- infd = open(savedtaint, "r")
- line = infd.read()
- infd.close()
- line = line.strip()
- if (line != "0"):
- self.addAlert("Kernel taint flag is <%s>\n" % line)
-
- infd = open(self.moduleFile, "r")
- modules = infd.readlines()
- infd.close()
-
- for tainter in self.taintList:
- p = re.compile(tainter['regex'])
- for line in modules:
- if p.match(line) != None:
- # found a taint match, create an alert
- moduleName = line.split()[0]
- self.addAlert("Check for tainted kernel by module %s, which is %s" % (moduleName, tainter['description']))
- return
diff --git a/src/lib/sos/plugins/kvm.py b/src/lib/sos/plugins/kvm.py
deleted file mode 100644
index 6e737166..00000000
--- a/src/lib/sos/plugins/kvm.py
+++ /dev/null
@@ -1,48 +0,0 @@
-## Copyright (C) 2009 Red Hat, Inc., Joey Boggs
-
-### 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.
-
-
-import sos.plugintools
-import os
-
-class kvm(sos.plugintools.PluginBase):
- """KVM related information
- """
-
- def checkenabled(self):
- if os.access("/sys/module/kvm", os.R_OK):
- return True
- return False
-
- def setup(self):
- if not os.path.ismount("/sys/kernel/debug"):
- self._debugfs_cleanup = True
- os.popen("mount -t debugfs debugfs /sys/kernel/debug")
- else:
- self._debugfs_cleanup = False
- self.addCopySpec("/sys/module/kvm/srcversion")
- self.addCopySpec("/sys/module/kvm_intel/srcversion")
- self.addCopySpec("/sys/module/kvm_amd/srcversion")
- self.addCopySpec("/sys/module/ksm/srcversion")
- self.collectExtOutput("/usr/bin/top -b -d 1 -n 5")
- self.collectExtOutput("/usr/bin/kvm_stat --once")
- return
-
- def postproc(self):
- if self._debugfs_cleanup and os.path.ismount("/sys/kernel/debug"):
- os.popen("umount /sys/kernel/debug")
- return
-
diff --git a/src/lib/sos/plugins/ldap.py b/src/lib/sos/plugins/ldap.py
deleted file mode 100644
index b1a48420..00000000
--- a/src/lib/sos/plugins/ldap.py
+++ /dev/null
@@ -1,50 +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.
-
-import sos.plugintools
-import os
-
-class ldap(sos.plugintools.PluginBase):
- """LDAP related information
- """
- def checkenabled(self):
- self.packages = [ "openldap" ]
- self.files = [ "/etc/openldap/ldap.conf" ]
- return sos.plugintools.PluginBase.checkenabled(self)
-
- def get_ldap_opts(self):
- # capture /etc/openldap/ldap.conf options in dict
- # FIXME: possibly not hardcode these options in?
- ldapopts=["URI","BASE","TLS_CACERTDIR"]
- results={}
- tmplist=[]
- for i in ldapopts:
- t=self.doRegexFindAll(r"^(%s)\s+(.*)" % i,"/etc/openldap/ldap.conf")
- for x in t:
- results[x[0]]=x[1].rstrip("\n")
- return results
-
- def diagnose(self):
- # Validate ldap client options
- ldapopts=self.get_ldap_opts()
- if ldapopts.has_key("TLS_CACERTDIR") and not os.path.exists(ldapopts["TLS_CACERTDIR"]):
- self.addDiagnose("%s does not exist and can cause connection issues involving TLS" % ldapopts["TLS_CACERTDIR"])
-
- def setup(self):
- self.addCopySpec("/etc/ldap.conf")
- self.addCopySpec("/etc/openldap")
-
- def postproc(self):
- self.doRegexSub("/etc/ldap.conf", r"(\s*bindpw\s*)\S+", r"\1***")
- return
diff --git a/src/lib/sos/plugins/libraries.py b/src/lib/sos/plugins/libraries.py
deleted file mode 100644
index 80108869..00000000
--- a/src/lib/sos/plugins/libraries.py
+++ /dev/null
@@ -1,26 +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.
-
-import sos.plugintools
-
-class libraries(sos.plugintools.PluginBase):
- """information on shared libraries
- """
- def setup(self):
- self.addCopySpec("/etc/ld.so.conf")
- self.addCopySpec("/etc/ld.so.conf.d")
- self.collectExtOutput("/sbin/ldconfig -v")
- self.collectExtOutput("/sbin/ldconfig -p")
- return
-
diff --git a/src/lib/sos/plugins/logrotate.py b/src/lib/sos/plugins/logrotate.py
deleted file mode 100644
index f3195d0e..00000000
--- a/src/lib/sos/plugins/logrotate.py
+++ /dev/null
@@ -1,27 +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.
-
-import sos.plugintools
-
-class logrotate(sos.plugintools.PluginBase):
- """logrotate configuration files and debug info
- """
-
- def setup(self):
- self.collectExtOutput("/usr/sbin/logrotate --debug /etc/logrotate.conf",
- suggest_filename = "logrotate_debug")
- self.collectExtOutput("/bin/cat /var/lib/logrotate.status",
- suggest_filename = "logrotate_status")
- self.addCopySpec("/etc/logrotate*")
- return
diff --git a/src/lib/sos/plugins/lsbrelease.py b/src/lib/sos/plugins/lsbrelease.py
deleted file mode 100644
index 78a83577..00000000
--- a/src/lib/sos/plugins/lsbrelease.py
+++ /dev/null
@@ -1,30 +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.
-
-
-import sos.plugintools
-import os
-
-class lsbrelease(sos.plugintools.PluginBase):
- """Linux Standard Base information
- """
- def diagnose(self):
- if not os.path.exists("/etc/redhat-release"):
- self.addDiagnose("/etc/redhat-release missing")
- return
- def setup(self):
- self.collectExtOutput("/usr/bin/lsb_release -a")
- self.collectExtOutput("/usr/bin/lsb_release -d", suggest_filename = "lsb_release", root_symlink = "lsb-release")
- self.addCopySpec("/etc/lsb-release*")
- return
diff --git a/src/lib/sos/plugins/memory.py b/src/lib/sos/plugins/memory.py
deleted file mode 100644
index 7fbe39c3..00000000
--- a/src/lib/sos/plugins/memory.py
+++ /dev/null
@@ -1,30 +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.
-
-import sos.plugintools
-
-class memory(sos.plugintools.PluginBase):
- """memory usage information
- """
- def setup(self):
- self.addCopySpec("/proc/pci")
- self.addCopySpec("/proc/meminfo")
- self.addCopySpec("/proc/vmstat")
- self.addCopySpec("/proc/slabinfo")
-
- self.collectExtOutput("/bin/dmesg | grep -e 'e820.' -e 'aperature.'")
- self.collectExtOutput("/usr/bin/free", root_symlink = "free")
- self.collectExtOutput("/usr/bin/free -m")
- return
-
diff --git a/src/lib/sos/plugins/mrggrid.py b/src/lib/sos/plugins/mrggrid.py
deleted file mode 100644
index 2b39ab17..00000000
--- a/src/lib/sos/plugins/mrggrid.py
+++ /dev/null
@@ -1,23 +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.
-
-import sos.plugintools
-
-class mrggrid(sos.plugintools.PluginBase):
- """MRG GRID related information
- """
- def setup(self):
- self.addCopySpec("/etc/condor/condor_config")
- self.addCopySpec("/usr/bin/condor_status")
- return
diff --git a/src/lib/sos/plugins/mrgmessg.py b/src/lib/sos/plugins/mrgmessg.py
deleted file mode 100644
index 481083ad..00000000
--- a/src/lib/sos/plugins/mrgmessg.py
+++ /dev/null
@@ -1,24 +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.
-
-import sos.plugintools
-
-class mrgmessg(sos.plugintools.PluginBase):
- """MRG Messaging related information
- """
- def setup(self):
- self.addCopySpec("/etc/qpidd.conf")
- self.addCopySpec("/etc/sasl2/qpidd.conf")
- self.addCopySpec("/var/rhm")
- return
diff --git a/src/lib/sos/plugins/mysql.py b/src/lib/sos/plugins/mysql.py
deleted file mode 100644
index 3f8dc2bd..00000000
--- a/src/lib/sos/plugins/mysql.py
+++ /dev/null
@@ -1,32 +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.
-
-import sos.plugintools
-import os
-
-class mysql(sos.plugintools.PluginBase):
- """MySQL related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("mysql-server") or os.path.exists("/etc/my.cnf") or \
- self.cInfo["policy"].pkgByName("mysql"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/my.cnf")
- self.addCopySpec("/etc/sysconfig/network")
- self.addCopySpec("/etc/ld.so.conf.d/mysql*")
- self.addCopySpec("/var/log/mysql*")
- return
diff --git a/src/lib/sos/plugins/named.py b/src/lib/sos/plugins/named.py
deleted file mode 100644
index 1dddb8b7..00000000
--- a/src/lib/sos/plugins/named.py
+++ /dev/null
@@ -1,44 +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.
-
-import sos.plugintools
-import commands
-from os.path import normpath, join, exists
-
-class named(sos.plugintools.PluginBase):
- """named related information
- """
- def checkenabled(self):
- self.files = [ "/etc/named.conf",
- "/etc/sysconfig/named" ]
- self.packages = [ "bind" ]
- return sos.plugintools.PluginBase.checkenabled(self)
-
- def getDnsDir(self, configFile):
- """ grab directory path from named{conf,boot}
- """
- directoryList = self.doRegexFindAll("directory\s\"(.*)\"", configFile)
- return normpath(directoryList[0])
-
- def setup(self):
- cfgFiles = ("/etc/named.conf",
- "/etc/named.boot")
- for cfg in cfgFiles:
- if exists(cfg):
- self.addCopySpec(cfg)
- self.addCopySpec(self.getDnsDir(cfg))
- self.addForbiddenPath(join(self.getDnsDir(cfg),"chroot/dev"))
- self.addForbiddenPath(join(self.getDnsDir(cfg),"chroot/proc"))
- self.addCopySpec("/etc/sysconfig/named")
- return
diff --git a/src/lib/sos/plugins/netdump.py b/src/lib/sos/plugins/netdump.py
deleted file mode 100644
index d57431b8..00000000
--- a/src/lib/sos/plugins/netdump.py
+++ /dev/null
@@ -1,28 +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.
-
-import sos.plugintools
-from os.path import exists
-
-class netdump(sos.plugintools.PluginBase):
- """Netdump Configuration Information
- """
- def checkenabled(self):
- if self.isInstalled("netdump") or exists("/etc/sysconfig/netdump*"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/sysconfig/netdump")
- return
diff --git a/src/lib/sos/plugins/networking.py b/src/lib/sos/plugins/networking.py
deleted file mode 100644
index e3d6f98a..00000000
--- a/src/lib/sos/plugins/networking.py
+++ /dev/null
@@ -1,78 +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.
-
-import sos.plugintools
-import os,re,commands
-
-class networking(sos.plugintools.PluginBase):
- """network related information
- """
- optionList = [("traceroute", "collects a traceroute to rhn.redhat.com", "slow", False)]
-
- def get_interface_name(self,ifconfigFile):
- """Return a dictionary for which key are interface name according to the
- output of ifconifg-a stored in ifconfigFile.
- """
- out=self.doRegexFindAll(r"^(eth\d+)\D", ifconfigFile)
- return out
-
- def collectIPTable(self,tablename):
- """ When running the iptables command, it unfortunately auto-loads
- the modules before trying to get output. Some people explicitly
- don't want this, so check if the modules are loaded before running
- the command. If they aren't loaded, there can't possibly be any
- relevant rules in that table """
-
- cmd = "/sbin/iptables -t "+tablename+" -nvL"
-
- (status, output) = commands.getstatusoutput("/sbin/lsmod | grep -q "+tablename)
- if status == 0:
- self.collectExtOutput(cmd)
- else:
- self.writeTextToCommand(cmd,"IPTables module "+tablename+" not loaded\n")
-
- def setup(self):
- self.addCopySpec("/proc/net")
- self.addCopySpec("/etc/nsswitch.conf")
- self.addCopySpec("/etc/yp.conf")
- self.addCopySpec("/etc/inetd.conf")
- self.addCopySpec("/etc/xinetd.conf")
- self.addCopySpec("/etc/xinetd.d")
- self.addCopySpec("/etc/host*")
- self.addCopySpec("/etc/resolv.conf")
- ifconfigFile=self.collectOutputNow("/sbin/ifconfig -a", root_symlink = "ifconfig")
- self.collectExtOutput("/sbin/route -n", root_symlink = "route")
- self.collectIPTable("filter")
- self.collectIPTable("nat")
- self.collectIPTable("mangle")
- self.collectExtOutput("/bin/netstat -s")
- self.collectExtOutput("/bin/netstat -agn")
- self.collectExtOutput("/bin/netstat -neopa", root_symlink = "netstat")
- self.collectExtOutput("/sbin/ip route show table all")
- self.collectExtOutput("/sbin/ip link")
- self.collectExtOutput("/sbin/ip address")
- self.collectExtOutput("/sbin/ifenslave -a")
- self.collectExtOutput("/sbin/ip mroute show")
- self.collectExtOutput("/sbin/ip maddr show")
- if ifconfigFile:
- for eth in self.get_interface_name(ifconfigFile):
- self.collectExtOutput("/sbin/ethtool "+eth)
- self.collectExtOutput("/sbin/ethtool -i "+eth)
- self.collectExtOutput("/sbin/ethtool -k "+eth)
- self.collectExtOutput("/sbin/ethtool -S "+eth)
- if self.getOption("traceroute"):
- self.collectExtOutput("/bin/traceroute -n rhn.redhat.com")
-
- return
-
diff --git a/src/lib/sos/plugins/nfsserver.py b/src/lib/sos/plugins/nfsserver.py
deleted file mode 100644
index 53391463..00000000
--- a/src/lib/sos/plugins/nfsserver.py
+++ /dev/null
@@ -1,44 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Eugene Teo
-
-### 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.
-
-import sos.plugintools
-import os
-from stat import ST_SIZE
-
-class nfsserver(sos.plugintools.PluginBase):
- """NFS server-related information
- """
- def checkenabled(self):
- if self.policy().runlevelDefault() in self.policy().runlevelByService("nfs"):
- 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
-
- return False
-
- def setup(self):
- self.addCopySpec("/etc/exports")
- self.addCopySpec("/var/lib/nfs/etab")
- self.addCopySpec("/var/lib/nfs/xtab")
- self.addCopySpec("/var/lib/nfs/rmtab")
- self.collectExtOutput("/usr/sbin/rpcinfo -p localhost")
- self.collectExtOutput("/usr/sbin/nfsstat -a")
- return
-
diff --git a/src/lib/sos/plugins/nscd.py b/src/lib/sos/plugins/nscd.py
deleted file mode 100644
index c79afe73..00000000
--- a/src/lib/sos/plugins/nscd.py
+++ /dev/null
@@ -1,43 +0,0 @@
-## Copyright (C) 2007 Shijoe George
-
-### 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.
-
-import sos.plugintools
-from os.path import exists
-
-class nscd(sos.plugintools.PluginBase):
- """NSCD related information
- """
-
- optionList = [("nscdlogsize", "max size (MiB) to collect per nscd log file",
- "", 50)]
-
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("nscd") or exists("/etc/nscd.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/nscd.conf")
-
- opt = self.fileGrep(r"^\s*logfile", "/etc/nscd.conf")
- if (len(opt) > 0):
- for o in opt:
- f = o.split()
- self.addCopySpecLimit(f[1],
- sizelimit = self.isOptionEnabled("nscdlogsize"))
-
- return
-
diff --git a/src/lib/sos/plugins/ntp.py b/src/lib/sos/plugins/ntp.py
deleted file mode 100644
index 76be368b..00000000
--- a/src/lib/sos/plugins/ntp.py
+++ /dev/null
@@ -1,23 +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.
-
-import sos.plugintools
-
-class ntp(sos.plugintools.PluginBase):
- """NTP related information
- """
- def setup(self):
- self.collectExtOutput("/usr/bin/ntpstat")
- self.collectExtOutput("/usr/sbin/ntptrace")
- return
diff --git a/src/lib/sos/plugins/oddjob.py b/src/lib/sos/plugins/oddjob.py
deleted file mode 100644
index 13e3049a..00000000
--- a/src/lib/sos/plugins/oddjob.py
+++ /dev/null
@@ -1,31 +0,0 @@
-## Copyright (C) 2007 Sadique Puthen
-
-### 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.
-
-import sos.plugintools
-import os
-
-class oddjob(sos.plugintools.PluginBase):
- """oddjob related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("oddjob") or os.path.exists("/etc/oddjobd.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/oddjobd.conf")
- self.addCopySpec("/etc/oddjobd.conf.d")
- self.addCopySpec("/etc/dbus-1/system.d/oddjob.conf")
diff --git a/src/lib/sos/plugins/openais.py b/src/lib/sos/plugins/openais.py
deleted file mode 100644
index 140572a2..00000000
--- a/src/lib/sos/plugins/openais.py
+++ /dev/null
@@ -1,39 +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.
-
-import sos.plugintools
-import os
-
-class openais(sos.plugintools.PluginBase):
- """openais related information
- """
- def checkenabled(self):
- if self.isInstalled("openais") or os.path.exists("/usr/sbin/openais-confdb-display"):
- openais_ver = commands.getoutput("rpm -q --queryformat='%{VERSION}' openais")
- v, r, m = openais_ver.split('.')
- if int(r) >= 80 and int(m) >= 6:
- return True
- return False
-
- openais_config_opts = [('totem','token'), ('totem','consensus'),
- ('totem','token_retransmits_before_loss_const'),
- ('cman','quorum_dev_poll'), ('cman','expected_votes'),
- ('cman','two_node')]
-
- def setup(self):
- self.collectExtOutput("openais-confdb-display")
- for item in self.openais_config_opts:
- obj, opt = item
- self.collectExtOutput("openais-confdb-display %s %s" % (obj, opt))
- return
diff --git a/src/lib/sos/plugins/openssl.py b/src/lib/sos/plugins/openssl.py
deleted file mode 100644
index 6d799904..00000000
--- a/src/lib/sos/plugins/openssl.py
+++ /dev/null
@@ -1,29 +0,0 @@
-## Copyright (C) 2007 Sadique Puthen
-
-### 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.
-
-import sos.plugintools
-import os
-
-class openssl(sos.plugintools.PluginBase):
- """openssl related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("openssl") or os.path.exists("/etc/pki/tls/openssl.cnf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/pki/tls/openssl.cnf")
diff --git a/src/lib/sos/plugins/openswan.py b/src/lib/sos/plugins/openswan.py
deleted file mode 100644
index 4c119807..00000000
--- a/src/lib/sos/plugins/openswan.py
+++ /dev/null
@@ -1,32 +0,0 @@
-## Copyright (C) 2007 Sadique Puthen
-
-### 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.
-
-import sos.plugintools
-import os
-
-class openswan(sos.plugintools.PluginBase):
- """ipsec related information
- """
- def checkenabled(self):
- if self.isInstalled("openswan") or os.path.exists("/etc/ipsec.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/ipsec.conf")
- self.addCopySpec("/etc/ipsec.d")
- self.collectExtOutput("/usr/sbin/ipsec verify")
- self.collectExtOutput("/usr/sbin/ipsec barf")
diff --git a/src/lib/sos/plugins/pam.py b/src/lib/sos/plugins/pam.py
deleted file mode 100644
index 1a50811b..00000000
--- a/src/lib/sos/plugins/pam.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.
-
-import sos.plugintools
-
-class pam(sos.plugintools.PluginBase):
- """PAM related information
- """
- def setup(self):
- self.addCopySpec("/etc/pam.d")
- self.addCopySpec("/etc/security")
- self.collectExtOutput("/bin/ls -laF /lib/security")
- return
-
diff --git a/src/lib/sos/plugins/postfix.py b/src/lib/sos/plugins/postfix.py
deleted file mode 100644
index 9ab78b2a..00000000
--- a/src/lib/sos/plugins/postfix.py
+++ /dev/null
@@ -1,32 +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.
-
-import sos.plugintools
-from os.path import exists
-
-class postfix(sos.plugintools.PluginBase):
- """mail server related information
- """
- def checkenabled(self):
- if self.isInstalled("postfix") or exists("/etc/rc.d/init.d/postfix"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/mail")
- self.addCopySpec("/etc/postfix/main.cf")
- self.addCopySpec("/etc/postfix/master.cf")
- self.collectExtOutput("/usr/sbin/postconf")
- return
-
diff --git a/src/lib/sos/plugins/ppp.py b/src/lib/sos/plugins/ppp.py
deleted file mode 100644
index a60517e2..00000000
--- a/src/lib/sos/plugins/ppp.py
+++ /dev/null
@@ -1,32 +0,0 @@
-## Copyright (C) 2007 Sadique Puthen
-
-### 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.
-
-import sos.plugintools
-import os
-
-class ppp(sos.plugintools.PluginBase):
- """ppp, wvdial and rp-pppoe related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("ppp") or os.path.exists("/etc/wvdial.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/wvdial.conf")
- self.addCopySpec("/etc/ppp")
- self.addCopySpec("/var/log/ppp")
- self.collectExtOutput("/usr/sbin/adsl-status")
diff --git a/src/lib/sos/plugins/printing.py b/src/lib/sos/plugins/printing.py
deleted file mode 100644
index 47ba6494..00000000
--- a/src/lib/sos/plugins/printing.py
+++ /dev/null
@@ -1,30 +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.
-
-import sos.plugintools
-
-class printing(sos.plugintools.PluginBase):
- """printing related information (cups)
- """
- def setup(self):
- self.addCopySpec("/etc/cups/*.conf")
- self.addCopySpec("/var/log/cups")
- self.addCopySpec("/etc/cups/lpoptions")
- self.addCopySpec("/etc/cups/ppd/*.ppd")
- self.collectExtOutput("/usr/bin/lpstat -t")
- self.collectExtOutput("/usr/bin/lpstat -s")
- self.collectExtOutput("/usr/bin/lpstat -d")
-
- return
-
diff --git a/src/lib/sos/plugins/process.py b/src/lib/sos/plugins/process.py
deleted file mode 100644
index 0d89e06b..00000000
--- a/src/lib/sos/plugins/process.py
+++ /dev/null
@@ -1,63 +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.
-
-import sos.plugintools
-import commands
-import time
-import os
-
-class process(sos.plugintools.PluginBase):
- """process information
- """
- def setup(self):
- self.collectExtOutput("/bin/ps auxwww", root_symlink = "ps")
- self.collectExtOutput("/bin/ps auxwwwm")
- self.collectExtOutput("/bin/ps alxwww")
- self.collectExtOutput("/usr/bin/pstree", root_symlink = "pstree")
- self.collectExtOutput("/usr/sbin/lsof -b +M -n -l", root_symlink = "lsof")
- return
-
- def find_mountpoint(s):
- if (os.path.ismount(s) or len(s)==0): return s
- else: return mountpoint(os.path.split(s)[0])
-
- def diagnose(self):
- # check that no process is in state D
- dpids = []
- status, output = commands.getstatusoutput("/bin/ps -A -o state,pid --no-heading")
- if not status:
- for line in output.split("\n"):
- line = line.split()
- if line[0] == "D":
- # keep an eye on the process to see if the stat changes
- for inc in range(1,10):
- try:
- if len(self.fileGrep("^State: D", " /proc/%d/status" % int(line[1]))) == 0:
- # status is not D, good. let's get out of the loop.
- time.sleep(0.1 * inc)
- continue
- except IOError:
- # this should never happen...
- pass
- else:
- # still D after 0.1 * range(1,5) seconds
- dpids.append(int(line[1]))
-
- if len(dpids):
- self.addDiagnose("one or more processes are in state D (sosreport might hang)")
-
- return
-
-
-
diff --git a/src/lib/sos/plugins/psacct.py b/src/lib/sos/plugins/psacct.py
deleted file mode 100644
index 68e2585e..00000000
--- a/src/lib/sos/plugins/psacct.py
+++ /dev/null
@@ -1,22 +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.
-
-import sos.plugintools
-
-class psacct(sos.plugintools.PluginBase):
- """Process accounting related information
- """
- def setup(self):
- self.addCopySpec("/var/account")
- return
diff --git a/src/lib/sos/plugins/pxe.py b/src/lib/sos/plugins/pxe.py
deleted file mode 100644
index 81e581c6..00000000
--- a/src/lib/sos/plugins/pxe.py
+++ /dev/null
@@ -1,34 +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.
-
-import sos.plugintools
-import os
-
-class pxe(sos.plugintools.PluginBase):
- """PXE related information
- """
-
- optionList = [("tftpboot", 'gathers content in /tftpboot', 'slow', False)]
-
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("system-config-netboot-cmd") or os.path.exists("/usr/sbin/pxeos"):
- return True
- return False
-
- def setup(self):
- self.collectExtOutput("/usr/sbin/pxeos -l")
- self.addCopySpec("/etc/dhcpd.conf")
- if self.getOption("tftpboot"):
- self.addCopySpec("/tftpboot")
- return
diff --git a/src/lib/sos/plugins/quagga.py b/src/lib/sos/plugins/quagga.py
deleted file mode 100644
index 8e51497a..00000000
--- a/src/lib/sos/plugins/quagga.py
+++ /dev/null
@@ -1,30 +0,0 @@
-## Copyright (C) 2007 Ranjith Rajaram
-
-### 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.
-
-import sos.plugintools
-from os.path import exists
-
-class quagga(sos.plugintools.PluginBase):
- """quagga related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("quagga") or exists("/etc/quagga/zebra.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/quagga/")
- return
diff --git a/src/lib/sos/plugins/radius.py b/src/lib/sos/plugins/radius.py
deleted file mode 100644
index b5015c71..00000000
--- a/src/lib/sos/plugins/radius.py
+++ /dev/null
@@ -1,36 +0,0 @@
-## Copyright (C) 2007 Navid Sheikhol-Eslami
-
-### 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.
-
-import sos.plugintools
-import os
-
-class radius(sos.plugintools.PluginBase):
- """radius related information
- """
- def checkenabled(self):
- if self.isInstalled("freeradius") or os.path.exists("/etc/raddb"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/raddb")
- self.addCopySpec("/etc/pam.d/radiusd")
- self.addCopySpec("/var/log/radius")
- return
-
- def postproc(self):
- self.doRegexSub("/etc/raddb/sql.conf", r"(\s*password\s*=\s*)\S+", r"\1***")
- return
diff --git a/src/lib/sos/plugins/rhn.py b/src/lib/sos/plugins/rhn.py
deleted file mode 100644
index efad65bd..00000000
--- a/src/lib/sos/plugins/rhn.py
+++ /dev/null
@@ -1,89 +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.
-
-import sos.plugintools
-
-class rhn(sos.plugintools.PluginBase):
- """RHN Satellite related information
- """
- satellite = False
- proxy = False
-
- optionList = [("log", 'gathers all apache logs', 'slow', False)]
-
- def defaultenabled(self):
- return False
-
- def checkenabled(self):
- # enable if any related package is installed
-
- self.satellite = self.isInstalled("rhns-satellite-tools")
- self.proxy = self.isInstalled("rhns-proxy-tools")
-
- if self.satellite or self.proxy:
- return True
-
- return False
-
- def setup(self):
- self.addCopySpec("/etc/httpd/conf*")
- self.addCopySpec("/etc/rhn")
- self.addCopySpec("/etc/sysconfig/rhn")
- if self.getOption("log"):
- self.addCopySpec("/var/log/httpd") # httpd-logs
- self.addCopySpec("/var/log/rhn*") # rhn-logs
-
- # all these used to go in $DIR/mon-logs/
- self.addCopySpec("/opt/notification/var/*.log*")
- self.addCopySpec("/var/tmp/ack_handler.log*")
- self.addCopySpec("/var/tmp/enqueue.log*")
-
- # monitoring scout logs
- self.addCopySpec("/home/nocpulse/var/*.log*")
- self.addCopySpec("/home/nocpulse/var/commands/*.log*")
- self.addCopySpec("/var/tmp/ack_handler.log*")
- self.addCopySpec("/var/tmp/enqueue.log*")
- self.addCopySpec("/var/log/nocpulse/*.log*")
- self.addCopySpec("/var/log/notification/*.log*")
- self.addCopySpec("/var/log/nocpulse/TSDBLocalQueue/TSDBLocalQueue.log")
-
- self.addCopySpec("/root/ssl-build")
- self.collectExtOutput("rpm -qa --last", root_symlink = "rpm-manifest")
- self.collectExtOutput("/usr/bin/rhn-schema-version", root_symlink = "database-schema-version")
- self.collectExtOutput("/usr/bin/rhn-charsets", root_symlink = "database-character-sets")
-
- if self.satellite:
- self.addCopySpec("/etc/tnsnames.ora")
- self.addCopySpec("/etc/jabberd")
-
- # tomcat (4.x and newer satellites only)
- if not self.policy().pkgNVRA(satellite)[1].startswith("3."):
- self.addCopySpec("/etc/tomcat5")
- self.addCopySpec("/var/log/tomcat5")
-
- self.addCopySpec("/etc/tomcat5")
- self.addCopySpec("/var/log/tomcat5")
-
- if self.proxy:
- # copying configuration information
- self.addCopySpec("/etc/squid")
-
- # copying logs
- self.addCopySpec("/var/log/squid")
-
- return
-
-# def diagnose(self):
- # RHN Proxy:
- # * /etc/sysconfig/rhn/systemid is owned by root.apache with the permissions 0640
diff --git a/src/lib/sos/plugins/rpm.py b/src/lib/sos/plugins/rpm.py
deleted file mode 100644
index 361a7db7..00000000
--- a/src/lib/sos/plugins/rpm.py
+++ /dev/null
@@ -1,33 +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.
-
-import sos.plugintools
-
-class rpm(sos.plugintools.PluginBase):
- """RPM information
- """
- optionList = [("rpmq", "queries for package information via rpm -q", "fast", True),
- ("rpmva", "runs a verify on all packages", "slow", False)]
-
- def setup(self):
- self.addCopySpec("/var/log/rpmpkgs")
-
- if self.getOption("rpmq"):
- self.collectExtOutput("/bin/rpm -qa --qf=\"%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}~~%{INSTALLTIME:date}\n\"|/bin/awk -F ~~ '{printf \"%-60s%s\\n\",$1,$2}'", root_symlink = "installed-rpms")
-
- if self.getOption("rpmva"):
- self.eta_weight += 1500 # this plugins takes 200x longer (for ETA)
- self.collectExtOutput("/bin/rpm -Va", root_symlink = "rpm-Va", timeout = 3600)
- return
-
diff --git a/src/lib/sos/plugins/s390.py b/src/lib/sos/plugins/s390.py
deleted file mode 100644
index 96a6ba8d..00000000
--- a/src/lib/sos/plugins/s390.py
+++ /dev/null
@@ -1,74 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Justin Payne
-
-### 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.
-
-import commands
-import glob
-import os
-import sos.plugintools
-
-class s390(sos.plugintools.PluginBase):
- """s390 related information
- """
-
- ### Check for s390 arch goes here
-
- def checkenabled(self):
- sysArch = self.policy().getArch()
- if "s390" in sysArch:
- return True
- return False
-
- ### Gather s390 specific information
-
- def setup(self):
- self.addCopySpec("/proc/cio_ignore")
- self.addCopySpec("/proc/crypto")
- self.addCopySpec("/proc/dasd/devices")
- self.addCopySpec("/proc/dasd/statistics")
- self.addCopySpec("/proc/misc")
- self.addCopySpec("/proc/qeth")
- self.addCopySpec("/proc/qeth_perf")
- self.addCopySpec("/proc/qeth_ipa_takeover")
- self.addCopySpec("/proc/sys/appldata/*")
- self.addCopySpec("/proc/sys/kernel/hz_timer")
- self.addCopySpec("/proc/sysinfo")
- self.addCopySpec("/sys/bus/ccwgroup/drivers/qeth/0.*/*")
- self.addCopySpec("/sys/bus/ccw/drivers/zfcp/0.*/*")
- self.addCopySpec("/sys/bus/ccw/drivers/zfcp/0.*/0x*/*")
- self.addCopySpec("/sys/bus/ccw/drivers/zfcp/0.*/0x*/0x*/*")
- self.addCopySpec("/etc/zipl.conf")
- self.addCopySpec("/etc/zfcp.conf")
- self.addCopySpec("/etc/sysconfig/dumpconf")
- self.addCopySpec("/etc/src_vipa.conf")
- self.addCopySpec("/etc/ccwgroup.conf")
- self.addCopySpec("/etc/chandev.conf")
- self.collectExtOutput("/sbin/lscss")
- self.collectExtOutput("/sbin/lsdasd")
- self.collectExtOutput("/sbin/lstape")
- self.collectExtOutput("find /sys -type f")
- self.collectExtOutput("find /proc/s390dbf -type f")
- self.collectExtOutput("/sbin/qethconf list_all")
- dasdDev = commands.getoutput("ls /dev/dasd?")
- for x in dasdDev.split('\n'):
- self.collectExtOutput("/sbin/dasdview -x -i -j -l -f %s" % (x,))
- self.collectExtOutput("/sbin/fdasd -p %s" % (x,))
- try:
- rhelver = self.policy().pkgByName("redhat-release")[1]
- except:
- rhelver = None
- if rhelver.startswith("5"):
- self.collectExtOutput("/sbin/lsqeth")
- self.collectExtOutput("/sbin/lszfcp")
diff --git a/src/lib/sos/plugins/samba.py b/src/lib/sos/plugins/samba.py
deleted file mode 100644
index 1e33758b..00000000
--- a/src/lib/sos/plugins/samba.py
+++ /dev/null
@@ -1,29 +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.
-
-import sos.plugintools
-
-class samba(sos.plugintools.PluginBase):
- """Samba related information
- """
- def setup(self):
- self.addCopySpec("/etc/samba")
- self.addCopySpec("/var/log/samba/*")
- self.addCopySpec("/etc/krb5.conf")
- self.addCopySpec("/etc/krb5.keytab")
- self.collectExtOutput("/usr/bin/wbinfo -g")
- self.collectExtOutput("/usr/bin/wbinfo -u")
- self.collectExtOutput("/usr/bin/testparm -s -v")
- return
-
diff --git a/src/lib/sos/plugins/sanitize.py b/src/lib/sos/plugins/sanitize.py
deleted file mode 100644
index 00c883ee..00000000
--- a/src/lib/sos/plugins/sanitize.py
+++ /dev/null
@@ -1,41 +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.
-
-import os
-import sos.plugintools
-import glob
-import socket
-
-class sanitize(sos.plugintools.PluginBase):
- """ sanitize specified log files, etc
- """
- def defaultenabled(self):
- # disabled by default b/c still a work in progress
- return False
-
- def setup(self):
- # sanitize ip's, hostnames in logs
- hostname = socket.gethostname()
- rhelver = self.policy().rhelVersion()
- if rhelver == 5 or rhelver == 4:
- logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/syslog.conf")
- else:
- logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/rsyslog.conf")
- for log in logs:
- self.addCopySpec(log)
-
- def postproc(self):
- self.doRegexSub('/var/log/messages', r"^\s+(%s)" % (hostname,), r"\1sanitized-hostname")
- self.doRegexSub('/var/log/messages', r"([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})", r"\1sanitized-ip")
-
diff --git a/src/lib/sos/plugins/sar.py b/src/lib/sos/plugins/sar.py
deleted file mode 100644
index 9a3b3c92..00000000
--- a/src/lib/sos/plugins/sar.py
+++ /dev/null
@@ -1,37 +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.
-
-import sos.plugintools
-import os
-
-class sar(sos.plugintools.PluginBase):
- """Generate the sar file from /var/log/sa/saXX files
- """
- def setup(self):
- path="/var/log/sa"
- dirList=os.listdir(path)
- # find all the sa file that don't have an existing sar file
- for fname in dirList:
- if fname[0:2] == 'sa' and fname[2:3] != 'r':
- sar_filename = 'sar' + fname[2:4]
- if sar_filename not in dirList:
- sar_command = "/bin/sh -c \"LANG=C /usr/bin/sar -A -f /var/log/sa/" + fname + "\""
- self.collectOutputNow(sar_command, sar_filename, root_symlink=sar_filename)
- return
-
- def checkenabled(self):
- if os.path.exists("/var/log/sa") and os.path.exists("/usr/bin/sar"):
- return True
- return False
-
diff --git a/src/lib/sos/plugins/selinux.py b/src/lib/sos/plugins/selinux.py
deleted file mode 100644
index 7aaa6755..00000000
--- a/src/lib/sos/plugins/selinux.py
+++ /dev/null
@@ -1,51 +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.
-
-import sos.plugintools
-import commands
-
-class selinux(sos.plugintools.PluginBase):
- """selinux related information
- """
- optionList = [("fixfiles", 'Print incorrect file context labels', 'slow', False)]
- def setup(self):
- # sestatus is always collected in checkenabled()
- self.addCopySpec("/etc/selinux")
- self.collectExtOutput("/usr/bin/selinuxconfig")
- self.eta_weight += 240 # this plugins takes 240x longer (for ETA)
- if self.getOption('fixfiles'):
- self.collectExtOutput("/sbin/fixfiles check")
- self.addForbiddenPath("/etc/selinux/targeted")
-
- return
-
- def checkenabled(self):
- # is selinux enabled ?
- try:
- if self.collectOutputNow("/usr/sbin/sestatus", root_symlink = "sestatus").split(":")[1].strip() == "disabled":
- return False
- except:
- pass
- return True
-
- def analyze(self):
- # Check for SELinux denials and capture raw output from sealert
- if self.policy().runlevelDefault() in self.policy().runlevelByService("setroubleshoot"):
- # TODO: fixup regex for more precise matching
- sealert=doRegexFindAll(r"^.*setroubleshoot:.*(sealert\s-l\s.*)","/var/log/messages")
- if sealert:
- for i in sealert:
- self.collectExtOutput("%s" % i)
- self.addAlert("There are numerous selinux errors present and "+
- "possible fixes stated in the sealert output.")
diff --git a/src/lib/sos/plugins/sendmail.py b/src/lib/sos/plugins/sendmail.py
deleted file mode 100644
index 56ea2e7a..00000000
--- a/src/lib/sos/plugins/sendmail.py
+++ /dev/null
@@ -1,32 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Eugene Teo
-
-### 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.
-
-import sos.plugintools
-import os
-
-class sendmail(sos.plugintools.PluginBase):
- """sendmail information
- """
- def checkenabled(self):
- if self.isInstalled("sendmail") or os.path.exists("/etc/rc.d/init.d/sendmail"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/mail/*")
- self.addCopySpec("/var/log/maillog")
- return
-
diff --git a/src/lib/sos/plugins/smartcard.py b/src/lib/sos/plugins/smartcard.py
deleted file mode 100644
index 1ce57bac..00000000
--- a/src/lib/sos/plugins/smartcard.py
+++ /dev/null
@@ -1,36 +0,0 @@
-## Copyright (C) 2007 Sadique Puthen
-
-### 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.
-
-import sos.plugintools
-import os
-
-class smartcard(sos.plugintools.PluginBase):
- """Smart Card related information
- """
-
- def checkenabled(self):
- if self.isInstalled("pam_pkcs11") or os.path.exists("/etc/pam_pkcs11/pam_pkcs11.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/reader.conf")
- self.addCopySpec("/etc/reader.conf.d/")
- self.addCopySpec("/etc/pam_pkcs11/")
- self.collectExtOutput("/usr/bin/pkcs11_inspect debug")
- self.collectExtOutput("/usr/bin/pklogin_finder debug")
- self.collectExtOutput("/bin/ls -l /usr/lib/pam_pkcs11/")
- return
diff --git a/src/lib/sos/plugins/snmp.py b/src/lib/sos/plugins/snmp.py
deleted file mode 100644
index c9be4b2f..00000000
--- a/src/lib/sos/plugins/snmp.py
+++ /dev/null
@@ -1,31 +0,0 @@
-## Copyright (C) 2007 Sadique Puthen
-
-### 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.
-
-import sos.plugintools
-import os
-
-class snmp(sos.plugintools.PluginBase):
- """snmp related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("net-snmp") or os.path.exists("/etc/snmp/snmpd.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/snmp")
- return
-
diff --git a/src/lib/sos/plugins/soundcard.py b/src/lib/sos/plugins/soundcard.py
deleted file mode 100644
index bc94bb4a..00000000
--- a/src/lib/sos/plugins/soundcard.py
+++ /dev/null
@@ -1,30 +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.
-
-import sos.plugintools
-import os
-
-class soundcard(sos.plugintools.PluginBase):
- """ Sound card information
- """
- def setup(self):
- self.addCopySpec("/proc/asound/*")
- self.addCopySpec("/etc/alsa/*")
- self.addCopySpec("/etc/asound.*")
- self.collectExtOutput("/sbin/lspci | grep -i audio")
- self.collectExtOutput("/usr/bin/aplay -l")
- self.collectExtOutput("/usr/bin/aplay -L")
- self.collectExtOutput("/usr/bin/amixer")
- self.collectExtOutput("/sbin/lsmod | /bin/grep snd | /bin/awk '{print $1}'", suggest_filename = "sndmodules_loaded")
- return
diff --git a/src/lib/sos/plugins/squid.py b/src/lib/sos/plugins/squid.py
deleted file mode 100644
index 3e9b3d8b..00000000
--- a/src/lib/sos/plugins/squid.py
+++ /dev/null
@@ -1,29 +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.
-
-import sos.plugintools
-import os
-
-class squid(sos.plugintools.PluginBase):
- """squid related information
- """
- def checkenabled(self):
- self.files = [ "/etc/squid/squid.conf" ]
- self.packages = [ "squid" ]
- return sos.plugintools.PluginBase.checkenabled(self)
-
- def setup(self):
- self.addCopySpec("/etc/squid/squid.conf")
- return
-
diff --git a/src/lib/sos/plugins/ssh.py b/src/lib/sos/plugins/ssh.py
deleted file mode 100644
index 6352583b..00000000
--- a/src/lib/sos/plugins/ssh.py
+++ /dev/null
@@ -1,26 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Eugene Teo
-
-### 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.
-
-import sos.plugintools
-
-class ssh(sos.plugintools.PluginBase):
- """ssh-related information
- """
- def setup(self):
- self.addCopySpec("/etc/ssh/ssh_config")
- self.addCopySpec("/etc/ssh/sshd_config")
- return
-
diff --git a/src/lib/sos/plugins/startup.py b/src/lib/sos/plugins/startup.py
deleted file mode 100644
index 463f95fb..00000000
--- a/src/lib/sos/plugins/startup.py
+++ /dev/null
@@ -1,27 +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.
-
-import sos.plugintools
-
-class startup(sos.plugintools.PluginBase):
- """startup information
- """
- def setup(self):
- self.addCopySpec("/etc/rc.d")
-
- self.collectExtOutput("/sbin/chkconfig --list", root_symlink = "chkconfig")
- self.collectExtOutput("/sbin/service --status-all")
- self.collectExtOutput("/sbin/runlevel")
- return
-
diff --git a/src/lib/sos/plugins/system.py b/src/lib/sos/plugins/system.py
deleted file mode 100644
index 82b04604..00000000
--- a/src/lib/sos/plugins/system.py
+++ /dev/null
@@ -1,33 +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.
-
-import sos.plugintools
-
-class system(sos.plugintools.PluginBase):
- """core system related information
- """
- def setup(self):
- self.addCopySpec("/proc/sys")
- self.addCopySpec("/etc/sysctl.conf")
- self.addCopySpec("/etc/cron*")
- self.addCopySpec("/var/spool/cron*")
- self.addCopySpec("/var/log/cron*")
- self.addCopySpec("/etc/syslog.conf")
- self.addCopySpec("/etc/rsyslog.conf")
- self.addCopySpec("/etc/ntp.conf")
- self.addCopySpec("/etc/ntp/step-tickers")
- self.addCopySpec("/etc/ntp/ntpservers")
- self.collectExtOutput("/usr/bin/crontab -l")
- return
-
diff --git a/src/lib/sos/plugins/systemtap.py b/src/lib/sos/plugins/systemtap.py
deleted file mode 100644
index fc6c86db..00000000
--- a/src/lib/sos/plugins/systemtap.py
+++ /dev/null
@@ -1,35 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Eugene Teo
-
-### 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.
-
-import sos.plugintools
-
-class systemtap(sos.plugintools.PluginBase):
- """SystemTap information
- """
- def checkenabled(self):
- self.files = [ "/usr/bin/stap" ]
- self.packages = [ "systemtap", "systemtap-runtime" ]
- return sos.plugintools.PluginBase.checkenabled(self)
-
- def setup(self):
- # requires systemtap, systemtap-runtime, kernel-devel,
- # kernel-debuginfo, kernel-debuginfo-common
- # FIXME: do not use rpm -qa
- self.collectExtOutput("/bin/rpm -qa | /bin/egrep -e kernel.*`uname -r` -e systemtap -e elfutils | sort")
- self.collectExtOutput("/usr/bin/stap -V 2")
- self.collectExtOutput("/bin/uname -r")
- return
-
diff --git a/src/lib/sos/plugins/tftpserver.py b/src/lib/sos/plugins/tftpserver.py
deleted file mode 100644
index 0056d221..00000000
--- a/src/lib/sos/plugins/tftpserver.py
+++ /dev/null
@@ -1,31 +0,0 @@
-## Copyright (C) 2007 Shijoe George
-
-### 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.
-
-import sos.plugintools
-from os.path import exists
-
-class tftpserver(sos.plugintools.PluginBase):
- """tftpserver related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("tftp-server") or exists("/etc/xinetd.d/tftp"):
- return True
- return False
-
- def setup(self):
- self.collectExtOutput("/bin/ls -laR /tftpboot")
- return
-
diff --git a/src/lib/sos/plugins/tomcat.py b/src/lib/sos/plugins/tomcat.py
deleted file mode 100644
index a6dc9055..00000000
--- a/src/lib/sos/plugins/tomcat.py
+++ /dev/null
@@ -1,28 +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.
-
-import sos.plugintools
-
-class tomcat(sos.plugintools.PluginBase):
- """Tomcat related information
- """
- def checkenabled(self):
- if self.cInfo["policy"].pkgByName("tomcat5"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/tomcat5")
- self.addCopySpec("/var/log/tomcat5")
- return
diff --git a/src/lib/sos/plugins/udev.py b/src/lib/sos/plugins/udev.py
deleted file mode 100644
index 0b48e51e..00000000
--- a/src/lib/sos/plugins/udev.py
+++ /dev/null
@@ -1,23 +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.
-
-import sos.plugintools
-
-class udev(sos.plugintools.PluginBase):
- """udev related information
- """
- def setup(self):
- self.addCopySpec("/etc/udev/udev.conf")
- self.addCopySpec("/etc/udev/rules.d/*")
- return
diff --git a/src/lib/sos/plugins/veritas.py b/src/lib/sos/plugins/veritas.py
deleted file mode 100644
index 6090627a..00000000
--- a/src/lib/sos/plugins/veritas.py
+++ /dev/null
@@ -1,221 +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.
-
-import commands
-import sos.plugintools
-
-class veritas(sos.plugintools.PluginBase):
- """veritas related information
- """
- # License
- license = {"VXLICENSE" : "/usr/sbin/vxlicense", "VXLICREP" : "/usr/sbin/vxlicense",
- "OLD_VXLICREP" : "/var/adm/VRTSshrd/VRTSlic/bin/vxlicrep",
- "VXLICTEST" : "/sbin/vxlictest"}
-
- # Slim
- slim = {"VSSAT" : "/opt/VRTSat/bin/vssat"}
-
- # VxVM
- vxvm = {"VXDCTL" : "/usr/sbin/vxdctl", "VXPRINT" : "/usr/lib/vxvm/diag.d/vxkprint",
- "VXDISK" : "/usr/sbin/vxdisk", "VXDG" : "/usr/sbin/vxdg", "VXRLINK" : "/usr/sbin/vxrlink",
- "MACROSD" : "/usr/lib/vxvm/diag.d/macros.d", "VXDMPADM" : "/usr/sbin/vxdmpadm",
- "VXSTAT" : "/usr/sbin/vxstat", "VXCONFIGD" : "/usr/sbin/vxconfigd",
- "VXDDLADM" : "/usr/sbin/vxddladm", "VXDIAGDIR" : "/usr/lib/vxvm/diag.d",
- "VXTRACE" : "/usr/sbin/vxtrace", "VXRVG" : "/usr/sbin/vxrvg",
- "VXCLUSTADM" : "/etc/vx/bin/vxclustadm", "VXVSET" : "/usr/sbin/vxvset"}
-
- # VFR
- vfr = {"VFRC" : "/usr/sbin/vfrc"}
-
- # VxFS
- vxfs = {"VXLD_PRINT" : "/sbin/vxld_print", "FSCKPTADM" : "/usr/lib/fs/vxfs/fsckptadm",
- "FCLADM" : "/opt/VRTS/bin/fcladm", "FSAPADM" : "/opt/VRTS/bin/fsapadm",
- "FSDB" : "/opt/VRTS/bin/fsdb", "FSADM" : "/usr/lib/fs/vxfs/fsadm",
- "VXTUNEFS" : "/usr/lib/fs/vxfs/vxtunefs", "FSTYP" : "/usr/lib/fs/vxfs/fstyp"}
-
- #vcs
- vcs = {"HARES" : "/opt/VRTSvcs/bin/hares","HAGRP" : "/opt/VRTSvcs/bin/hagrp",
- "HASYS" : "/opt/VRTSvcs/bin/hasys","HACLUS" : "/opt/VRTSvcs/bin/haclus",
- "HACONF" : "/opt/VRTSvcs/bin/haconf","HASTATUS" : "/opt/VRTSvcs/bin/hastatus",
- "GABCONFIG" : "/sbin/gabconfig", "GABDISK" : "/sbin/gabdisk",
- "HATYPE" : "/opt/VRTSvcs/bin/hatype", "LLTSTAT" : "/sbin/lltstat",
- "GABDEBUG" : "/sbin/gabdebug", "GABDISKHB" : "/sbin/gabdiskhb",
- "GABDISKX" : "/sbin/gabdiskx", "GABPORT" : "/sbin/gabport",
- "HAD" : "/opt/VRTSvcs/bin/had","GETCOMMS" : "/opt/VRTSgab/getcomms",
- "HADISCOVER" : "/opt/VRTSvcs/bin/hadiscover",
- "OraDiscovery" : "/opt/VRTSvcs/bin/Oracle/OraDiscovery.pl",
- "GETVCSOPS" : "/opt/VRTSvcs/bin/getvcsops","GETDBAC" : "/opt/VRTSvcs/bin/getdbac"}
- # module list
- module_list = ["vxvm", "vxfs", "isis", "samba", "vcs", "spnas", "txpt", "vsap",
- "vrtsisp", "vlic", "vrw", "cpi", "cca", "spc", "vxfen", "cmc",
- "slim", "sfms", "dbed","vxportal","vxspec","vxio","vxdmpfs",
- "vxdmp"]
-
- package_list = ["VRTSfppm","VRTSfspro","VRTSob","VRTSlvmconv","VRTSvxmsa",
- "VRTSfsdoc", "VRTSap","VRTSap","VRTScpi","VRTSvxvm","VRTSvmpro",
- "VRTSddlpr","VRTSobgui","VRTSvmman","VRTScccfg","VRTSsal",
- "VRTSccshd","VRTStep","VRTStep","VRTSvxfs","VRTSalloc",
- "VRTSfsman","VRTSClariionCx600","VRTSccdam","VRTSccsta",
- "VRTSvlic"]
-
- def checkenabled(self):
- for pkgname in self.package_list:
- if self.policy().allPkgsByName(pkgname):
- return True
- return False
-
- def get_vxfs(self):
- """ capture information related to VXFS
- """
- self.addCopySpec("/etc/vx/tunefstab")
- # get all vxfs mountpoints and capture various information
- for mntpnt in commands.getoutput("/bin/df -P -T | /bin/grep vxfs | /usr/bin/awk '{ print $7 }'"):
- bdev = commands.getoutput("/bin/mount | /bin/grep 'on %s' | /usr/bin/awk '{ print $1 }'" % mntpnt)
- if mntpnt == "/":
- mntname="_root_"
- else:
- mntname=commands.getoutput("/bin/echo %s | sed s#/#_#g" % mntpnt)
- self.collectExtOutput("/bin/df -k %s" % mntpnt)
- self.collectExtOutput("%s -v %s" % (self.vxfs["FSTYP"],bdev))
- self.collectExtOutput("%s %s" % (self.vxfs["FSADM"],mntpnt))
- self.collectExtOutput("%s -p %s" % (self.vxfs["VXTUNEFS"],mntpnt))
- self.collectExtOutput("%s state %s" % (self.vxfs["FCLADM"],mntpnt))
- self.collectExtOutput("%s queryfs %S" % (self.vxfs["FSAPADM"],mntpnt))
- self.collectExtOutput("%s -n 'VERITAS File System' -l" % self.license["VXLICTEST"])
- return
-
- def get_vxvm(self):
- """ Veritas volume manager information
- """
- # vxdctl and vxclustadm information
- self.collectExtOutput("%s mode" % self.vxvm["VXDCTL"])
- self.collectExtOutput("%s -c mode" % self.vxvm["VXDCTL"])
- self.collectExtOutput("%s license" % self.vxvm["VXDCTL"])
- self.collectExtOutput("%s support" % self.vxvm["VXDCTL"])
- nodestate=commands.getoutput("%s help | grep '\[-v\] nodestate" % self.vxvm["VXCLUSTADM"])
- if nodestate is None:
- self.collectExtOutput("%s -v nodestate" % self.vxvm["VXCLUSTADM"])
- else:
- self.collectExtOutput("%s nodestate" % self.vxvm["VXCLUSTADM"])
- nidmap=commands.getoutput("% help | grep 'nidmap'" % self.vxvm["VXCLUSTADM"])
- if nidmap is None:
- self.collectExtOutput("%s nidmap" % self.vxvm["VXCLUSTADM"])
- self.collectExtOutput("%s dumpmsg" % self.vxvm["VXCLUSTADM"])
- self.collectExtOutput("%s transstate" % self.vxvm["VXCLUSTADM"])
- self.addCopySpec("/var/adm/vx/cmdlog*")
- self.addCopySpec("/var/adm/vx/translog*")
- self.addCopySpec("/VXVM*UPGRADE*")
- self.addCopySpec("/var/vxvm")
- self.collectExtOutput("/bin/ls -l /dev/vx*")
- self.collectExtOutput("/bin/ls -laR /etc/vx")
- self.addCopySpec("/etc/vx")
- self.addCopySpec("/etc/vxvmconf")
- self.addCopySpec("/etc/default/vxassist")
- # vxvm - vxdctl information
- vxdctlmode=commands.getoutput("%s mode | /usr/bin/awk ' { print $2 } '" % self.vxvm["VXDCTL"])
- if vxdctlmode == "disabled" or vxdctlmode == "not-running":
- return
- # vxvm - vxdisk information
- self.collectExtOutput("%s list" % self.vxvm["VXDISK"])
- vxdisk_path=commands.getoutput("%s help | grep 'path'" % self.vxvm["VXDISK"])
- if vxdisk_path is None:
- self.collectExtOutput("%s path" % self.vxvm["VXDISK"])
- self.collectExtOutput("%s -o alldgs list" % self.vxvm["VXDISK"])
- self.collectExtOutput("%s -s list" % self.vxvm["VXDISK"])
- for i in commands.getoutput("%s -q list | /usr/bin/awk ' { print $1 } ' | /bin/grep -v '^-$'" % self.vxvm["VXDISK"]):
- self.collectExtOutput("%s list %s" % (self.vxvm["VXDISK"], i))
- # vxvm - vxdg information
- self.collectExtOutput("%s list" % self.vxvm["VXDG"])
- self.collectExtOutput("%s free" % self.vxvm["VXDG"])
- if commands.getoutput("%s help | grep 'bootdg'" % self.vxvm["VXDG"]) is None:
- self.collectExtOutput("%s bootdg" % self.vxvm["VXDG"])
- # vxvm - vxtrace information
- self.collectExtOutput("%s -lE" % self.vxvm["VXTRACE"])
- for i in commands.getoutput("%s -q list | /usr/bin/awk ' { print $1 } '" % self.vxvm["VXDG"]):
- self.collectExtOutput("%s list %i" % (self.vxvm["VXDG"],i))
- self.collectExtOutput("%s -g %s" % (self.vxvm["VXSTAT"],i))
- self.collectExtOutput("%s -mvpshr -g %s" % (self.vxvm["VXPRINT"],i))
- self.collectExtOutput("%s -m -g %s" % (self.vxvm["VXPRINT"],i))
- self.collectExtOutput("%s list" % self.vxvm["VXVSET"])
- self.addCopySpec("/proc/sys/vxvm/vxinfo")
- self.addcopyspec("/proc/sys/vxvm/vxio")
- # vvr/svrm specific information
- self.addCopySpec("/etc/vx/vras")
- return
-
- def get_vcs(self):
- """ Veritas cluster information
- """
- self.collectExtOutput("%s -dump" % self.vcs["HACONF"])
- self.addCopySpec("/etc/VRTSvcs/*")
- self.addCopySpec("/etc/llt*")
- self.addCopySpec("/etc/gab*")
-
- #copy log files, etc
- self.addCopySpec("/var/VRTSvcs/*")
- self.addCopySpec("/var/adm/streams")
- self.addCopySpec("/var/adm/VRTSshrd/VRTSlic")
-
- # get state information
-
- self.collectExtOutput(self.vcs[LLTSTAT])
- self.collectExtOutput("%s -vvn" % self.vcs["LLTSTAT"])
- self.collectExtOutput("%s -a" % self.vcs["GABCONFIG"])
- self.collectExtOutput("%s -l" % self.vcs["GABDISK"])
- self.collectExtOutput("%s -l" % self.vcs["GABDISKHB"])
- self.collectExtOutput("%s -l" % self.vcs["GABDISKX"])
-
- self.collectExtOutput("%s -summary" % self.vcs["HASTATUS"])
- self.collectExtOutput("%s -display -all" % self.vcs["HARES"])
- self.collectExtOutput("%s -dep" % self.vcs["HARES"])
- self.collectExtOutput("%s -display -all" % self.vcs["HAGRP"])
- self.collectExtOutput("%s -dep" % self.vcs["HAGRP"])
- self.collectExtOutput("%s -display" % self.vcs["HATYPE"])
- self.collectExtOutput("%s -display" % self.vcs["HASYS"])
- self.collectExtOutput("%s -display" % self.vcs["HACLUS"])
-
- # TODO: get agents section
-
- # get cores
- self.addCopySpec("/opt/VRTSvcs/bin/core*")
- self.addCopySpec("/opt/VRTSvcs/core*")
-
- # TODO: get comms
-
- # vcs gui
- self.addCopySpec("/opt/VRTSvcs/gui/conf")
-
- # vcs quickstart
- vcsmode = commands.getoutput("%s -value VCSMODE" % self.vcs["HACLUS"])
- if vcsmode == "VCSQS":
- self.collectExtOutput("%s -discover Application User" % self.vcs["HADISCOVER"])
- self.collectExtOutput("%s -discover Mount MountPoint" % self.vcs["HADISCOVER"])
- self.collectExtOutput("%s -discover NFS Nservers" % self.vcs["HADISCOVER"])
- self.collectExtOutput("%s -discover NIC Device" % self.vcs["HADISCOVER"])
- self.collectExtOutput("%s -discover Oracle Instances" % self.vcs["HADISCOVER"])
- self.collectExtOutput("%s -discover Share PathName" % self.vcs["HADISCOVER"])
-
- def get_vxfen(self):
- pass
-
- def setup(self):
- # TODO: Do necessary checks for different archs, i.e. z-series and ia64
- self.collectExtOutput("/bin/rpm -qa | /bin/grep -i VRTS | /bin/grep -v doc | /bin/grep -v man")
- # Determine what information to collect based on installed packages
- if self.isInstalled("VRTSvxfs"): get_vxfs()
- if self.isInstalled("VRTSvxfs"): get_vxvm()
- # I think if one of these is present it is assumed that VCS is installed
- if self.isInstalled("VRTSvmpro") or self.isInstalled("VRTSfspro"): get_vcs()
- return
-
diff --git a/src/lib/sos/plugins/vmware.py b/src/lib/sos/plugins/vmware.py
deleted file mode 100644
index 7891576d..00000000
--- a/src/lib/sos/plugins/vmware.py
+++ /dev/null
@@ -1,30 +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.
-
-import sos.plugintools
-import os
-
-class vmware(sos.plugintools.PluginBase):
- """VMWare related information
- """
- def checkenabled(self):
- if os.path.exists("/usr/bin/vmware"):
- return True
- return False
-
- def setup(self):
- self.collectExtOutput("/usr/bin/vmware -v")
- self.addCopySpec("/etc/vmware/locations")
- self.addCopySpec("/etc/vmware/config")
- return
diff --git a/src/lib/sos/plugins/x11.py b/src/lib/sos/plugins/x11.py
deleted file mode 100644
index 09b7c3c9..00000000
--- a/src/lib/sos/plugins/x11.py
+++ /dev/null
@@ -1,41 +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.
-
-import sos.plugintools
-import os
-
-class x11(sos.plugintools.PluginBase):
- """X related information
- """
- def checkenabled(self):
- try:os.stat("/etc/X11")
- except:pass
- else:return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/X11")
- self.addCopySpec("/var/log/Xorg.*.log")
- self.addCopySpec("/var/log/XFree86.*.log")
- self.collectExtOutput("/bin/dmesg | grep -e 'agpgart.'")
-
- self.addForbiddenPath("/etc/X11/X")
- self.addForbiddenPath("/etc/X11/fontpath.d")
-
- # TODO: if there is a need for kde that can be added here as well
- if os.path.exists("/etc/gdm"):
- self.addCopySpec("/etc/gdm")
-
- return
-
diff --git a/src/lib/sos/plugins/xen.py b/src/lib/sos/plugins/xen.py
deleted file mode 100644
index a4adca75..00000000
--- a/src/lib/sos/plugins/xen.py
+++ /dev/null
@@ -1,99 +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.
-
-import sos.plugintools
-import os, commands
-import re
-from stat import *
-
-class xen(sos.plugintools.PluginBase):
- """Xen related information
- """
- def determineXenHost(self):
- if os.access("/proc/acpi/dsdt", os.R_OK):
- (status, output) = commands.getstatusoutput("grep -qi xen /proc/acpi/dsdt")
- if status == 0:
- return "hvm"
-
- if os.access("/proc/xen/capabilities", os.R_OK):
- (status, output) = commands.getstatusoutput("grep -q control_d /proc/xen/capabilities")
- if status == 0:
- return "dom0"
- else:
- return "domU"
- return "baremetal"
-
- def checkenabled(self):
- if self.determineXenHost() == "baremetal":
- return False
- return True
-
- def is_running_xenstored(self):
- xs_pid = os.popen("pidof xenstored").read()
- xs_pidnum = re.split('\n$',xs_pid)[0]
- return xs_pidnum.isdigit()
-
- def domCollectProc(self):
- self.addCopySpec("/proc/xen/balloon")
- self.addCopySpec("/proc/xen/capabilities")
- self.addCopySpec("/proc/xen/xsd_kva")
- self.addCopySpec("/proc/xen/xsd_port")
- # determine if CPU has PAE support
- self.collectExtOutput("/bin/grep pae /proc/cpuinfo")
- # determine if CPU has Intel-VT or AMD-V support
- self.collectExtOutput("/bin/egrep -e 'vmx|svm' /proc/cpuinfo")
-
- def setup(self):
- host_type = self.determineXenHost()
- if host_type == "domU":
- # we should collect /proc/xen and /sys/hypervisor
- self.domCollectProc()
- # determine if hardware virtualization support is enabled
- # in BIOS: /sys/hypervisor/properties/capabilities
- self.addCopySpec("/sys/hypervisor")
- elif host_type == "hvm":
- # what do we collect here???
- pass
- elif host_type == "dom0":
- # default of dom0, collect lots of system information
- self.addCopySpec("/var/log/xen")
- self.addCopySpec("/etc/xen")
- self.collectExtOutput("/usr/sbin/xm dmesg")
- self.collectExtOutput("/usr/sbin/xm info")
- self.collectExtOutput("/usr/sbin/xm list")
- self.collectExtOutput("/usr/sbin/xm list --long")
- self.collectExtOutput("/usr/sbin/brctl show")
- self.domCollectProc()
- self.addCopySpec("/sys/hypervisor/version")
- self.addCopySpec("/sys/hypervisor/compilation")
- self.addCopySpec("/sys/hypervisor/properties")
- self.addCopySpec("/sys/hypervisor/type")
- if self.is_running_xenstored():
- self.addCopySpec("/sys/hypervisor/uuid")
- self.collectExtOutput("/usr/bin/xenstore-ls")
- else:
- # we need tdb instead of xenstore-ls if cannot get it.
- self.addCopySpec("/var/lib/xenstored/tdb")
-
- # FIXME: we *might* want to collect things in /sys/bus/xen*,
- # /sys/class/xen*, /sys/devices/xen*, /sys/modules/blk*,
- # /sys/modules/net*, but I've never heard of them actually being
- # useful, so I'll leave it out for now
- else:
- # for bare-metal, we don't have to do anything special
- return
-
- self.addCustomText("Xen hostType: "+host_type)
- return
-
diff --git a/src/lib/sos/plugins/xinetd.py b/src/lib/sos/plugins/xinetd.py
deleted file mode 100644
index b131f165..00000000
--- a/src/lib/sos/plugins/xinetd.py
+++ /dev/null
@@ -1,32 +0,0 @@
-## Copyright (C) 2007 Red Hat, Inc., Eugene Teo
-
-### 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.
-
-import sos.plugintools
-import os
-
-class xinetd(sos.plugintools.PluginBase):
- """xinetd information
- """
- def checkenabled(self):
- if self.isInstalled("xinetd") or os.path.exists("/etc/xinetd.conf"):
- return True
- return False
-
- def setup(self):
- self.addCopySpec("/etc/xinetd.conf")
- self.addCopySpec("/etc/xinetd.d")
- return
-
diff --git a/src/lib/sos/plugins/yum.py b/src/lib/sos/plugins/yum.py
deleted file mode 100644
index 25bbc7b9..00000000
--- a/src/lib/sos/plugins/yum.py
+++ /dev/null
@@ -1,60 +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.
-
-import sos.plugintools
-import os
-import commands
-
-class yum(sos.plugintools.PluginBase):
- """yum information
- """
-
- optionList = [("yumlist", "list repositories and packages", "slow", False)]
- optionList = [("yumdebug", "gather yum debugging data", "slow", False)]
-
- def checkenabled(self):
- self.files = [ "/etc/yum.conf" ]
- self.packages = [ "yum" ]
- return sos.plugintools.PluginBase.checkenabled(self)
-
- def analyze(self):
- # repo sanity checking
- # TODO: elaborate/validate actual repo files, however this directory should
- # be empty on RHEL 5+ systems.
- if self.policy().rhelVersion() == 5:
- if len(os.listdir("/etc/yum.repos.d/")):
- self.addAlert("/etc/yum.repos.d/ contains additional repository "+
- "information and can cause rpm conflicts.")
-
- def setup(self):
- # Pull all yum related information
- self.addCopySpec("/etc/yum")
- self.addCopySpec("/etc/yum.repos.d")
- self.addCopySpec("/etc/yum.conf")
- self.addCopySpec("/var/log/yum.log")
-
- if self.getOption("yumlist"):
- # Get a list of channels the machine is subscribed to.
- self.collectExtOutput("/bin/echo \"repo list\" | /usr/bin/yum shell")
- # List various information about available packages
- self.collectExtOutput("/usr/bin/yum list")
-
- if self.getOption("yumdebug") and self.isInstalled('yum-utils'):
- for output in commands.getoutput("/usr/bin/yum-debug-dump").split("\n"):
- if "Output written to:" in output:
- try:
- self.collectExtOutput("/bin/zcat %s" % (output.split()[-1:][0],))
- except IndexError:
- pass
- return
diff --git a/src/lib/sos/plugintools.py b/src/lib/sos/plugintools.py
deleted file mode 100644
index b8b4ed7a..00000000
--- a/src/lib/sos/plugintools.py
+++ /dev/null
@@ -1,587 +0,0 @@
-## plugintools.py
-## This exports methods available for use by plugins for sos
-
-## Copyright (C) 2006 Steve Conklin
-
-### 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.
-
-# pylint: disable-msg = R0902
-# pylint: disable-msg = R0904
-# pylint: disable-msg = W0702
-# pylint: disable-msg = W0703
-# pylint: disable-msg = R0201
-# pylint: disable-msg = W0611
-# pylint: disable-msg = W0613
-
-"""
-This is the base class for sosreport plugins
-"""
-from sos.helpers import *
-import os, os.path, sys, string, glob, re, traceback
-import shutil
-from stat import *
-from time import time
-from multiprocessing import Process
-
-class PluginException(Exception): pass
-
-class PluginBase:
- """
- Base class for plugins
- """
- def __init__(self, pluginname, commons):
- if not getattr(self, "optionList", False):
- self.optionList = []
-
- self.copiedFiles = []
- self.copiedDirs = []
- self.executedCommands = []
- self.diagnose_msgs = []
- self.alerts = []
- self.customText = ""
- self.optNames = []
- self.optParms = []
- self.piName = pluginname
- self.cInfo = commons
- self.forbiddenPaths = []
- self.copyPaths = []
- self.collectProgs = []
- self.thread = None
- self.pid = None
- self.eta_weight = 1
- self.time_start = None
- self.time_stop = None
-
- self.packages = []
- self.files = []
-
- self.must_exit = False
-
- self.soslog = logging.getLogger('sos')
-
- # get the option list into a dictionary
- for opt in self.optionList:
- self.optNames.append(opt[0])
- self.optParms.append({'desc':opt[1], 'speed':opt[2], 'enabled':opt[3]})
-
- def policy(self):
- return self.cInfo["policy"]
-
- def isInstalled(self, package_name):
- '''Is the package $package_name installed?
- '''
- return (self.policy().pkgByName(package_name) != {})
-
- # Method for applying regexp substitutions
- def doRegexSub(self, srcpath, regexp, subst):
- '''Apply a regexp substitution to a file archived by sosreport.
- '''
- if len(self.copiedFiles):
- for afile in self.copiedFiles:
- if afile['srcpath'] == srcpath:
- abspath = os.path.join(self.cInfo['dstroot'], srcpath.lstrip(os.path.sep))
- try:
- fp = open(abspath, 'r')
- tmpout, occurs = re.subn( regexp, subst, fp.read() )
- fp.close()
- if occurs > 0:
- fp = open(abspath,'w')
- fp.write(tmpout)
- fp.close()
- return occurs
- except SystemExit:
- raise SystemExit
- except KeyboardInterrupt:
- raise KeyboardInterrupt
- except Exception, e:
- self.soslog.log(logging.VERBOSE, "problem at path %s (%s)" % (abspath,e))
- break
- return False
-
- def doRegexFindAll(self, regex, fname):
- ''' Return a list of all non overlapping matches in the string(s)
- '''
- try:
- return re.findall(regex, open(fname, 'r').read(), re.MULTILINE)
- except: # IOError, AttributeError, etc.
- return []
-
- # Methods for copying files and shelling out
- def doCopyFileOrDir(self, srcpath, symlinks=True):
- # pylint: disable-msg = R0912
- # pylint: disable-msg = R0915
- ''' Copy file or directory to the destination tree. If a directory, then everything
- below it is recursively copied. A list of copied files are saved for use later
- in preparing a report
- '''
- copyProhibited = 0
- for path in self.forbiddenPaths:
- if ( srcpath.count(path) > 0 ):
- copyProhibited = 1
-
- if copyProhibited:
- return ''
-
- if not os.path.exists(srcpath):
- self.soslog.debug("file or directory %s does not exist" % srcpath)
- return
-
- try:
- # What's the name of the symlink on the dest tree?
- dstslname = os.path.join(self.cInfo['dstroot'], srcpath.lstrip(os.path.sep))
- # make sure the dst dir exists
- if not (os.path.exists(os.path.dirname(dstslname)) and os.path.isdir(os.path.dirname(dstslname))):
- os.makedirs(os.path.dirname(dstslname))
- if symlinks and os.path.islink(srcpath):
- link = os.readlink(srcpath)
- os.symlink(link, dstslname)
- if os.path.isabs(srcpath):
- rpth = sosRelPath(os.path.dirname(dstslname), os.path.join(self.cInfo['dstroot'], link.lstrip(os.path.sep)))
- else:
- rpth = link
- self.copiedFiles.append({'srcpath':srcpath, 'dstpath':rpth, 'symlink':"yes", 'pointsto':link})
- elif os.path.isdir(srcpath):
- shutil.copytree(srcpath, dstslname, symlinks)
- else:
- # if we get here, it's definitely a regular file (not a symlink or dir)
- self.soslog.log(logging.VERBOSE3, "copying file %s" % srcpath)
- try:
- tdstpath, abspath = self.__copyFile(srcpath)
- except PluginException:
- self.soslog.log(logging.DEBUG, "error copying file %s (already exists)" % (srcpath))
- return
- except IOError:
- self.soslog.log(logging.VERBOSE2, "error copying file %s (IOError)" % (srcpath))
- return
- except:
- self.soslog.log(logging.VERBOSE2, "error copying file %s (SOMETHING HAPPENED)" % (srcpath))
- return
- self.copiedFiles.append({'srcpath':srcpath, 'dstpath':tdstpath, 'symlink':"no"}) # save in our list
- except (IOError, os.error), why:
- self.soslog.log(logging.DEBUG, "skipping symlink creation: (%s)" % (why,))
- except shutil.Error, err:
- self.soslog.log(logging.DEBUG, "error copying file %s (shutil.Error)" % (srcpath,))
-
- return
-
- def __copyFile(self, src):
- """ call cp to copy a file, collect return status and output. Returns the
- destination file name.
- """
- rel_dir = os.path.dirname(src).lstrip(os.path.sep)
-# if rel_dir[0] == "/": rel_dir = rel_dir[1:]
- new_dir = os.path.join(self.cInfo['dstroot'], rel_dir)
- new_fname = os.path.join(new_dir, os.path.basename(src))
-
- if not os.path.exists(new_fname):
- if not os.path.isdir(new_dir):
- os.makedirs(new_dir)
-
- if os.path.islink(src):
- linkto = os.readlink(src)
- os.symlink(linkto, new_fname)
- else:
- shutil.copy2(src, new_dir)
- else:
- raise PluginException('Error copying file: already exists')
-
- abspath = os.path.join(self.cInfo['dstroot'], src.lstrip(os.path.sep))
- relpath = sosRelPath(self.cInfo['rptdir'], abspath)
- return (relpath, abspath)
-
- def addForbiddenPath(self, forbiddenPath):
- """Specify a path to not copy, even if it's part of a copyPaths[] entry.
- """
- # Glob case handling is such that a valid non-glob is a reduced glob
- for filespec in glob.glob(forbiddenPath):
- self.forbiddenPaths.append(filespec)
-
- def getAllOptions(self):
- """
- return a list of all options selected
- """
- return (self.optNames, self.optParms)
-
- def setOption(self, optionname, value):
- ''' set the named option to value.
- '''
- for name, parms in zip(self.optNames, self.optParms):
- if name == optionname:
- parms['enabled'] = value
- return True
- else:
- return False
-
- def isOptionEnabled(self, optionname):
- ''' Deprecated, use getOption() instead
- '''
- return self.getOption(optionname)
-
- def getOption(self, optionname):
- ''' see whether the named option is enabled.
- '''
- for name, parms in zip(self.optNames, self.optParms):
- if name == optionname:
- return parms['enabled']
- # nonexistent options aren't enabled.
- return 0
-
- def addCopySpecLimit(self,fname,sizelimit = None):
- """Add a file specification (with limits)
- """
- if not ( fname and len(fname) ):
- self.soslog.warning("invalid file path")
- return False
- files = glob.glob(fname)
- files.sort()
- cursize = 0
- for flog in files:
- cursize += os.stat(flog)[ST_SIZE]
- if sizelimit and (cursize / 1024 / 1024) > sizelimit:
- break
- self.addCopySpec(flog)
-
- def addCopySpec(self, copyspec):
- """ Add a file specification (can be file, dir,or shell glob) to be
- copied into the sosreport by this module
- """
- if not ( copyspec and len(copyspec) ):
- self.soslog.warning("invalid file path")
- return False
- # Glob case handling is such that a valid non-glob is a reduced glob
- for filespec in glob.glob(copyspec):
- self.copyPaths.append(filespec)
-
- def callExtProg(self, prog):
- """ Execute a command independantly of the output gathering part of
- sosreport
- """
- # pylint: disable-msg = W0612
- status, shout, runtime = sosGetCommandOutput(prog)
- return status
-
- def collectExtOutput(self, exe, suggest_filename = None, root_symlink = None, timeout = 300):
- """
- Run a program and collect the output
- """
- self.collectProgs.append( (exe, suggest_filename, root_symlink, timeout) )
-
- def fileGrep(self, regexp, fname):
- try:
- return [l for l in open(fname).readlines() if re.match(regexp, l)]
- except: # IOError, AttributeError, etc.
- return []
-
- def mangleCommand(self, exe):
- # FIXME: this can be improved
- mangledname = re.sub(r"^/(usr/|)(bin|sbin)/", "", exe)
- mangledname = re.sub(r"[^\w\-\.\/]+", "_", mangledname)
- mangledname = re.sub(r"/", ".", mangledname).strip(" ._-")[0:64]
- return mangledname
-
- def makeCommandFilename(self, exe):
- """ The internal function to build up a filename based on a command """
-
- outfn = self.cInfo['cmddir'] + "/" + self.piName + "/" + self.mangleCommand(exe)
-
- # check for collisions
- if os.path.exists(outfn):
- inc = 2
- while True:
- newfn = "%s_%d" % (outfn, inc)
- if not os.path.exists(newfn):
- outfn = newfn
- break
- inc +=1
-
- return outfn
-
- def collectOutputNow(self, exe, suggest_filename = None, root_symlink = False, timeout = 300):
- """ Execute a command and save the output to a file for inclusion in
- the report
- """
-
- # pylint: disable-msg = W0612
- status, shout, runtime = sosGetCommandOutput(exe, timeout = timeout)
-
- if suggest_filename:
- outfn = self.makeCommandFilename(suggest_filename)
- else:
- outfn = self.makeCommandFilename(exe)
-
- if not os.path.isdir(os.path.dirname(outfn)):
- os.mkdir(os.path.dirname(outfn))
-
- if not (status == 127 or status == 32512): # if not command_not_found
- outfd = open(outfn, "w")
- if len(shout): outfd.write(shout+"\n")
- outfd.close()
-
- if root_symlink:
- curdir = os.getcwd()
- os.chdir(self.cInfo['dstroot'])
- try: os.symlink(outfn[len(self.cInfo['dstroot'])+1:], root_symlink.strip("/."))
- except: pass
- os.chdir(curdir)
-
- outfn_strip = outfn[len(self.cInfo['cmddir'])+1:]
-
- else:
- self.soslog.log(logging.VERBOSE, "could not run command: %s" % exe)
- outfn = None
- outfn_strip = None
-
- # sosStatus(status)
- # save info for later
- self.executedCommands.append({'exe': exe, 'file':outfn_strip}) # save in our list
- self.cInfo['xmlreport'].add_command(cmdline=exe,exitcode=status,f_stdout=outfn_strip,runtime=runtime)
- return outfn
-
- def writeTextToCommand(self, exe, text):
- """ A function that allows you to write a random text string to the
- command output location referenced by exe; this is useful if you want
- to conditionally collect information, but still want the output file
- to exist so as not to confuse readers """
-
- outfn = self.makeCommandFilename(exe)
-
- if not os.path.isdir(os.path.dirname(outfn)):
- os.mkdir(os.path.dirname(outfn))
-
- outfd = open(outfn, "w")
- outfd.write(text)
- outfd.close()
-
- self.executedCommands.append({'exe': exe, 'file': outfn}) # save in our list
- return outfn
-
- # For adding warning messages regarding configuration sanity
- def addDiagnose(self, alertstring):
- """ Add a configuration sanity warning for this plugin. These
- will be displayed on-screen before collection and in the report as well.
- """
- self.diagnose_msgs.append(alertstring)
- return
-
- # For adding output
- def addAlert(self, alertstring):
- """ Add an alert to the collection of alerts for this plugin. These
- will be displayed in the report
- """
- self.alerts.append(alertstring)
- return
-
-
- def addCustomText(self, text):
- """ Append text to the custom text that is included in the report. This
- is freeform and can include html.
- """
- self.customText = self.customText + text
- return
-
- def doCollect(self):
- """ This function has been replaced with copyStuff(threaded = True). Please change your
- module calls. Calling setup() now.
- """
- return self.copyStuff(threaded = True)
-
- def isRunning(self):
- """
- if threaded, is thread running ?
- """
- if self.thread: return self.thread.is_alive()
- return None
-
- def wait(self,timeout=None):
- """
- wait for a thread to complete - only called for threaded execution
- """
- self.thread.join(timeout)
- return self.thread.is_alive()
-
- def copyStuff(self, threaded = False, semaphore = None):
- """
- Collect the data for a plugin
- """
- if threaded and self.thread == None:
- self.thread = Process(target=self.copyStuff, name=self.piName+'-thread', args = [True, semaphore] )
- self.thread.start()
- return self.thread
-
- if semaphore: semaphore.acquire()
-
- if self.must_exit:
- semaphore.release()
- return
-
- self.soslog.log(logging.VERBOSE, "starting threaded plugin %s" % self.piName)
-
- self.time_start = time()
- self.time_stop = None
-
- for path in self.copyPaths:
- self.soslog.debug("copying pathspec %s" % path)
- try:
- self.doCopyFileOrDir(path)
- except SystemExit:
- if semaphore: semaphore.release()
- if threaded: return KeyboardInterrupt
- else: raise KeyboardInterrupt
- except KeyboardInterrupt:
- if semaphore: semaphore.release()
- if threaded: return KeyboardInterrupt
- else: raise KeyboardInterrupt
- except Exception, e:
- self.soslog.log(logging.VERBOSE2, "error copying from pathspec %s (%s), traceback follows:" % (path,e))
- self.soslog.log(logging.VERBOSE2, traceback.format_exc())
- for (prog, suggest_filename, root_symlink, timeout) in self.collectProgs:
- self.soslog.debug("collecting output of '%s'" % prog)
- try:
- self.collectOutputNow(prog, suggest_filename, root_symlink, timeout)
- except SystemExit:
- if semaphore: semaphore.release()
- if threaded: return SystemExit
- else: raise SystemExit
- except KeyboardInterrupt:
- if semaphore: semaphore.release()
- if threaded: return KeyboardInterrupt
- else: raise KeyboardInterrupt
- except Exception, e:
- self.soslog.log(logging.VERBOSE2, "error collection output of '%s', traceback follows:" % prog)
- self.soslog.log(logging.VERBOSE2, traceback.format_exc())
-
- self.time_stop = time()
-
- if semaphore: semaphore.release()
- self.soslog.log(logging.VERBOSE, "plugin %s returning" % self.piName)
-
- def exit_please(self):
- """ This function tells the plugin that it should exit ASAP"""
- self.must_exit = True
-
- def get_description(self):
- """ This function will return the description for the plugin"""
- try:
- return self.__doc__.strip()
- except:
- return ""
-
- def checkenabled(self):
- """ This function can be overidden to let the plugin decide whether
- it should run or not.
- """
- # some files or packages have been specified for this package
- if len(self.files) or len(self.packages):
- for fname in self.files:
- if os.path.exists(fname):
- return True
- for pkgname in self.packages:
- if self.isInstalled(pkgname):
- return True
- return False
-
- return True
-
- def defaultenabled(self):
- """This devices whether a plugin should be automatically loaded or
- only if manually specified in the command line."""
- return True
-
- def collect(self):
- """ This function has been replaced with setup(). Please change your
- module calls. Calling setup() now.
- """
- self.setup()
-
- def diagnose(self):
- """This class must be overridden to check the sanity of the system's
- configuration before the collection begins.
- """
- pass
-
- def setup(self):
- """This class must be overridden to add the copyPaths, forbiddenPaths,
- and external programs to be collected at a minimum.
- """
- pass
-
- def analyze(self):
- """
- perform any analysis. To be replaced by a plugin if desired
- """
- pass
-
- def postproc(self):
- """
- perform any postprocessing. To be replaced by a plugin if desired
- """
- pass
-
- def report(self):
- """ Present all information that was gathered in an html file that allows browsing
- the results.
- """
- # make this prettier
- html = '\n' % self.piName
-
- # Intro
- html = html + "
Plugin " + self.piName + "
\n"
-
- # Files
- if len(self.copiedFiles):
- html = html + "
Files copied:
\n"
- for afile in self.copiedFiles:
- html = html + '
%s' % (afile['dstpath'], afile['srcpath'])
- if (afile['symlink'] == "yes"):
- html = html + " (symlink to %s)" % afile['pointsto']
- html = html + '
\n'
- html = html + "
\n"
-
- # Dirs
- if len(self.copiedDirs):
- html = html + "
Directories Copied:
\n"
- for adir in self.copiedDirs:
- html = html + '
%s\n' % (adir['dstpath'], adir['srcpath'])
- if (adir['symlink'] == "yes"):
- html = html + " (symlink to %s)" % adir['pointsto']
- html = html + '
\n'
- html = html + "
\n"
-
- # Command Output
- if len(self.executedCommands):
- html = html + "
Commands Executed:
\n"
- # convert file name to relative path from our root
- for cmd in self.executedCommands:
- if cmd["file"] and len(cmd["file"]):
- cmdOutRelPath = sosRelPath(self.cInfo['rptdir'], self.cInfo['cmddir'] + "/" + cmd['file'])
- html = html + '
')
- if not (rr == 3):
- rfd.write('')
- rfd.write('
\n')
-
- rfd.write('
Alerts:
')
- rfd.write('
')
- for alert in allAlerts:
- rfd.write('
%s
' % alert)
- rfd.write('
')
-
-
- # Call the report method for each plugin
- for plugname, plug in loadedplugins:
- try:
- html = plug.report()
- except:
- if __raisePlugins__:
- raise
- else:
- rfd.write(html)
-
- rfd.write("")
-
- rfd.close()
-
- # Call the postproc method for each plugin
- for plugname, plug in loadedplugins:
- try:
- plug.postproc()
- except:
- if __raisePlugins__:
- raise
-
- # package up the results for the support organization
- policy.packageResults()
-
- # delete gathered files
- policy.cleanDstroot()
-
- # let's encrypt the tar-ball
- #if __cmdLineOpts__.encrypt:
- # policy.encryptResults()
-
- # automated submission will go here
- if not __cmdLineOpts__.upload:
- policy.displayResults()
- else:
- policy.uploadResults()
-
- # Close all log files and perform any cleanup
- logging.shutdown()
-
-if __name__ == '__main__':
- try:
- sosreport()
- except KeyboardInterrupt:
- doExitCode()
-
diff --git a/src/sosreport.1 b/src/sosreport.1
deleted file mode 100644
index 495ce416..00000000
--- a/src/sosreport.1
+++ /dev/null
@@ -1,67 +0,0 @@
-.TH SOSREPORT 1 "Tue Feb 20 2007"
-.SH NAME
-sosreport \- Generate debugging information for this system
-.SH SYNOPSIS
-.B sosreport
- [-l|--list-plugins]\fR
- [-n|--skip-plugins plugin-names]\fR
- [-e|--enable-plugins plugin-names]\fR
- [-o|--only-plugins plugin-names]\fR
- [-a|--alloptions] [-v|--verbose]
- [--no-multithread] [--no-progressbar]
-.SH DESCRIPTION
-\fBsosreport\fR generates a compressed tarball of debugging information
-for the system it is run on that can be sent to technical support
-reps that will give them a more complete view of the overall system
-status.
-.SH OPTIONS
-.TP
-.B \-l, \--list-plugins
-This will list all available plugins showing which ones will be enabled by the current configuration. It will also show all plugin options which can be
-modified using the -k option (see below).
-.TP
-.B \-n, --skip-plugins PLUGNAME[,PLUGNAME]
-Do not load specified plugin(s). To specify multiple plugins, separate them with a comma.
-.TP
-.B \-e, --enable-plugins PLUGNAME[,PLUGNAME]
-Enable the specified plugin(s). To specify multiple plugins, separate them with a comma.
-.TP
-.B \-o, --only-plugins PLUGNAME[,PLUGNAME]
-Enable the specified plugin(s) only (all other plugins should be disabled). To specify multiple plugins, separate them with a comma.
-.TP
-.B \-k PLUGNAME.PLUGOPT[=VALUE]
-This is used to specify options for plugins. A list of available plugin options can be obtained from the output of --list-plugins.
-If no value is specified and the option is a boolean (on/off), it will be set to "on".
-.TP
-.B \-a, \--alloptions
-Enable all (boolean) options for all loaded plugins.
-.TP
-.B \--upload
-Upload the report to Red Hat (use exclusively if advised from a Red Hat support representative).
-.TP
-.B \-v, \--verbose
-Increase the verbosity of the output as sosreport is running. Multiple -v mean more verbosity.
-.TP
-.B \--no-progressbar
-Do not display a progress bar (ETA will not be available).
-.TP
-.B \--no-multithread
-Disable multithreaded collection and analysis of the sosreport data.
-.SH MAINTAINER
-.nf
-Navid Sheikhol-Eslami
-.fi
-.SH AUTHORS
-.nf
-Steve Conklin
-John Berninger
-Pierre Amadio
-Adam Stokes
-.fi
-.SH THANKS TO
-.nf
-Eva Schaller for providing an Italian translation
-Marco Ceci for helping me out with the cluster plugin
-Leonardo Macchia for being my personal regexp generator
-Imed Chihi for providing Arabic and French translations
-.fi
diff --git a/src/tests/commons.py b/src/tests/commons.py
deleted file mode 100644
index fd389dd8..00000000
--- a/src/tests/commons.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# commons.py
-import sys, os
-
-commons = {}
-commons['bin'] = '/usr/sbin/sosreport'
-commons['testName'] = 'tester'
-commons['testID'] = 1
-commons['batch'] = True
-commons['i18n'] = 'en_US.UTF-8'
-commons['pluginpath'] = None
-commons['plugins'] = []
-if os.path.isfile('/etc/fedora-release'):
- commons['distro'] = 'Fedora'
-else:
- commons['distro'] = 'RHEL'
-
-paths = sys.path
-for path in paths:
- if path.strip()[-len("site-packages"):] == "site-packages" \
- and os.path.isdir(path + "/sos/plugins"):
- commons['pluginpath'] = path + "/sos/plugins"
-
-for plugin in os.listdir(commons['pluginpath']):
- plugbase = plugin[:-3]
- if not plugin[-3:] == '.py' or plugbase == "__init__":
- continue
- commons['plugins'].append(plugbase)
-
diff --git a/src/tests/testBasic.py b/src/tests/testBasic.py
deleted file mode 100644
index 8338091d..00000000
--- a/src/tests/testBasic.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import os
-from glob import glob
-from subprocess import Popen, PIPE
-from commons import *
-from nose import with_setup
-
-def setup_func():
- for report in glob("/tmp/sosreport*"):
- os.remove(report)
-
-def teardown_func():
- for report in glob("/tmp/sosreport*"):
- os.remove(report)
-
-def testSosreportBin():
- """ test existence of sosreport bin """
- if not os.path.isfile(commons['bin']):
- raise AssertionError("Sosreport executable does not exist")
-
-# mostly sanity checks on plugins
-@with_setup(setup_func, teardown_func)
-def testUnattended():
- """ test batch mode """
- (out, err) = Popen([commons['bin'],'-ofilesys','--batch'],
- stdout=PIPE,stderr=PIPE).communicate()
- output = out
- if not len(glob('/tmp/sosreport-*.bz2')):
- raise AssertionError("No sosreport created.")
-
-@with_setup(setup_func, teardown_func)
-def testUnattendedNameTicket():
- """ test for --name/--ticket within sosreport file """
- (out, err) = Popen([commons['bin'],'-ofilesys','--name=%s' % (commons['testName'],),
- '--ticket-number=%d' % (commons['testID'],),'--batch'],stdout=PIPE,
- stderr=PIPE).communicate()
- if not len(glob('/tmp/sosreport-%s.%d-*bz2' % (commons['testName'],commons['testID']))):
- raise AssertionError("Can not determine sosreport")
-
-# plugin specific tests
diff --git a/src/tests/test_plugin_syntax.py b/src/tests/test_plugin_syntax.py
deleted file mode 100644
index 1b0ae31d..00000000
--- a/src/tests/test_plugin_syntax.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import unittest
-import sys
-import os
-import sos.policyredhat
-from sos.helpers import *
-
-class testPluginSanity(unittest.TestCase):
- def setUp(self):
- self.policy = sos.policyredhat.SosPolicy()
- # build plugins list
- paths = sys.path
- for path in paths:
- if path.strip()[-len("site-packages"):] == "site-packages" \
- and os.path.isdir(path + "/sos/plugins"):
- pluginpath = path + "/sos/plugins"
- self.plugins = os.listdir(pluginpath)
- self.plugins.sort()
-
- def test_plugin_load(self):
- for plug in self.plugins:
- plugbase = plug[:-3]
- if not plug[-3:] == '.py' or plugbase == "__init__":
- continue
- try:
- loadPlugin = importPlugin("sos.plugins." + plugbase, plugbase)
- except:
- self.fail("Plugin exception on %s" % (plugbase,))
-
-if __name__=="__main__":
- suite = unittest.TestLoader().loadTestsFromTestCase(testPluginSanity)
- unittest.TextTestRunner(verbosity=2).run(suite)
-
diff --git a/src/tools/msgfmt.py b/src/tools/msgfmt.py
deleted file mode 100644
index 8a2d4e66..00000000
--- a/src/tools/msgfmt.py
+++ /dev/null
@@ -1,203 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# Written by Martin v. Löwis
-
-"""Generate binary message catalog from textual translation description.
-
-This program converts a textual Uniforum-style message catalog (.po file) into
-a binary GNU catalog (.mo file). This is essentially the same function as the
-GNU msgfmt program, however, it is a simpler implementation.
-
-Usage: msgfmt.py [OPTIONS] filename.po
-
-Options:
- -o file
- --output-file=file
- Specify the output file to write to. If omitted, output will go to a
- file named filename.mo (based off the input file name).
-
- -h
- --help
- Print this message and exit.
-
- -V
- --version
- Display version information and exit.
-"""
-
-import sys
-import os
-import getopt
-import struct
-import array
-
-__version__ = "1.1"
-
-MESSAGES = {}
-
-
-
-def usage(code, msg=''):
- print >> sys.stderr, __doc__
- if msg:
- print >> sys.stderr, msg
- sys.exit(code)
-
-
-
-def add(id, str, fuzzy):
- "Add a non-fuzzy translation to the dictionary."
- global MESSAGES
- if not fuzzy and str:
- MESSAGES[id] = str
-
-
-
-def generate():
- "Return the generated output."
- global MESSAGES
- keys = MESSAGES.keys()
- # the keys are sorted in the .mo file
- keys.sort()
- offsets = []
- ids = strs = ''
- for id in keys:
- # For each string, we need size and file offset. Each string is NUL
- # terminated; the NUL does not count into the size.
- offsets.append((len(ids), len(id), len(strs), len(MESSAGES[id])))
- ids += id + '\0'
- strs += MESSAGES[id] + '\0'
- output = ''
- # The header is 7 32-bit unsigned integers. We don't use hash tables, so
- # the keys start right after the index tables.
- # translated string.
- keystart = 7*4+16*len(keys)
- # and the values start after the keys
- valuestart = keystart + len(ids)
- koffsets = []
- voffsets = []
- # The string table first has the list of keys, then the list of values.
- # Each entry has first the size of the string, then the file offset.
- for o1, l1, o2, l2 in offsets:
- koffsets += [l1, o1+keystart]
- voffsets += [l2, o2+valuestart]
- offsets = koffsets + voffsets
- output = struct.pack("Iiiiiii",
- 0x950412deL, # Magic
- 0, # Version
- len(keys), # # of entries
- 7*4, # start of key index
- 7*4+len(keys)*8, # start of value index
- 0, 0) # size and offset of hash table
- output += array.array("i", offsets).tostring()
- output += ids
- output += strs
- return output
-
-
-
-def make(filename, outfile):
- ID = 1
- STR = 2
-
- # Compute .mo name from .po name and arguments
- if filename.endswith('.po'):
- infile = filename
- else:
- infile = filename + '.po'
- if outfile is None:
- outfile = os.path.splitext(infile)[0] + '.mo'
-
- try:
- lines = open(infile).readlines()
- except IOError, msg:
- print >> sys.stderr, msg
- sys.exit(1)
-
- section = None
- fuzzy = 0
-
- # Parse the catalog
- lno = 0
- for l in lines:
- lno += 1
- # If we get a comment line after a msgstr, this is a new entry
- if l[0] == '#' and section == STR:
- add(msgid, msgstr, fuzzy)
- section = None
- fuzzy = 0
- # Record a fuzzy mark
- if l[:2] == '#,' and l.find('fuzzy'):
- fuzzy = 1
- # Skip comments
- if l[0] == '#':
- continue
- # Now we are in a msgid section, output previous section
- if l.startswith('msgid'):
- if section == STR:
- add(msgid, msgstr, fuzzy)
- section = ID
- l = l[5:]
- msgid = msgstr = ''
- # Now we are in a msgstr section
- elif l.startswith('msgstr'):
- section = STR
- l = l[6:]
- # Skip empty lines
- l = l.strip()
- if not l:
- continue
- # XXX: Does this always follow Python escape semantics?
- l = eval(l)
- if section == ID:
- msgid += l
- elif section == STR:
- msgstr += l
- else:
- print >> sys.stderr, 'Syntax error on %s:%d' % (infile, lno), \
- 'before:'
- print >> sys.stderr, l
- sys.exit(1)
- # Add last entry
- if section == STR:
- add(msgid, msgstr, fuzzy)
-
- # Compute output
- output = generate()
-
- try:
- open(outfile,"wb").write(output)
- except IOError,msg:
- print >> sys.stderr, msg
-
-
-
-def main():
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'hVo:',
- ['help', 'version', 'output-file='])
- except getopt.error, msg:
- usage(1, msg)
-
- outfile = None
- # parse options
- for opt, arg in opts:
- if opt in ('-h', '--help'):
- usage(0)
- elif opt in ('-V', '--version'):
- print >> sys.stderr, "msgfmt.py", __version__
- sys.exit(0)
- elif opt in ('-o', '--output-file'):
- outfile = arg
- # do it
- if not args:
- print >> sys.stderr, 'No input file given'
- print >> sys.stderr, "Try `msgfmt --help' for more information."
- return
-
- for filename in args:
- make(filename, outfile)
-
-
-if __name__ == '__main__':
- main()
diff --git a/src/tools/pygettext.py b/src/tools/pygettext.py
deleted file mode 100644
index 040b5c7f..00000000
--- a/src/tools/pygettext.py
+++ /dev/null
@@ -1,762 +0,0 @@
-#! /usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-# Originally written by Barry Warsaw
-#
-# Minimally patched to make it even more xgettext compatible
-# by Peter Funk
-#
-# 2002-11-22 Jürgen Hermann
-# Added checks that _() only contains string literals, and
-# command line args are resolved to module lists, i.e. you
-# can now pass a filename, a module or package name, or a
-# directory (including globbing chars, important for Win32).
-# Made docstring fit in 80 chars wide displays using pydoc.
-#
-
-import codecs
-
-# for selftesting
-import re
-try:
- import fintl
- _ = fintl.gettext
-except ImportError:
- _ = lambda s: s
-
-__doc__ = _("""pygettext -- Python equivalent of xgettext(1)
-
-Many systems (Solaris, Linux, Gnu) provide extensive tools that ease the
-internationalization of C programs. Most of these tools are independent of
-the programming language and can be used from within Python programs.
-Martin von Loewis' work[1] helps considerably in this regard.
-
-There's one problem though; xgettext is the program that scans source code
-looking for message strings, but it groks only C (or C++). Python
-introduces a few wrinkles, such as dual quoting characters, triple quoted
-strings, and raw strings. xgettext understands none of this.
-
-Enter pygettext, which uses Python's standard tokenize module to scan
-Python source code, generating .pot files identical to what GNU xgettext[2]
-generates for C and C++ code. From there, the standard GNU tools can be
-used.
-
-A word about marking Python strings as candidates for translation. GNU
-xgettext recognizes the following keywords: gettext, dgettext, dcgettext,
-and gettext_noop. But those can be a lot of text to include all over your
-code. C and C++ have a trick: they use the C preprocessor. Most
-internationalized C source includes a #define for gettext() to _() so that
-what has to be written in the source is much less. Thus these are both
-translatable strings:
-
- gettext("Translatable String")
- _("Translatable String")
-
-Python of course has no preprocessor so this doesn't work so well. Thus,
-pygettext searches only for _() by default, but see the -k/--keyword flag
-below for how to augment this.
-
- [1] http://www.python.org/workshops/1997-10/proceedings/loewis.html
- [2] http://www.gnu.org/software/gettext/gettext.html
-
-NOTE: pygettext attempts to be option and feature compatible with GNU
-xgettext where ever possible. However some options are still missing or are
-not fully implemented. Also, xgettext's use of command line switches with
-option arguments is broken, and in these cases, pygettext just defines
-additional switches.
-
-Usage: pygettext [options] inputfile ...
-
-Options:
-
- -a
- --extract-all
- Extract all strings.
-
- -d name
- --default-domain=name
- Rename the default output file from messages.pot to name.pot.
-
- -E
- --escape
- Replace non-ASCII characters with octal escape sequences.
-
- -D
- --docstrings
- Extract module, class, method, and function docstrings. These do
- not need to be wrapped in _() markers, and in fact cannot be for
- Python to consider them docstrings. (See also the -X option).
-
- -h
- --help
- Print this help message and exit.
-
- -k word
- --keyword=word
- Keywords to look for in addition to the default set, which are:
- %(DEFAULTKEYWORDS)s
-
- You can have multiple -k flags on the command line.
-
- -K
- --no-default-keywords
- Disable the default set of keywords (see above). Any keywords
- explicitly added with the -k/--keyword option are still recognized.
-
- --no-location
- Do not write filename/lineno location comments.
-
- -n
- --add-location
- Write filename/lineno location comments indicating where each
- extracted string is found in the source. These lines appear before
- each msgid. The style of comments is controlled by the -S/--style
- option. This is the default.
-
- -o filename
- --output=filename
- Rename the default output file from messages.pot to filename. If
- filename is `-' then the output is sent to standard out.
-
- -p dir
- --output-dir=dir
- Output files will be placed in directory dir.
-
- -S stylename
- --style stylename
- Specify which style to use for location comments. Two styles are
- supported:
-
- Solaris # File: filename, line: line-number
- GNU #: filename:line
-
- The style name is case insensitive. GNU style is the default.
-
- -v
- --verbose
- Print the names of the files being processed.
-
- -V
- --version
- Print the version of pygettext and exit.
-
- -w columns
- --width=columns
- Set width of output to columns.
-
- -x filename
- --exclude-file=filename
- Specify a file that contains a list of strings that are not be
- extracted from the input files. Each string to be excluded must
- appear on a line by itself in the file.
-
- -X filename
- --no-docstrings=filename
- Specify a file that contains a list of files (one per line) that
- should not have their docstrings extracted. This is only useful in
- conjunction with the -D option above.
-
-If `inputfile' is -, standard input is read.
-""")
-
-import os
-import imp
-import sys
-import glob
-import time
-import getopt
-import token
-import tokenize
-import operator
-import codecs
-
-from elementtree.ElementTree import ElementTree, XML
-
-__version__ = '1.5'
-
-default_keywords = ['_']
-DEFAULTKEYWORDS = ', '.join(default_keywords)
-
-EMPTYSTRING = ''
-
-
-
-# The normal pot-file header. msgmerge and Emacs's po-mode work better if it's
-# there.
-pot_header = _('''\
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR ORGANIZATION
-# FIRST AUTHOR , YEAR.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\\n"
-"POT-Creation-Date: %(time)s\\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n"
-"Last-Translator: FULL NAME \\n"
-"Language-Team: LANGUAGE \\n"
-"MIME-Version: 1.0\\n"
-"Content-Type: text/plain; charset=%(charset)s\\n"
-"Content-Transfer-Encoding: %(charset)s\\n"
-"Generated-By: pygettext.py %(version)s\\n"
-
-''')
-
-
-def usage(code, msg=''):
- print >> sys.stderr, __doc__ % globals()
- if msg:
- print >> sys.stderr, msg
- sys.exit(code)
-
-
-
-escapes = []
-
-def make_escapes(pass_iso8859):
- global escapes
- if pass_iso8859:
- # Allow iso-8859 characters to pass through so that e.g. 'msgid
- # "Höhe"' would result not result in 'msgid "H\366he"'. Otherwise we
- # escape any character outside the 32..126 range.
- mod = 128
- else:
- mod = 256
- for i in range(256):
- if 32 <= (i % mod) <= 126:
- escapes.append(chr(i))
- else:
- escapes.append("\\%03o" % i)
- escapes[ord('\\')] = '\\\\'
- escapes[ord('\t')] = '\\t'
- escapes[ord('\r')] = '\\r'
- escapes[ord('\n')] = '\\n'
- escapes[ord('\"')] = '\\"'
-
-
-def escape_ascii(s):
- "Escapes all text outside of 7bit ASCII plus control characters and Python literals."
- global escapes
- s = list(s)
- for i in range(len(s)):
- s[i] = escapes[ord(s[i])]
- return EMPTYSTRING.join(s)
-
-def escape_unicode(s):
- "Escapes control characters and Python literals only leaving non-ascii text intact."
- #for sp in ('\t', '\r', '\n', '\"', '\\'):
- s = s.replace('\\', '\\\\')
- s = s.replace('\t', '\\t')
- s = s.replace('\r', '\\r')
- s = s.replace('\n', '\\n')
- s = s.replace('\"', '\\"')
- # escape control chars
- def repl(m): return "\\%03o" % ord(m.group(0))
- s = re.sub('[\001-\037]', repl, s)
- return s
-
-def safe_eval(s):
- # unwrap quotes, safely
- return eval(s, {'__builtins__':{}}, {})
-
-
-def normalize(s, escape=False):
- # This converts the various Python string types into a format that is
- # appropriate for .po files, namely much closer to C style.
- lines = s.split('\n')
- if len(lines) == 1:
- s = '"' + escape_unicode(s) + '"'
- else:
- if not lines[-1]:
- del lines[-1]
- lines[-1] = lines[-1] + '\n'
- for i in range(len(lines)):
- lines[i] = escape_unicode(lines[i])
- lineterm = '\\n"\n"'
- s = '""\n"' + lineterm.join(lines) + '"'
- if isinstance(s, unicode):
- s = s.encode('utf-8')
- if escape:
- def repl(m): return "\\%03o" % ord(m.group(0))
- s = re.sub('[\200-\377]', repl, s)
- return s
-
-
-def containsAny(str, set):
- """Check whether 'str' contains ANY of the chars in 'set'"""
- return 1 in [c in str for c in set]
-
-
-def _visit_pyfiles(list, dirname, names):
- """Helper for getFilesForName()."""
- # get extension for python source files
- if not globals().has_key('_py_ext'):
- global _py_ext
- _py_ext = [triple[0] for triple in imp.get_suffixes()
- if triple[2] == imp.PY_SOURCE][0]
-
- # don't recurse into CVS directories
- if 'CVS' in names:
- names.remove('CVS')
- if '.svn' in names:
- names.remove('.svn')
-
- # add all *.py files to list
- list.extend(
- [os.path.join(dirname, file) for file in names
- if os.path.splitext(file)[1] == _py_ext]
- )
-
-
-def _get_modpkg_path(dotted_name, pathlist=None):
- """Get the filesystem path for a module or a package.
-
- Return the file system path to a file for a module, and to a directory for
- a package. Return None if the name is not found, or is a builtin or
- extension module.
- """
- # split off top-most name
- parts = dotted_name.split('.', 1)
-
- if len(parts) > 1:
- # we have a dotted path, import top-level package
- try:
- file, pathname, description = imp.find_module(parts[0], pathlist)
- if file: file.close()
- except ImportError:
- return None
-
- # check if it's indeed a package
- if description[2] == imp.PKG_DIRECTORY:
- # recursively handle the remaining name parts
- pathname = _get_modpkg_path(parts[1], [pathname])
- else:
- pathname = None
- else:
- # plain name
- try:
- file, pathname, description = imp.find_module(
- dotted_name, pathlist)
- if file:
- file.close()
- if description[2] not in [imp.PY_SOURCE, imp.PKG_DIRECTORY]:
- pathname = None
- except ImportError:
- pathname = None
-
- return pathname
-
-
-def getFilesForName(name):
- """Get a list of module files for a filename, a module or package name,
- or a directory.
- """
- if not os.path.exists(name):
- # check for glob chars
- if containsAny(name, "*?[]"):
- files = glob.glob(name)
- list = []
- for file in files:
- list.extend(getFilesForName(file))
- return list
-
- # try to find module or package
- name = _get_modpkg_path(name)
- if not name:
- return []
-
- if os.path.isdir(name):
- # find all python files in directory
- list = []
- os.path.walk(name, _visit_pyfiles, list)
- return list
- elif os.path.exists(name):
- # a single file
- return [name]
-
- return []
-
-
-class TokenEater:
- def __init__(self, options):
- self.__options = options
- self.__messages = {}
- self.__state = self.__waiting
- self.__data = []
- self.__lineno = -1
- self.__freshmodule = 1
- self.__curfile = None
- self.__encoding = None
-
- def __call__(self, ttype, tstring, stup, etup, line):
- # dispatch
-## import token
-## print >> sys.stderr, 'ttype:', token.tok_name[ttype], \
-## 'tstring:', tstring
- self.__state(ttype, tstring, stup[0])
-
- def __waiting(self, ttype, tstring, lineno):
- opts = self.__options
- # Do docstring extractions, if enabled
- if opts.docstrings and not opts.nodocstrings.get(self.__curfile):
- # module docstring?
- if self.__freshmodule:
- if ttype == tokenize.STRING:
- self.__addentry(safe_eval(tstring), lineno, isdocstring=1)
- self.__freshmodule = 0
- elif ttype not in (tokenize.COMMENT, tokenize.NL):
- self.__freshmodule = 0
- return
- # class docstring?
- if ttype == tokenize.NAME and tstring in ('class', 'def'):
- self.__state = self.__suiteseen
- return
- if ttype == tokenize.NAME and tstring in opts.keywords:
- self.__state = self.__keywordseen
-
- def __suiteseen(self, ttype, tstring, lineno):
- # ignore anything until we see the colon
- if ttype == tokenize.OP and tstring == ':':
- self.__state = self.__suitedocstring
-
- def __suitedocstring(self, ttype, tstring, lineno):
- # ignore any intervening noise
- if ttype == tokenize.STRING:
- self.__addentry(safe_eval(tstring), lineno, isdocstring=1)
- self.__state = self.__waiting
- elif ttype not in (tokenize.NEWLINE, tokenize.INDENT,
- tokenize.COMMENT):
- # there was no class docstring
- self.__state = self.__waiting
-
- def __keywordseen(self, ttype, tstring, lineno):
- if ttype == tokenize.OP and tstring == '(':
- self.__data = []
- self.__lineno = lineno
- self.__state = self.__openseen
- else:
- self.__state = self.__waiting
-
- def __openseen(self, ttype, tstring, lineno):
- if ttype == tokenize.OP and tstring == ')':
- # We've seen the last of the translatable strings. Record the
- # line number of the first line of the strings and update the list
- # of messages seen. Reset state for the next batch. If there
- # were no strings inside _(), then just ignore this entry.
- if self.__data:
- self.__addentry(EMPTYSTRING.join(self.__data))
- self.__state = self.__waiting
- elif ttype == tokenize.STRING:
- self.__data.append(safe_eval(tstring))
- elif ttype not in [tokenize.COMMENT, token.INDENT, token.DEDENT,
- token.NEWLINE, tokenize.NL]:
- # warn if we see anything else than STRING or whitespace
- print >> sys.stderr, _(
- '*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"'
- ) % {
- 'token': tstring,
- 'file': self.__curfile,
- 'lineno': self.__lineno
- }
- self.__state = self.__waiting
-
- def __addentry(self, msg, lineno=None, isdocstring=0, iskidstring=0):
- # tokenize module always return unicode strings
- # even when they are in fact coded string instances
- # to deal with this we use a hack:
- # evaluate string's representation without leading "u"
- # to force interpration as coded string
- # then we decode it using already known file's encoding
- if not iskidstring:
- if type(msg) is str:
- msg = eval(repr(msg))
- else:
- msg = eval(repr(msg)[1:])
- msg = msg.decode(self.__encoding)
- if lineno is None:
- lineno = self.__lineno
- if not msg in self.__options.toexclude:
- entry = (self.__curfile, lineno)
- self.__messages.setdefault(msg, {})[entry] = isdocstring
-
- def set_filename(self, filename):
- self.__curfile = filename
- self.__freshmodule = 1
-
- def set_file_encoding(self, fp):
- """Searches for -*- coding: -*- magic comment to find out file encoding."""
- self.__encoding = 'utf-8' # reset to default for each new file
- for line in fp.readlines()[:5]:
- m = re.match('#\s*-\*-\s+coding:\s+(\w+)\s+-\*-', line)
- if m:
- self.__encoding = m.group(1)
- break
- fp.seek(0)
-
- def contains_inline_python(self,msg):
- if '${' in msg and not '$${' in msg: return True
- return False
-
- def strip_namespace_uri(self,tag):
- return tag.split('}')[-1]
-
- def get_text_node(self,node):
- tag = re.sub('({[^}]+})?(\w+)', '\\2', node.tag)
-
- if node.text:
- msg = node.text.strip()
- if msg and not self.contains_inline_python(msg):
- if tag not in ['script','style']:
- self.__addentry(msg,self.strip_namespace_uri(node.tag), iskidstring=1)
-
- if node.getchildren():
- for child in node: self.get_text_node(child)
-
- if node.tail:
- msg = node.tail.strip()
- if msg and not self.contains_inline_python(msg):
- self.__addentry(msg,self.strip_namespace_uri(node.tag), iskidstring=1)
-
- def extract_kid_strings(self):
- if not self.__curfile: return
- f = None
- try:
- file = open(self.__curfile)
- f = ElementTree(XML( fixentities(file.read() )))
- except Exception, e:
- print 'Skip %s: %s' % (self.__curfile, e)
- return
-
- node = f.getroot()
- self.get_text_node(node)
-
- def write(self, fp):
- options = self.__options
- # format without tz information
- # because %Z is timezone's name, not offset
- # and, say, on localized Windows XP this is non-ascii string
- timestamp = time.strftime('%Y-%m-%d %H:%M')
- # The time stamp in the header doesn't have the same format as that
- # generated by xgettext...
- t = {'time': timestamp, 'version': __version__, 'charset':'utf-8'}
- print >> fp, pot_header % t
- # Sort the entries. First sort each particular entry's keys, then
- # sort all the entries by their first item.
- reverse = {}
- for k, v in self.__messages.items():
- keys = v.keys()
- keys.sort()
- reverse.setdefault(tuple(keys), []).append((k, v))
- rkeys = reverse.keys()
- rkeys.sort()
- for rkey in rkeys:
- rentries = reverse[rkey]
- rentries.sort()
- for k, v in rentries:
- isdocstring = 0
- # If the entry was gleaned out of a docstring, then add a
- # comment stating so. This is to aid translators who may wish
- # to skip translating some unimportant docstrings.
- if reduce(operator.__add__, v.values()):
- isdocstring = 1
- # k is the message string, v is a dictionary-set of (filename,
- # lineno) tuples. We want to sort the entries in v first by
- # file name and then by line number.
- v = v.keys()
- v.sort()
- if not options.writelocations:
- pass
- # location comments are different b/w Solaris and GNU:
- elif options.locationstyle == options.SOLARIS:
- for filename, lineno in v:
- d = {'filename': filename, 'lineno': lineno}
- print >>fp, _(
- '# File: %(filename)s, line: %(lineno)s') % d
- elif options.locationstyle == options.GNU:
- # fit as many locations on one line, as long as the
- # resulting line length doesn't exceeds 'options.width'
- locline = '#:'
- for filename, lineno in v:
- d = {'filename': filename, 'lineno': lineno}
- s = _(' %(filename)s:%(lineno)s') % d
- if len(locline) + len(s) <= options.width:
- locline = locline + s
- else:
- print >> fp, locline
- locline = "#:" + s
- if len(locline) > 2:
- print >> fp, locline
- if isdocstring:
- print >> fp, '#, docstring'
- if k: # do not output empty msgid
- print >> fp, 'msgid', normalize(k, options.escape)
- print >> fp, 'msgstr ""\n'
-
-
-def main():
- global default_keywords
- try:
- opts, args = getopt.getopt(
- sys.argv[1:],
- 'ad:UDEhk:Kno:p:S:Vvw:x:X:',
- ['extract-all', 'default-domain=', 'escape', 'help',
- 'keyword=', 'no-default-keywords',
- 'add-location', 'no-location', 'output=', 'output-dir=',
- 'style=', 'verbose', 'version', 'width=', 'exclude-file=',
- 'docstrings', 'no-docstrings', 'support-unicode',
- ])
- except getopt.error, msg:
- usage(1, msg)
-
- # for holding option values
- class Options:
- # constants
- GNU = 1
- SOLARIS = 2
- # defaults
- extractall = 0 # FIXME: currently this option has no effect at all.
- escape = 0
- keywords = []
- outpath = ''
- outfile = 'messages.pot'
- writelocations = 1
- locationstyle = GNU
- verbose = 0
- width = 78
- excludefilename = ''
- docstrings = 0
- nodocstrings = {}
-
- options = Options()
- locations = {'gnu' : options.GNU,
- 'solaris' : options.SOLARIS,
- }
-
- # parse options
- for opt, arg in opts:
- if opt in ('-h', '--help'):
- usage(0)
- elif opt in ('-a', '--extract-all'):
- options.extractall = 1
- elif opt in ('-d', '--default-domain'):
- options.outfile = arg + '.pot'
- elif opt in ('-E', '--escape'):
- options.escape = 1
- elif opt in ('-D', '--docstrings'):
- options.docstrings = 1
- elif opt in ('-k', '--keyword'):
- options.keywords.append(arg)
- elif opt in ('-K', '--no-default-keywords'):
- default_keywords = []
- elif opt in ('-n', '--add-location'):
- options.writelocations = 1
- elif opt in ('--no-location',):
- options.writelocations = 0
- elif opt in ('-S', '--style'):
- options.locationstyle = locations.get(arg.lower())
- if options.locationstyle is None:
- usage(1, _('Invalid value for --style: %s') % arg)
- elif opt in ('-o', '--output'):
- options.outfile = arg
- elif opt in ('-p', '--output-dir'):
- options.outpath = arg
- elif opt in ('-v', '--verbose'):
- options.verbose = 1
- elif opt in ('-V', '--version'):
- print _('pygettext.py (xgettext for Python) %s') % __version__
- sys.exit(0)
- elif opt in ('-w', '--width'):
- try:
- options.width = int(arg)
- except ValueError:
- usage(1, _('--width argument must be an integer: %s') % arg)
- elif opt in ('-x', '--exclude-file'):
- options.excludefilename = arg
- elif opt in ('-X', '--no-docstrings'):
- fp = open(arg)
- try:
- while 1:
- line = fp.readline()
- if not line:
- break
- options.nodocstrings[line[:-1]] = 1
- finally:
- fp.close()
-
- # calculate escapes
- make_escapes(0)
-
- # calculate all keywords
- options.keywords.extend(default_keywords)
-
- # initialize list of strings to exclude
- if options.excludefilename:
- try:
- fp = open(options.excludefilename)
- options.toexclude = fp.readlines()
- fp.close()
- except IOError:
- print >> sys.stderr, _(
- "Can't read --exclude-file: %s") % options.excludefilename
- sys.exit(1)
- else:
- options.toexclude = []
-
- # resolve args to module lists
- expanded = []
- for arg in args:
- if arg == '-':
- expanded.append(arg)
- else:
- expanded.extend(getFilesForName(arg))
- args = expanded
-
- # slurp through all the files
- eater = TokenEater(options)
- for filename in args:
- if filename == '-':
- if options.verbose:
- print _('Reading standard input')
- fp = sys.stdin
- closep = 0
- else:
- if options.verbose:
- print _('Working on %s') % filename
- fp = open(filename)
- eater.set_file_encoding(fp)
- closep = 1
- try:
- eater.set_filename(filename)
- try:
- tokenize.tokenize(fp.readline, eater)
- except tokenize.TokenError, e:
- print >> sys.stderr, '%s: %s, line %d, column %d' % (
- e[0], filename, e[1][0], e[1][1])
- finally:
- if closep:
- fp.close()
-
- if os.path.splitext(filename)[-1].lower() == '.kid': eater.extract_kid_strings()
-
- # write the output
- if options.outfile == '-':
- fp = sys.stdout
- closep = 0
- else:
- if options.outpath:
- options.outfile = os.path.join(options.outpath, options.outfile)
- fp = open(options.outfile, 'wt')
- closep = 1
- try:
- eater.write(fp)
- finally:
- if closep:
- fp.close()
-
-
-if __name__ == '__main__':
- main()
- # some more test strings
- _(u'a unicode string')
- # this one creates a warning
- _('*** Seen unexpected token "%(token)s"') % {'token': 'test'}
- _('more' 'than' 'one' 'string')
--
cgit