Merge pull request #279 from Erope/master
Fix: fix icmp ping & fix agent action build Co-authored-by: Erope <44471469+Erope@users.noreply.github.com>
This commit is contained in:
commit
9e9cada57d
2
.github/workflows/agent.yml
vendored
2
.github/workflows/agent.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: goreleaser/goreleaser-cross
|
||||
image: goreleaser/goreleaser-cross:v1.19.2
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
|
@ -337,7 +337,12 @@ func handleIcmpPingTask(task *pb.Task, result *pb.TaskResult) {
|
||||
err = pinger.Run() // Blocks until finished.
|
||||
}
|
||||
if err == nil {
|
||||
result.Delay = float32(pinger.Statistics().AvgRtt.Microseconds()) / 1000.0
|
||||
stat := pinger.Statistics()
|
||||
if stat.PacketsRecv == 0 {
|
||||
result.Data = "pockets recv 0"
|
||||
return
|
||||
}
|
||||
result.Delay = float32(stat.AvgRtt.Microseconds()) / 1000.0
|
||||
result.Successful = true
|
||||
} else {
|
||||
result.Data = err.Error()
|
||||
|
Loading…
x
Reference in New Issue
Block a user