summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2015-05-21 10:24:42 +0200
committerLinus Nordberg <linus@nordberg.se>2015-05-21 10:24:42 +0200
commitc0b55dfde41a11f11b673b96b2c6fddadadd2641 (patch)
treea61c67b1312028f89ac896d6cb6d5cf813890844 /tools
parentb07ae789548e07c522e19758e3b3d154df64694a (diff)
Add --quiet-ok.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-sth.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/check-sth.py b/tools/check-sth.py
index 823ca2c..0cdc031 100755
--- a/tools/check-sth.py
+++ b/tools/check-sth.py
@@ -30,6 +30,7 @@ parser.add_argument('publickey', help='File containing the public key for the CT
parser.add_argument('baseurl', help="Base URL for CT log")
parser.add_argument('--cafile', default=None, metavar='file', help='File containing the CA cert')
parser.add_argument('--allow-lag', action='store_true', help='Allow node to lag behind previous STH')
+parser.add_argument('--quiet-ok', action='store_true', help="Don't print status if OK")
def print_sth(sth):
if sth is None:
@@ -129,7 +130,8 @@ def main(args):
write_file(args.cur_sth, newsth)
- print "OK: size: %d hash: %s, %s" % (newsth["tree_size"], b64_to_b16(newsth["sha256_root_hash"])[:8], age)
+ if not args.quiet_ok:
+ print "OK: size: %d hash: %s, %s" % (newsth["tree_size"], b64_to_b16(newsth["sha256_root_hash"])[:8], age)
sys.exit(NAGIOS_OK)
if __name__ == '__main__':