fixed log, package
This commit is contained in:
parent
4e80885df2
commit
31086ce17d
@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
//log "github.com/cihub/seelog"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@ -12,7 +12,7 @@ func TestConfigRead(t *testing.T) {
|
||||
|
||||
b, err := ioutil.ReadFile("/root/gowork/src/git.loafle.net/overflow/overflow_probe/agent_api/config_manager/test.json")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
var m = Config{}
|
||||
json.Unmarshal(b, &m)
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"git.loafle.net/overflow/overflow_probe/crawler/grpc"
|
||||
crm "git.loafle.net/overflow/overflow_probe/crawler_manager"
|
||||
s "git.loafle.net/overflow/overflow_probe/scheduler"
|
||||
"log"
|
||||
log "github.com/cihub/seelog"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
@ -50,7 +50,7 @@ func (c *Collector) start(started chan bool, conf cm.ConfigManager) {
|
||||
|
||||
for _, conf := range c.cm.GetSensors() {
|
||||
if err := c.addSensor(conf.Id); err != nil {
|
||||
log.Println(err)
|
||||
log.Debug(err)
|
||||
}
|
||||
}
|
||||
started <- true
|
||||
|
@ -3,9 +3,9 @@ package config_manager
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/overflow_probe/agent_api/config_manager"
|
||||
"gopkg.in/yaml.v2"
|
||||
log "github.com/cihub/seelog"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -66,7 +66,7 @@ func (c *configManager) loadCrawlerConfigAll() error {
|
||||
root := c.getConfigPath()
|
||||
files, err := ioutil.ReadDir(root)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
for _, file := range files {
|
||||
if file.IsDir() == true {
|
||||
@ -85,7 +85,7 @@ func (c *configManager) loadCrawlerConfig(root string, dir string) {
|
||||
currentDir := root + separator + dir
|
||||
files, err := ioutil.ReadDir(currentDir)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
@ -96,7 +96,7 @@ func (c *configManager) loadCrawlerConfig(root string, dir string) {
|
||||
} else {
|
||||
b, err := ioutil.ReadFile(currentDir + separator + file.Name())
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
var m = config_manager.Config{}
|
||||
json.Unmarshal(b, &m)
|
||||
@ -113,7 +113,7 @@ func (c *configManager) addConfig(tmp string) {
|
||||
b, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
// error process
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
// 임시파일을 로드 , Config로 변환
|
||||
@ -121,7 +121,7 @@ func (c *configManager) addConfig(tmp string) {
|
||||
err = json.Unmarshal(b, &m)
|
||||
if err != nil {
|
||||
// error process
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
// agent 폴더 / config / crawler / .. / .. / .. / 에 해당하는 파일이 있는지 확인, 있다면 삭제
|
||||
@ -133,7 +133,7 @@ func (c *configManager) addConfig(tmp string) {
|
||||
err = os.Remove(path)
|
||||
if err != nil {
|
||||
// error process
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
// Config 맵에 저장
|
||||
@ -162,7 +162,7 @@ func (c *configManager) removeConfig(id string) {
|
||||
err := os.Remove(path)
|
||||
if err != nil {
|
||||
// error check
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
// 해당 id 삭제
|
||||
|
@ -7,9 +7,9 @@ import (
|
||||
"git.loafle.net/overflow/overflow_probe/agent_api/config_manager"
|
||||
"git.loafle.net/overflow/overflow_probe/agent_api/messages"
|
||||
"git.loafle.net/overflow/overflow_probe/agent_api/observer"
|
||||
log "github.com/cihub/seelog"
|
||||
"github.com/google/uuid"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -41,7 +41,7 @@ func TestAddConfig(t *testing.T) {
|
||||
// 원본 테스트 설정 파일 로드
|
||||
b, err := ioutil.ReadFile("/root/gowork/src/git.loafle.net/overflow/overflow_probe/config_manager/test_agent/test.json")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
log.Error(err)
|
||||
}
|
||||
var m = config_manager.Config{}
|
||||
json.Unmarshal(b, &m)
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
|
||||
config "git.loafle.net/overflow/overflow_probe/agent_api/config_manager"
|
||||
"log"
|
||||
log "github.com/cihub/seelog"
|
||||
)
|
||||
|
||||
type Internal interface {
|
||||
@ -33,7 +33,7 @@ func (c *CrawlerImpl) Init(data []byte) ([]byte, error) {
|
||||
_, err := c.Add(data)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
// load all file in path
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package cassandra
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -6,7 +6,7 @@ package dhcp
|
||||
// "encoding/binary"
|
||||
// "fmt"
|
||||
// log "github.com/cihub/seelog"
|
||||
// "git.loafle.net/overflow/overflow_probe/commons_go/matcher"
|
||||
// "git.loafle.net/overflow/overflow_probe/matcher"
|
||||
// "net"
|
||||
// "time"
|
||||
//)
|
||||
|
@ -3,8 +3,8 @@ package dns
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
type Dns_frame_header struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package ftp
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
log "github.com/cihub/seelog"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package imap
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package ldap
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
type LDAPMatcher struct {
|
||||
|
@ -12,9 +12,9 @@ import (
|
||||
//"git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/mssql"
|
||||
//"git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/mysql"
|
||||
//"git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/netbios"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/oracle"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/oracle"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
//"git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/pop"
|
||||
//"git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/redis"
|
||||
//"git.loafle.net/overflow/overflow_probe/collector/core/scan/service/matcher/rmi"
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"encoding/binary"
|
||||
"math/rand"
|
||||
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package mssql
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
@ -3,8 +3,8 @@ package netbios
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package oracle
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
type OracleMatcher struct {
|
||||
|
@ -3,8 +3,8 @@ package pgsql
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -2,7 +2,7 @@ package pgsql
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package pop
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,8 +1,8 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package rmi
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package smb
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package smtp
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -3,8 +3,8 @@ package snmp
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package snmp
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
type snmpv3GlobalData struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package ssh
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package telnet
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -3,8 +3,8 @@ package wmi
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/commons_go/model/scaninfo"
|
||||
"git.loafle.net/overflow/overflow_probe/matcher/packet"
|
||||
"git.loafle.net/overflow/overflow_probe/model/scaninfo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
Loading…
x
Reference in New Issue
Block a user