diff options
author | Josef Gustafsson <josef.gson@gmail.com> | 2015-09-04 09:19:40 +0200 |
---|---|---|
committer | Josef Gustafsson <josef.gson@gmail.com> | 2015-09-04 09:19:40 +0200 |
commit | 34fd84e7e414e8a72fee25a2f91d3cd189ad30a1 (patch) | |
tree | 19993f60e9a803a23aaed914fe1db2858b5bdee5 | |
parent | 8db244bd474ca5334933da927968ae4d1c3af525 (diff) |
Bugfix for nagios plugin
-rwxr-xr-x | tools/josef_nagios_auditor.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/josef_nagios_auditor.py b/tools/josef_nagios_auditor.py index 05390f8..41fefd0 100755 --- a/tools/josef_nagios_auditor.py +++ b/tools/josef_nagios_auditor.py @@ -147,13 +147,13 @@ def verify_consistency(url, old, new): print time.strftime('%H:%M:%S') + " Verification of old hash failed! " + old["sha256_root_hash"] + str(base64.b64encode(res[0])) sys.exit(NAGIOS_CRIT) # errors.append(time.strftime('%H:%M:%S') + " ERROR: Failed to verify consistency for " + url + ", tree size " + old[url]["tree_size"]) - elif new[url]["sha256_root_hash"] != str(base64.b64encode(res[1])): + elif new["sha256_root_hash"] != str(base64.b64encode(res[1])): print time.strftime('%H:%M:%S') + " Verification of new hash failed! " + new["sha256_root_hash"] + str(base64.b64encode(res[1])) sys.exit(NAGIOS_CRIT) # errors.append(time.strftime('%H:%M:%S') + " ERROR: Failed to verify consistency for " + url + ", tree size " + new[url]["tree_size"]) - else: - print time.strftime("%H:%M:%S") + " New STH from " + url + ", timestamp: " + \ - str(new["timestamp"]) + ", size: " + str(new["tree_size"]) + "...OK." + # else: + # print time.strftime("%H:%M:%S") + " New STH from " + url + ", timestamp: " + \ + # str(new["timestamp"]) + ", size: " + str(new["tree_size"]) + "...OK." except: print time.strftime('%H:%M:%S') + " ERROR: Could not verify consistency for " + url @@ -164,8 +164,8 @@ def verify_inclusion_all(url, old, new): try: if old["tree_size"]!= new["tree_size"]: entries = [] - while len(entries) + old[url]["tree_size"]!= new[url]["tree_size"]: - entries += get_entries(url, str(int(old[url]["tree_size"]) + len(entries)), new[url]["tree_size"] -1)["entries"] + while len(entries) + old["tree_size"]!= new["tree_size"]: + entries += get_entries(url, str(int(old["tree_size"]) + len(entries)), new["tree_size"] -1)["entries"] success = True for i in entries: |