check_server

监测提醒程序,根据配置文件检测指定服务,如果服务异常或服务状态在预期外则针对该服务发出通知

配置文件说明

{
    "sms": {                                        //阿里云短信服务参数
        "ak": "********",
        "sk": "********",
        "singName": "********",
        "templateCode": "********"
    },
    "http": [
        {
            "name": "gitlab",                       //服务名称
            "address": "http://gitlab.sunwaywh.top",//服务地址
            "interval": 600,                        //检测间隔(秒),默认60
            "expect": [                             //预期状态码
                200,
                301
            ],
            "phones": [                             //接收通知手机号
                "15272829933",
                "13554122184"
            ]
        },
        {
            "name": "doc",
            "address": "http://doc.sunwaywh.top",
            "expect": [
                200
            ],
            "phones": [
                "13554122184"
            ]
        },
        {
            "name": "index",
            "url": "http://www.sunwaywh.top",
            "expect": [
                200
            ],
            "phones": [
                "15272829933"
            ]
        }
    ],
    "tcp": [
        {
            "name": "mysql",
            "address": "106.13.18.102:3306",
            "phones": [
                "13554122184",
                "15272829933"
            ]
        },
        {
            "name": "mongodb",
            "address": "106.13.18.102:27017",
            "phones": [
                "13554122184",
                "15272829933"
            ]
        }
    ]
}