Signed-off-by: Richard Marko <rma...@redhat.com>
---
 client/rhel/spacewalk-abrt/abrt    |    1 +
 client/rhel/spacewalk-abrt/abrt.py |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 client/rhel/spacewalk-abrt/abrt
 create mode 100644 client/rhel/spacewalk-abrt/abrt.py

diff --git a/client/rhel/spacewalk-abrt/abrt b/client/rhel/spacewalk-abrt/abrt
new file mode 100644
index 0000000..db7b604
--- /dev/null
+++ b/client/rhel/spacewalk-abrt/abrt
@@ -0,0 +1 @@
+abrt.check(1)=1
diff --git a/client/rhel/spacewalk-abrt/abrt.py 
b/client/rhel/spacewalk-abrt/abrt.py
new file mode 100644
index 0000000..a43419f
--- /dev/null
+++ b/client/rhel/spacewalk-abrt/abrt.py
@@ -0,0 +1,21 @@
+import os
+import sys
+sys.path.append("/usr/share/rhn/")
+
+__rhnexport__ = [ 'check' ]
+
+ABRT_DIR = '/var/spool/abrt'
+
+def check(version):
+    if not os.path.isdir(ABRT_DIR):
+        return (1, 'no ABRT_DIR "%s" found' % ABRT_DIR)
+
+    if not os.access(ABRT_DIR, os.R_OK):
+        return (2, 'no permission to read ABRT_DIR "%s"' % ABRT_DIR)
+
+    crash_dirs = [ name for name in os.listdir(ABRT_DIR) if
+        os.path.isdir(os.path.join(ABRT_DIR, name)) ]
+
+    return (0, 'abrt check completed', {
+        'num_crashes': len(crash_dirs),
+    })
-- 
1.7.10.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to