This commit is contained in:
crusader 2017-12-14 16:35:12 +09:00
parent cda6a02f65
commit f8580434e8
2 changed files with 9 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt"
configM "git.loafle.net/overflow/overflow_commons_go/modules/config/model"
configUtil "git.loafle.net/overflow/overflow_commons_go/modules/config/util"
"git.loafle.net/overflow/overflow_probe_container_network/crawler"
"git.loafle.net/overflow/overflow_probe_container_network/crawler/impl/ssh/client"
"git.loafle.net/overflow/overflow_probe_container_network/crawler/impl/ssh/parser"
@ -50,7 +51,6 @@ func (c *SSHCrawler) InternalGet(config *configM.Config) (map[string]string, err
pScanner := parser.NewParserScanner(scanner, boundary)
for i := 0; i < itemCount; i++ {
item := config.Items[i]
mode := item.QueryInfo.Extend["mode"].(string)
@ -65,8 +65,9 @@ func (c *SSHCrawler) InternalGet(config *configM.Config) (map[string]string, err
}
if nil != rm {
for k, v := range rm {
results[k] = v
mm := configUtil.KeysToMap(item.Keys)
for key, value := range mm {
results[value] = rm[key]
}
}

View File

@ -20,10 +20,11 @@
"container": "go_proxy"
},
"items": [{
"keys": [{
"metric": "cpu.usage.sum",
"key": "sum"
},
"keys": [
{
"metric": "cpu.usage.sum",
"key": "sum"
},
{
"metric": "cpu.usage.user",
"key": "user"