diff options
| author | Jeff Carr <[email protected]> | 2024-10-12 10:59:11 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-12 10:59:11 -0500 |
| commit | d08d9f99bee4d4e93a8beda780d8e9f6099e32cb (patch) | |
| tree | 78540be4d3b371569f59ee863621b03786a479c5 /main.go | |
| parent | 0751e80559cbb34bc23639328938780c64063c92 (diff) | |
ugly but limping along progress
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 30 |
1 files changed, 25 insertions, 5 deletions
@@ -3,9 +3,9 @@ package main import ( - // "log" "embed" "os" + "time" "go.wit.com/dev/alexflint/arg" "go.wit.com/log" @@ -19,15 +19,35 @@ var resources embed.FS func main() { pp := arg.MustParse(&argv) - if ! argv.Uptime { + if !argv.Uptime { pp.WriteHelp(os.Stdout) os.Exit(0) } log.Info("connect to cluser here", argv.Hosts) - for i, s := range argv.Hosts { - log.Info("i, s =", i, s) + for _, s := range argv.Hosts { + me.names = append(me.names, s) + + log.Info("Make a hypervisor struct for", s) + var h HyperT + h.Hostname = s + h.Autoscan = true + h.Delay = 3 * time.Second + h.Scan = func() { + log.Info("scanned farm03?") + h.pollHypervisor() + } + me.hypers = append(me.hypers, h) + } + go startHTTP() + + log.Info("me.names =", me.names) + for _, h := range me.hypers { + log.Info("me hostname =", h.Hostname) + if h.Hostname == "farm03" { + log.Info("should start watchdog here for hostname =", h.Hostname) + h.NewWatchdog() + } } - startHTTP() } |
