1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#!/usr/bin/env python ############################################# # # # stat daily equities ref_data file # ############################################# import os import sys import datetime import time # Nagios return values nagiosRetValOk = 0 nagiosRetValWarn = 1 nagiosRetValCritical = 2 now = datetime.datetime.now().strftime("%H:%M:%S") dateFormat = datetime.datetime.now().strftime("%Y%m%d") try: statinfo = os.stat("/mnt/histarchive_san/ref_data/%s/us_equities.%s" \ % (dateFormat, dateFormat)) except: print "CRITICAL! Unable to open ref data file for %s" \ % dateFormat sys.exit(nagiosRetValCritical) print "OK! StatInfo %s" % statinfo sys.exit(nagiosRetValOk) |