diff --git a/cli/flags.go b/cli/flags.go index cf25ef946d..6d783189e9 100644 --- a/cli/flags.go +++ b/cli/flags.go @@ -48,12 +48,12 @@ var ( } flHeartBeat = cli.StringFlag{ Name: "heartbeat", - Value: "20s", + Value: "60s", Usage: "period between each heartbeat", } flTTL = cli.StringFlag{ Name: "ttl", - Value: "60s", + Value: "180s", Usage: "sets the expiration of an ephemeral node", } flTimeout = cli.StringFlag{ diff --git a/cluster/engine.go b/cluster/engine.go index 82dbf632f0..623c5eabcb 100644 --- a/cluster/engine.go +++ b/cluster/engine.go @@ -184,6 +184,14 @@ func (e *Engine) IsHealthy() bool { return e.healthy } +// Status returns the health status of the Engine: Healthy or Unhealthy +func (e *Engine) Status() string { + if e.healthy { + return "Healthy" + } + return "Unhealthy" +} + // Gather engine specs (CPU, memory, constraints, ...). func (e *Engine) updateSpecs() error { info, err := e.client.Info() diff --git a/cluster/swarm/cluster.go b/cluster/swarm/cluster.go index beadf9b222..7a4c4cfa4d 100644 --- a/cluster/swarm/cluster.go +++ b/cluster/swarm/cluster.go @@ -734,6 +734,7 @@ func (c *Cluster) Info() [][]string { for _, engine := range engines { info = append(info, []string{engine.Name, engine.Addr}) + info = append(info, []string{" └ Status", engine.Status()}) info = append(info, []string{" └ Containers", fmt.Sprintf("%d", len(engine.Containers()))}) info = append(info, []string{" └ Reserved CPUs", fmt.Sprintf("%d / %d", engine.UsedCpus(), engine.TotalCpus())}) info = append(info, []string{" └ Reserved Memory", fmt.Sprintf("%s / %s", units.BytesSize(float64(engine.UsedMemory())), units.BytesSize(float64(engine.TotalMemory())))})