summaryrefslogtreecommitdiff
path: root/poll.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-12 19:44:43 -0500
committerJeff Carr <[email protected]>2024-10-12 19:44:43 -0500
commitba61b7863168c03812578d74fbe1e4532eb8b6a5 (patch)
tree8a26d31fe6340b48813c047545c08d0e002b0504 /poll.go
parent58ff2a2412837b2e438e745ccf3ffc022d111458 (diff)
add daemon mode
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'poll.go')
-rw-r--r--poll.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/poll.go b/poll.go
index f9c75ab..42b0455 100644
--- a/poll.go
+++ b/poll.go
@@ -36,8 +36,11 @@ func (h HyperT) pollHypervisor() {
d.lastpoll = time.Now()
d.CurrentState = "ON"
// log.Info("ALREADY RECORDED", d.Hostname, d.lastpoll)
+ if d.hname == "" {
+ log.Log(EVENT, "DROPLET", d.Hostname, "PROBABLY WAS NEVER POLLED YET")
+ }
if d.hname != h.Hostname {
- log.Log(EVENT, "DROPLET", d.Hostname, "MOVED FROM", d.hname, "TO", d.Hostname)
+ log.Log(EVENT, "DROPLET", d.Hostname, "MOVED FROM", d.hname, "TO", h.Hostname)
d.hname = h.Hostname
}
continue
@@ -72,7 +75,7 @@ func clusterHealthy() bool {
}
dur := time.Since(d.lastpoll) // Calculate the elapsed time
if d.CurrentState != "ON" {
- log.Info("BAD STATE ", d.Hostname, "State =", d.State, "CurrentState =", d.CurrentState, shell.FormatDuration(dur))
+ log.Info("BAD STATE", d.State, d.Hostname, d.hname, "CurrentState =", d.CurrentState, shell.FormatDuration(dur))
good = false
} else {
dur := time.Since(d.lastpoll) // Calculate the elapsed time