前言
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
}
]
}