From 8911235b1ffd9a04e4c525e170d9466d118aa4fe Mon Sep 17 00:00:00 2001 From: KAiTO <929654790@qq.com> Date: Fri, 11 Aug 2023 15:06:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E7=8A=B6=E6=80=81=E5=B7=A1=E6=A3=80=E7=9A=84=E6=9C=AA?= =?UTF-8?q?=E6=9D=A5=E8=A7=84=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Server_Status/Server_Inspection.go | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Inspection_items/Server_Status/Server_Inspection.go diff --git a/Inspection_items/Server_Status/Server_Inspection.go b/Inspection_items/Server_Status/Server_Inspection.go new file mode 100644 index 0000000..3d7f8a5 --- /dev/null +++ b/Inspection_items/Server_Status/Server_Inspection.go @@ -0,0 +1,54 @@ +package main + +func main() { + //此处作为服务器巡检 + /* + 1.硬件配置信息 + + 1.1机器型号 + [root@gip 20230810]# dmidecode | grep "Product Name" + Product Name: Standard PC (i440FX + PIIX, 1996) + 1.2CPU + [root@gip 20230810]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c + 8 QEMU Virtual CPU version 2.0. + 1.3内存 + [root@gip 20230810]# free -m + 1.4磁盘 + [root@gip 20230810]# df -h + 1.5 网卡 + [root@gip 20230810]# ifconfig -a + 1.6操作系统 + [root@gip 20230810]# uname -a + + 2. 性能检查 + + 2.1 CPU占用率 top + cpu每个线程占用率小于80% + + 2.2 CPU负载 uptinme + [root@gip 20230810]# uptime + 14:49:50 up 31 min, 2 users, load average: 0.01, 0.04, 0.05 + CPU负载应小于10 + 1分钟内的平均负载是0.01 + 5分钟内的平均负载是0.04 + 15分钟内的平均负载是0.05 + + 2.3内存占用率 + [kaito@db160 ~]$ free -m 内存使用率小于80% + + 2.4 内存swap使用率 free -m 小于10 + + 2.5 磁盘使用率 小于80% df-ah + + 2.6磁盘负载 iostat xkd 1 util应在10% 以内 + + + 2.7 系统开放端口 无关端口要关闭 netstat -an | grep LISTEN + + 2.8 网卡流量 iftop 网卡流量小于宽带的50% + + 2.9 进程检查 ps aux | more 关闭占用资源的无用进程 + + + */ +} -- Gitee From 8f056a51ce8af1bec3f9ceb2aa8b99e64eebf23d Mon Sep 17 00:00:00 2001 From: shujin Date: Sun, 13 Aug 2023 22:51:23 +0800 Subject: [PATCH 2/2] fix --- Export_module/Export.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Export_module/Export.go b/Export_module/Export.go index d76447f..dcf378a 100644 --- a/Export_module/Export.go +++ b/Export_module/Export.go @@ -71,7 +71,7 @@ func Export() { //切成4线程 steps := int(math.Ceil(float64(count) / float64(4))) for i := 0; i < 4; i++ { - fileName := fmt.Sprintf("%s/%d.csv", dirPath, i) + fileName := fmt.Sprintf("%s/%s-%d.csv", dirPath, table_name, i) sharding := steps * i go CV_EXPORTS(sharding, steps, table_name, fileName) time.Sleep(time.Second) -- Gitee