summaryrefslogtreecommitdiff
path: root/monitor/josef_experimental.py
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/josef_experimental.py')
-rwxr-xr-xmonitor/josef_experimental.py33
1 files changed, 30 insertions, 3 deletions
diff --git a/monitor/josef_experimental.py b/monitor/josef_experimental.py
index 31453ca..07d2bba 100755
--- a/monitor/josef_experimental.py
+++ b/monitor/josef_experimental.py
@@ -178,6 +178,27 @@ def email(s):
stderr=subprocess.PIPE)
p.communicate(s)
+def write_roots_data(filename, data):
+
+ print "Looking for logfile..."
+ if os.path.exists(filename):
+ os.remove(filename)
+ print "Removing " + filename
+ else:
+ print "Could not find " + filename
+
+ with open(filename, 'a') as f:
+ count = 0
+ for i in reversed(range(1,11)):
+ for j in range(data[i]):
+
+ count += 1
+ # print str(count) + " " + str(i) + "\n"
+ f.write(str(count) + " " + str(i) + "\n")
+
+ f.close()
+
+
def list_roots():
logs = [
@@ -188,7 +209,7 @@ def list_roots():
"digicert-roots",
"izenpe-roots",
"symantec-roots",
- "venafi-roots",
+ # "venafi-roots",
"wosign-roots",
"vega-roots",
]
@@ -208,18 +229,24 @@ def count_and_remove(item, listlist):
l.remove(item)
if len(l) == 0:
listlist.remove(l)
+ # if count >= 6:
+ # with open(OUTPUT_DIR + "aviator-roots/" + item) as f:
+ # content = f.read()
+ # print get_cert_info(base64.b64decode(content))["issuer"]
return count
if __name__ == '__main__':
if True:
all_roots = list_roots()
- res = {1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0}
+ res = {10:0,9:0,8:0,7:0,6:0,5:0,4:0,3:0,2:0,1:0}
while len(all_roots) != 0:
count = count_and_remove(all_roots[0][0],all_roots)
res[count] += 1
- print res
+ write_roots_data("testfile", res)
+ # print res
+