From b502b9f51b4d314ed6fa76d66a6db8aea7d32c12 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sun, 31 May 2015 16:00:16 +0200 Subject: [PATCH 1/8] [startup] rename plugin to 'services' The plugin is supposed to collect information about services rather than about their startup. Signed-off-by: Pavel Moravec --- sos/plugins/services.py | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ sos/plugins/startup.py | 56 ------------------------------------------------- 2 files changed, 56 insertions(+), 56 deletions(-) create mode 100644 sos/plugins/services.py delete mode 100644 sos/plugins/startup.py diff --git a/sos/plugins/services.py b/sos/plugins/services.py new file mode 100644 index 0000000..606a135 --- /dev/null +++ b/sos/plugins/services.py @@ -0,0 +1,56 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class Services(Plugin): + """System services + """ + + plugin_name = "services" + profiles = ('system', 'boot') + + option_list = [("servicestatus", "get a status of all running services", + "slow", False)] + + def setup(self): + self.add_copy_spec([ + "/etc/inittab", + "/etc/rc.d" + ]) + if self.get_option('servicestatus'): + self.add_cmd_output("/sbin/service --status-all") + self.add_cmd_output("/sbin/runlevel") + + +class RedHatServices(Services, RedHatPlugin): + + def setup(self): + super(RedHatServices, self).setup() + self.add_cmd_output("/sbin/chkconfig --list", root_symlink="chkconfig") + + +class DebianServices(Services, DebianPlugin, UbuntuPlugin): + + def setup(self): + super(DebianServices, self).setup() + self.add_copy_spec("/etc/rc*.d") + + self.add_cmd_output("/sbin/initctl show-config", + root_symlink="initctl") + if self.get_option('servicestatus'): + self.add_cmd_output("/sbin/initctl list") + +# vim: et ts=4 sw=4 diff --git a/sos/plugins/startup.py b/sos/plugins/startup.py deleted file mode 100644 index 9d92370..0000000 --- a/sos/plugins/startup.py +++ /dev/null @@ -1,56 +0,0 @@ -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin - - -class Startup(Plugin): - """System startup - """ - - plugin_name = "startup" - profiles = ('system', 'boot') - - option_list = [("servicestatus", "get a status of all running services", - "slow", False)] - - def setup(self): - self.add_copy_spec([ - "/etc/inittab", - "/etc/rc.d" - ]) - if self.get_option('servicestatus'): - self.add_cmd_output("/sbin/service --status-all") - self.add_cmd_output("/sbin/runlevel") - - -class RedHatStartup(Startup, RedHatPlugin): - - def setup(self): - super(RedHatStartup, self).setup() - self.add_cmd_output("/sbin/chkconfig --list", root_symlink="chkconfig") - - -class DebianStartup(Startup, DebianPlugin, UbuntuPlugin): - - def setup(self): - super(DebianStartup, self).setup() - self.add_copy_spec("/etc/rc*.d") - - self.add_cmd_output("/sbin/initctl show-config", - root_symlink="initctl") - if self.get_option('servicestatus'): - self.add_cmd_output("/sbin/initctl list") - -# vim: et ts=4 sw=4 -- 1.8.3.1 From 5204d62fdb362fb5cc4a897c90faa9539715fc74 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Tue, 7 Jul 2015 13:03:14 +0200 Subject: [PATCH 2/8] [services] add "ls /var/lock/subsys" Signed-off-by: Pavel Moravec --- sos/plugins/services.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sos/plugins/services.py b/sos/plugins/services.py index 606a135..ab9f8ce 100644 --- a/sos/plugins/services.py +++ b/sos/plugins/services.py @@ -32,7 +32,10 @@ class Services(Plugin): ]) if self.get_option('servicestatus'): self.add_cmd_output("/sbin/service --status-all") - self.add_cmd_output("/sbin/runlevel") + self.add_cmd_output([ + "/sbin/runlevel", + "ls /var/lock/subsys" + ]) class RedHatServices(Services, RedHatPlugin): -- 1.8.3.1 From e00447e7ee346aa3be685a91ebba7cf208c4f205 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sun, 31 May 2015 16:04:19 +0200 Subject: [PATCH 3/8] [ntp] Collect "ntpq -p" output Partially solves #570 Signed-off-by: Pavel Moravec --- sos/plugins/ntp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sos/plugins/ntp.py b/sos/plugins/ntp.py index 0e39b9d..c0f731d 100644 --- a/sos/plugins/ntp.py +++ b/sos/plugins/ntp.py @@ -30,7 +30,10 @@ class Ntp(Plugin): "/etc/ntp/step-tickers", "/etc/ntp/ntpservers" ]) - self.add_cmd_output("ntptime") + self.add_cmd_output([ + "ntptime", + "ntpq -p" + ]) class RedHatNtp(Ntp, RedHatPlugin): -- 1.8.3.1 From 83ef3aff955a33bb58c578479ac6b63a615b4521 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sun, 31 May 2015 16:07:06 +0200 Subject: [PATCH 4/8] [networking] Collect "ethtool -T $NIC" Partially solves #570 Signed-off-by: Pavel Moravec --- sos/plugins/networking.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py index f2b06a6..b2c74c1 100644 --- a/sos/plugins/networking.py +++ b/sos/plugins/networking.py @@ -184,6 +184,7 @@ class Networking(Plugin): "ethtool -i "+eth, "ethtool -k "+eth, "ethtool -S "+eth, + "ethtool -T "+eth, "ethtool -a "+eth, "ethtool -c "+eth, "ethtool -g "+eth -- 1.8.3.1 From 002cef3eddc288352d0b92f6272fbd2e85280e6e Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sun, 31 May 2015 16:17:40 +0200 Subject: [PATCH 5/8] [ptp] Add new plugin for Precision time protocol Partially resolves #570 Signed-off-by: Pavel Moravec --- sos/plugins/ptp.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sos/plugins/ptp.py diff --git a/sos/plugins/ptp.py b/sos/plugins/ptp.py new file mode 100644 index 0000000..a6ac648 --- /dev/null +++ b/sos/plugins/ptp.py @@ -0,0 +1,36 @@ +# Copyright (C) 2015 Pavel Moravec + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class Ptp(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + """Precision time protocol + """ + + plugin_name = "ptp" + profiles = ('system', 'services') + + packages = ('linuxptp',) + + def setup(self): + self.add_copy_spec([ + "/etc/ptp4l.conf", + "/etc/timemaster.conf", + "/sys/class/ptp" + ]) + +# vim: et ts=4 sw=4 -- 1.8.3.1 From 72e2e32eaa97c6c76b61635dd0fafeb4dcc1aa7d Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sun, 31 May 2015 16:19:29 +0200 Subject: [PATCH 6/8] [process] Collect few "ps" outputs Partially solves $570 Signed-off-by: Pavel Moravec (edits for readability & line length) Signed-off-by: Bryn M. Reeves --- sos/plugins/process.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sos/plugins/process.py b/sos/plugins/process.py index 6ae189b..a643844 100644 --- a/sos/plugins/process.py +++ b/sos/plugins/process.py @@ -23,13 +23,20 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): profiles = ('system',) def setup(self): + ps_axo = "ps axo" + # process group and thread options + ps_group_opts = "pid,ppid,user,group,lwp,nlwp,start_time,comm,cgroup" + ps_sched_opts = "flags,state,uid,pid,ppid,pgid,sid,cls,pri,addr,sz," + ps_sched_opts += "wchan,stime,tty,time,cmd" self.add_copy_spec("/proc/sched_debug") self.add_cmd_output("ps auxwww", root_symlink="ps") self.add_cmd_output("pstree", root_symlink="pstree") self.add_cmd_output("lsof -b +M -n -l", root_symlink="lsof") self.add_cmd_output([ "ps auxwwwm", - "ps alxwww" + "ps alxwww", + "%s %s" % (ps_axo, ps_group_opts), + "%s %s" % (ps_axo, ps_sched_opts) ]) # vim: et ts=4 sw=4 -- 1.8.3.1 From 0b9a4c545582ed73f89ee4a7572ecb631633819e Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sun, 31 May 2015 16:21:28 +0200 Subject: [PATCH 7/8] [sysvipc] Collect "ipcs -u" Partially solves #570 Signed-off-by: Pavel Moravec --- sos/plugins/sysvipc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sos/plugins/sysvipc.py b/sos/plugins/sysvipc.py index a0732e7..a98abf9 100644 --- a/sos/plugins/sysvipc.py +++ b/sos/plugins/sysvipc.py @@ -29,6 +29,9 @@ class SysVIPC(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): "/proc/sysvipc/sem", "/proc/sysvipc/shm" ]) - self.add_cmd_output("ipcs") + self.add_cmd_output([ + "ipcs", + "ipcs -u" + ]) # vim: et ts=4 sw=4 -- 1.8.3.1 From fb7bbcf9e60002d75db383fac08244a7fa06a1d6 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Sun, 31 May 2015 16:24:23 +0200 Subject: [PATCH 8/8] [devices] New plugin to collect "udevadm info --export-db" Partially resolves #570 Signed-off-by: Pavel Moravec --- sos/plugins/devices.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sos/plugins/devices.py diff --git a/sos/plugins/devices.py b/sos/plugins/devices.py new file mode 100644 index 0000000..5e0283a --- /dev/null +++ b/sos/plugins/devices.py @@ -0,0 +1,28 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class Devices(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + """ devices specific commands + """ + + plugin_name = 'devices' + profiles = ('system', 'hardware', 'boot') + + def setup(self): + self.add_cmd_output("udevadm info --export-db") + +# vim: et ts=4 sw=4 -- 1.8.3.1 From c05fa2947937a5adc3496c4e66b649633de054e9 Mon Sep 17 00:00:00 2001 From: Alexandru Juncu Date: Tue, 24 Feb 2015 18:28:04 +0100 Subject: [PATCH] [last] information about login actions This is useful information to be correlated with shutdown/reboot events in /var/log/messages to identify graceful shutdowns/reboots and lower false positives about system crashes. Resolves #572. Signed-off-by: Alexandru Juncu Signed-off-by: Bryn M. Reeves --- sos/plugins/last.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sos/plugins/last.py diff --git a/sos/plugins/last.py b/sos/plugins/last.py new file mode 100644 index 0000000..d6b791d --- /dev/null +++ b/sos/plugins/last.py @@ -0,0 +1,33 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class Last(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + """login information + """ + + plugin_name = 'last' + profiles = ('system',) + + def setup(self): + self.add_cmd_output("last", root_symlink="last") + self.add_cmd_output([ + "last reboot", + "last shutdown", + "lastlog" + ]) + +# vim: et ts=4 sw=4 -- 1.8.3.1