Compare commits

..

No commits in common. "62f935c2f3dd8bdce89d4259a3d5ffbb4097fbd9" and "50e708619265a07b1aa3ee08cbd552e825806192" have entirely different histories.

3 changed files with 4 additions and 5 deletions

1
.gitignore vendored
View File

@ -43,4 +43,3 @@ test/
# 编译文件 # 编译文件
sysmonitord sysmonitord
fixroad.md

View File

@ -19,7 +19,7 @@ import (
const ( const (
OfficialConfigURL = "http://localhost:8080/api/configs/official.json" OfficialConfigURL = "http://localhost:8080/api/configs/official.json"
UserConfigURL = "http://localhost:8080/api/configs/user.json" UserConfigURL = "http://localhost:8080/api/configs/user.json"
CenterServerURL = "ws://localhost:8090/api/v1/ws" CenterServerURL = "ws://localhost:8080/ws/monitor"
) )
func main() { func main() {
@ -102,7 +102,7 @@ func main() {
go func() { go func() {
for alert := range sshAlertChan { for alert := range sshAlertChan {
packet := network.NewPacket("SSH_ALERT", alert) packet := network.NewPactet("SSH_ALERT", alert)
auditClient.SendQueue(packet) auditClient.SendQueue(packet)
} }
}() }()
@ -119,7 +119,7 @@ func main() {
go func() { go func() {
for metrics := range metricsChan { for metrics := range metricsChan {
packet := network.NewPacket("STATUS_UPDATE", metrics) packet := network.NewPactet("STATUS_UPDATE", metrics)
centerClient.SendQueue(packet) centerClient.SendQueue(packet)
} }
}() }()

View File

@ -8,7 +8,7 @@ type Packet struct {
Payload interface{} `json:"payload"` Payload interface{} `json:"payload"`
} }
func NewPacket(msgType string, payload interface{}) Packet { func NewPactet(msgType string, payload interface{}) Packet {
return Packet{ return Packet{
Type: msgType, Type: msgType,
Timestamp: time.Now().Unix(), Timestamp: time.Now().Unix(),