服务器监控
GET https://www.dunlv.com/api/server-monitors/
curl --request GET \
--url 'https://www.dunlv.com/api/server-monitors/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.dunlv.com/api/server-monitors/' \
--header 'Authorization: Bearer {api_key}' \
参数 | 详情 | 描述 |
---|---|---|
page | 可选 整数 | 您希望获取结果的页码。默认值为 1 。 |
results_per_page | 可选 整数 | 每页的结果数量。允许值为:10 , 25 , 50 , 100 , 250 , 500 , 1000 。默认值为 25 。 |
{
"data": [
{
"id": 1,
"project_id": 0,
"name": "Sample",
"target": "123.123.123.123",
"settings": {
"server_check_interval_seconds": 60
},
"cpu_usage": 0.7,
"ram_usage": 30.65,
"disk_usage": 16.49,
"cpu_load_1": 0,
"cpu_load_5": 0,
"cpu_load_15": 0,
"is_enabled": true,
"total_logs": 100,
"last_log_datetime": "2024-01-14 02:45:05",
"datetime": "2025-02-05 19:13:31",
"last_datetime": null
}
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://www.dunlv.com/api/server-monitors?&page=1",
"last": "https://www.dunlv.com/api/server-monitors?&page=1",
"next": null,
"prev": null,
"self": "https://www.dunlv.com/api/server-monitors?&page=1"
}
}
GET https://www.dunlv.com/api/server-monitors/{server_monitor_id}
curl --request GET \
--url 'https://www.dunlv.com/api/server-monitors/{server_monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.dunlv.com/api/server-monitors/{server_monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"project_id": 0,
"name": "Sample",
"target": "123.123.123.123",
"settings": {
"server_check_interval_seconds": 60
},
"cpu_usage": 0.7,
"ram_usage": 30.65,
"disk_usage": 16.49,
"cpu_load_1": 0,
"cpu_load_5": 0,
"cpu_load_15": 0,
"is_enabled": true,
"total_logs": 100,
"last_log_datetime": "2024-01-14 02:45:05",
"datetime": "2025-02-05 19:13:31",
"last_datetime": null
}
}
POST https://www.dunlv.com/api/server-monitors
参数 | 详情 | 描述 |
---|---|---|
name | 必需 字符串 | - |
target | 必需 字符串 | - |
project_id | 可选 整数 | - |
notifications | 可选 数组 | 通知处理程序 ID |
server_check_interval_seconds | 可选 整数 | 允许值:60 , 300 , 600 , 900 , 1800 (秒) |
alert_metric[key] | 可选 字符串 | 允许值:cpu_usage , disk_usage , ram_usage |
alert_rule[key] | 可选 字符串 | 允许值:is_higher , is_lower |
alert_value[key] | 可选 字符串 | 允许值:1-99 |
alert_trigger[key] | 可选 字符串 | 允许值:1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 |
is_enabled | 可选 布尔值 | - |
curl --request POST \
--url 'https://www.dunlv.com/api/server-monitors' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'target=example.com' \
--url 'https://www.dunlv.com/api/server-monitors' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'target=example.com' \
{
"data": {
"id": 1
}
}
POST https://www.dunlv.com/api/server-monitors/{server_monitor_id}
参数 | 详情 | 描述 |
---|---|---|
name | 必需 字符串 | - |
target | 必需 字符串 | - |
project_id | 可选 整数 | - |
notifications | 可选 数组 | 通知处理程序 ID |
server_check_interval_seconds | 可选 整数 | 允许值:60 , 300 , 600 , 900 , 1800 (秒) |
alert_metric[key] | 可选 字符串 | 允许值:cpu_usage , disk_usage , ram_usage |
alert_rule[key] | 可选 字符串 | 允许值:is_higher , is_lower |
alert_value[key] | 可选 字符串 | 允许值:1-99 |
alert_trigger[key] | 可选 字符串 | 允许值:1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 |
is_enabled | 可选 布尔值 | - |
curl --request POST \
--url 'https://www.dunlv.com/api/server-monitors/{server_monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--url 'https://www.dunlv.com/api/server-monitors/{server_monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
{
"data": {
"id": 1
}
}
DELETE https://www.dunlv.com/api/server-monitors/{server_monitor_id}
curl --request DELETE \
--url 'https://www.dunlv.com/api/server-monitors/{server_monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.dunlv.com/api/server-monitors/{server_monitor_id}' \
--header 'Authorization: Bearer {api_key}' \