aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Juncu <alexj@linux.com>2015-02-24 18:28:04 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-07-08 18:31:51 +0100
commitc05fa2947937a5adc3496c4e66b649633de054e9 (patch)
tree624a77373110c29d0e130411cae78a553fc88c36
parentb0c3b9e32072bc940e66d66d07b1c12edf58e106 (diff)
downloadsos-c05fa2947937a5adc3496c4e66b649633de054e9.tar.gz
[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 <alexj@linux.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/last.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/sos/plugins/last.py b/sos/plugins/last.py
new file mode 100644
index 00000000..d6b791d8
--- /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