diff options
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() } |
