From 514e83711937ac9f5447324c218f0dbda1a62c77 Mon Sep 17 00:00:00 2001 From: Feng_Qi Date: Wed, 7 Dec 2016 12:46:49 +0800 Subject: [PATCH] update 1.0.1 net ifname --- README.md | 2 +- funcs/func_test.go | 18 ++++++++++++++---- g/const.go | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6ce3a6c..f2e2bcd 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ MsSQL "backdoor": false }, "collector": { - "ifacePrefix": ["Intel"] //所采集的网卡描述信息关键词,例如Intel(R)PRO/1000 MT NetworkConnection + "ifacePrefix": ["本地连接"] //所采集的网卡名,注意 falcon 默认不支持中文名的tag,因此需要修改 graph 表的编码为 uft8 }, "ignore": { "cpu.busy": true, diff --git a/funcs/func_test.go b/funcs/func_test.go index b63ea2b..d5d35be 100644 --- a/funcs/func_test.go +++ b/funcs/func_test.go @@ -34,7 +34,7 @@ func Test_disk(t *testing.T) { } func Test_net_status(t *testing.T) { - var ifacePrefix = []string{"Intel"} + var ifacePrefix = []string{"本地连接", "Loop"} netifs, err := net_status(ifacePrefix) t.Log(netifs) t.Error(err) @@ -55,9 +55,19 @@ func Test_TestIOCounters(t *testing.T) { } func Test_Process(t *testing.T) { - // p, err := Processes() - // t.Log(p) - // t.Error(err) + p, err := Processes() + t.Log(p) + t.Error(err) + cnt := 0 + m := map[int]string{ + 1: "smss.exe", + } + for i := 0; i < len(p); i++ { + if is_a(p[i], m) { + cnt++ + } + } + t.Log(cnt) } func Test_tcpip(t *testing.T) { ret, _ := TcpipCounters() diff --git a/g/const.go b/g/const.go index b6d412b..2cbd7f8 100644 --- a/g/const.go +++ b/g/const.go @@ -6,8 +6,9 @@ import ( // changelog: // 1.0.0 windows-agent +// 1.0.1 ifstat use ifname instead ifdescription const ( - VERSION = "1.0.0" + VERSION = "1.0.1" COLLECT_INTERVAL = time.Second NET_PORT_LISTEN = "net.port.listen" DU_BS = "du.bs"