安装Uptime Kuma监控

前言
Uptime Kuma 是一款开源的在线监控工具,可以用来监控服务器的运行状态。

获取镜像

docker pull louislam/uptime-kuma:latest

配置docker-compose.yml

mkdir -p /opt/docker/uptime-kuma/ && cd /opt/docker/uptime-kuma/
cat docker-compose.yml
version: '3.3'
services:
  uptime-kuma:
    image: louislam/uptime-kuma:latest
    container_name: uptime_kuma
    volumes:
      - "/etc/localtime:/etc/localtime"
      - "./data:/app/data:rw"
    environment:          
      TZ: Asia/Shanghai      
    ports:      
      - "3001:3001"       
    restart: always
    logging:
      driver: "json-file"
      options:
        max-size: "128m"
        max-file: "3"

启动

docker-compose up -d

访问



## docker-compose.yml

```yaml
version: '3.3'
services:
  uptime-kuma:
    image: louislam/uptime-kuma:latest
    container_name: uptime_kuma
    volumes:
      - ./data:/app/data:rw
    environment:          
      TZ: Asia/Shanghai      
    ports:      
      - "3001:3001"       
    restart: always
    logging:
      driver: "json-file"
      options:
        max-size: "128m"
        max-file: "3"  



## json文件

```yaml
{
    "version": "1.17.1",
    "notificationList": [
        {
            "id": 1,
            "name": "钉钉自定义机器人 通知(1)",
            "config": "{\"name\":\"钉钉自定义机器人 通知(1)\",\"type\":\"DingDing\",\"isDefault\":true,\"webHookUrl\":\"https://oapi.dingtalk.com/robot/send?access_token=5aeef272f505d597dd24012a01f03fb306edcc706d27fdd07\",\"secretKey\":\"SECa0ab7d2608dab49d97042ce4445d2019cbbe952a35dd43\",\"applyExisting\":true}",
            "active": true,
            "userId": 1,
            "isDefault": true
        }
    ],
    "monitorList": [
        {
            "id": 1,
            "name": “百度主页",
            "url": "https://www.baidu.com/",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 60,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 2,
            "name": "百度新闻主页",
            "url": "https://news.baidu.com/",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 3,
            "name": "某某公司-api",
            "url": "https://console.xxx.com/api/swagger-resources",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 3,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 20,
            "retryInterval": 20,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 4,
            "name": "xx-fdfs",
            "url": "https://fdfs.xxx.com",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 5,
            "name": "xx主页",
            "url": "https://www.xx.com",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 6,
            "name": "xx主页",
            "url": "https://www.xxx.com/",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 7,
            "name": "xxx主页",
            "url": "https://xx.yunxuetang.cn",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": "basic",
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": "15882189814",
            "basic_auth_pass": "123456",
            "pushToken": null
        },
        {
            "id": 8,
            "name": "xx官网",
            "url": "https://www.xx.com/",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 9,
            "name": "xx主页",
            "url": "https://www.xx.com/",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        },
        {
            "id": 11,
            "name": "xx主页",
            "url": "http://xxx.com/",
            "method": "GET",
            "hostname": null,
            "port": null,
            "maxretries": 2,
            "weight": 2000,
            "active": 1,
            "type": "http",
            "interval": 30,
            "retryInterval": 30,
            "keyword": null,
            "expiryNotification": true,
            "ignoreTls": false,
            "upsideDown": false,
            "maxredirects": 10,
            "accepted_statuscodes": [
                "200-299"
            ],
            "dns_resolve_type": "A",
            "dns_resolve_server": "1.1.1.1",
            "dns_last_result": null,
            "proxyId": null,
            "notificationIDList": {},
            "tags": [],
            "mqttUsername": null,
            "mqttPassword": null,
            "mqttTopic": null,
            "mqttSuccessMessage": null,
            "databaseConnectionString": null,
            "databaseQuery": null,
            "authMethod": null,
            "authWorkstation": null,
            "authDomain": null,
            "headers": null,
            "body": null,
            "basic_auth_user": null,
            "basic_auth_pass": null,
            "pushToken": null
        }
    ]
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值