(request)
return check_template
Template used to create check.
Template used to create check.
Template used to create check .
def noit_check_template(request):
    """
    Template used to create check.
    """
    check_template = {
        "check": {
            "attributes": {
                "name": request["name"],
                "module": request["module"],
                "target": request["target"],
                "period": request["period"],
                "timeout": request["timeout"],
                "filterset": request["filterset"]
            },
            "config": {
                "code": ".*",
                "header_123key.test": "400",
                "header_message123": "test",
                "method": "GET",
                "url": "http://127.0.0.1:32321/.well-known/404",
                "redirects": 10,
                "read_limit": 4567777
            },
            "state": {
                "running": "false",
                "killed": "false",
                "configured": "true",
                "disabled": "false",
                "target_ip": "23.253.6.64",
                "last_run": {
                    "@now": "1422323039.361",
                    "#text": "1422323039.357"
                },
                "runtime": "0.958",
                "availability": "available",
                "state": "good",
                "status": "code=200,rt=0.957s,bytes=44779,sslerror",
                "metrics": [
                    {
                        "@type": "inprogress"
                    },
                    {
                        "@type": "current",
                        "@timestamp": str(time.time())
                    }
                ]
            }
        }
    }
    return check_template
def noit_check_template ( request ) : check_template = { "check" : { "attributes" : { "name" : request [ "name" ] , "module" : request [ "module" ] , "target" : request [ "target" ] , "period" : request [ "period" ] , "timeout" : request [ "timeout" ] , "filterset" : request [ "filterset" ] } , "config" : { "code" : ".*" , "header_123key.test" : "400" , "header_message123" : "test" , "method" : "GET" , "url" : "http://127.0.0.1:32321/.well-known/404" , "redirects" : 10 , "read_limit" : 4567777 } , "state" : { "running" : "false" , "killed" : "false" , "configured" : "true" , "disabled" : "false" , "target_ip" : "23.253.6.64" , "last_run" : { "@now" : "1422323039.361" , "#text" : "1422323039.357" } , "runtime" : "0.958" , "availability" : "available" , "state" : "good" , "status" : "code=200,rt=0.957s,bytes=44779,sslerror" , "metrics" : [ { "@type" : "inprogress" } , { "@type" : "current" , "@timestamp" : str ( time . time ( ) ) } ] } } } return check_template