I needed the same thing as you, and I made a workaround (with exec.Command ) for my Raspberry Pi to check if the servers were on the network. Here is the experimental code
out, _ := exec.Command("ping", "192.168.0.111", "-c 5", "-i 3", "-w 10").Output() if strings.Contains(string(out), "Destination Host Unreachable") { fmt.Println("TANGO DOWN") } else { fmt.Println("IT ALIVEEE") }
source share