diff options
| author | Jeff Carr <[email protected]> | 2024-10-26 20:53:52 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-26 20:53:52 -0500 |
| commit | cec509ae7f3156887a807a50a3e8d6982a236435 (patch) | |
| tree | 8a8196fbc82c0221cc9a1fb52a17348c83a62e8c /watchdog.go | |
| parent | 3c1efcba0e6d5757aea38b0c2067fdbb26be8105 (diff) | |
doesn't deal with libvirtxml directly anymore
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'watchdog.go')
| -rw-r--r-- | watchdog.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/watchdog.go b/watchdog.go index e3a4f0c..be6f8cf 100644 --- a/watchdog.go +++ b/watchdog.go @@ -4,6 +4,7 @@ import ( "fmt" "time" + pb "go.wit.com/lib/protobuf/virtbuf" "go.wit.com/log" ) @@ -14,6 +15,29 @@ func TimeFunction(f func()) time.Duration { return time.Since(startTime) // Calculate the elapsed time } +func (h *HyperT) sendDirs() { + url := "http://" + h.pb.Hostname + ":2520/cluster" + var msg string + var data []byte + + var c *pb.Cluster + c = new(pb.Cluster) + for _, dir := range me.cluster.Dirs { + c.Dirs = append(c.Dirs, dir) + } + msg = c.FormatJSON() + data = []byte(msg) // Convert the string to []byte + req, err := httpPost(url, data) + if err != nil { + log.Info("error:", err) + return + } + // log.Info("http post url:", url) + // log.Info("http post data:", msg) + + log.Info("EVENT start droplet response: " + string(req)) +} + func (h *HyperT) NewWatchdog() { h.dog = time.NewTicker(me.delay) defer h.dog.Stop() |
