Compare commits
3 Commits
50e7086192
...
62f935c2f3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62f935c2f3 | ||
|
|
51733d88e8 | ||
|
|
a6db49947e |
|
|
@ -43,3 +43,4 @@ test/
|
|||
|
||||
# 编译文件
|
||||
sysmonitord
|
||||
fixroad.md
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import (
|
|||
const (
|
||||
OfficialConfigURL = "http://localhost:8080/api/configs/official.json"
|
||||
UserConfigURL = "http://localhost:8080/api/configs/user.json"
|
||||
CenterServerURL = "ws://localhost:8080/ws/monitor"
|
||||
CenterServerURL = "ws://localhost:8090/api/v1/ws"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -102,7 +102,7 @@ func main() {
|
|||
|
||||
go func() {
|
||||
for alert := range sshAlertChan {
|
||||
packet := network.NewPactet("SSH_ALERT", alert)
|
||||
packet := network.NewPacket("SSH_ALERT", alert)
|
||||
auditClient.SendQueue(packet)
|
||||
}
|
||||
}()
|
||||
|
|
@ -119,7 +119,7 @@ func main() {
|
|||
|
||||
go func() {
|
||||
for metrics := range metricsChan {
|
||||
packet := network.NewPactet("STATUS_UPDATE", metrics)
|
||||
packet := network.NewPacket("STATUS_UPDATE", metrics)
|
||||
centerClient.SendQueue(packet)
|
||||
}
|
||||
}()
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ type Packet struct {
|
|||
Payload interface{} `json:"payload"`
|
||||
}
|
||||
|
||||
func NewPactet(msgType string, payload interface{}) Packet {
|
||||
func NewPacket(msgType string, payload interface{}) Packet {
|
||||
return Packet{
|
||||
Type: msgType,
|
||||
Timestamp: time.Now().Unix(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user