munkireport_parser.py
def uptime_report(record, report):
    """Generate report when computer is up for too long"""
    threshold = 90  # timestamp > 90 days
    if record[REPORT_TIMESTAMP] is not None:
        uptime = (time.time() - int(record[REPORT_TIMESTAMP])) / 86400
        checkin = time.ctime(int(record[REPORT_TIMESTAMP]))
        if uptime > threshold:
            add_problem(
                report,
                "Uptime",
                "Uptime {} days. Last checkin: {}".format(int(uptime), checkin),
                determine_acknowledgement(record, report, "ack-uptime"),
            )
Generate report when computer is up for too long
Generate report when computer is up for too long
Generate report when computer is up for too long
def uptime_report(record, report):
    threshold = 90  
    if record[REPORT_TIMESTAMP] is not None:
        uptime = (time.time() - int(record[REPORT_TIMESTAMP])) / 86400
        checkin = time.ctime(int(record[REPORT_TIMESTAMP]))
        if uptime > threshold:
            add_problem(
                report,
                "Uptime",
                "Uptime {} days. Last checkin: {}".format(int(uptime), checkin),
                determine_acknowledgement(record, report, "ack-uptime"),
            )
def uptime_report ( record , report ) : threshold = 90 if record [ REPORT_TIMESTAMP ] is not None : uptime = ( time . time ( ) - int ( record [ REPORT_TIMESTAMP ] ) ) / 86400 checkin = time . ctime ( int ( record [ REPORT_TIMESTAMP ] ) ) if uptime > threshold : add_problem ( report , "Uptime" , "Uptime {} days. Last checkin: {}" . format ( int ( uptime ) , checkin ) , determine_acknowledgement ( record , report , "ack-uptime" ) , )
Generate report when computer is up for too long
Generate report when computer is up for too long
"""Generate report when computer is up for too long""" # timestamp > 90 days
record
report