]> git.pld-linux.org Git - packages/linux-pstore.git/commitdiff
- 0.2; report hostname and uptime auto/th/linux-pstore-0.2-1
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 22 Feb 2019 05:57:53 +0000 (06:57 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 22 Feb 2019 05:57:53 +0000 (06:57 +0100)
linux-pstore.py
linux-pstore.spec

index a215d0a311060c16f1e46ce1300a5b714101c7ae..ee8a64745c234edf808f6a1ab2668d6f753384db 100755 (executable)
@@ -4,7 +4,15 @@
 import datetime
 import os
 import re
+import socket
 import shutil
+import time
+
+uptime = True
+try:
+    import psutil
+except ModuleNotFoundError as e:
+    uptime = False
 
 pstoredir = '/sys/fs/pstore'
 archivedir = '/var/log/pstore'
@@ -19,7 +27,10 @@ files = sorted(os.listdir(pstoredir))
 if len(files) and not os.path.isdir(tdir):
     os.mkdir(tdir)
 
-msg = "Found %d files in pstore fs directory: \n\n" % len(files)
+msg =  "Hostname:           %s\n" % socket.getfqdn()
+if uptime:
+    msg += "Uptime:             %s\n" % str(datetime.timedelta(seconds=time.time()-psutil.boot_time()))
+msg += "Files in pstore:    %d\n" % len(files)
 
 for file in files:
     fpath = os.path.join(pstoredir, file)
index a3a9cfe4969c83a63be58f4328b8b8a84f1e8447..5fb959b22681c7abe6fdbcd8504c3c44c268b2be 100644 (file)
@@ -1,6 +1,6 @@
 Summary:       Save pstore logs and make room for future logs
 Name:          linux-pstore
-Version:       0.1
+Version:       0.2
 Release:       1
 License:       GPL
 Group:         Daemons
@@ -11,6 +11,7 @@ BuildRequires:        rpmbuild(macros) >= 1.268
 Requires:      crondaemon
 Requires:      python3
 Requires:      python3-modules
+Requires:      python3-psutil
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
This page took 0.132229 seconds and 4 git commands to generate.