ready to release a debian package?
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
42d54a418d
commit
c26699571d
9
dump.go
9
dump.go
|
@ -49,6 +49,8 @@ func dumpDroplets(w http.ResponseWriter) {
|
||||||
|
|
||||||
// status of the hypervisors
|
// status of the hypervisors
|
||||||
func dumpHypervisors(w http.ResponseWriter) {
|
func dumpHypervisors(w http.ResponseWriter) {
|
||||||
|
var totalDroplets int
|
||||||
|
var totalUnknownDroplets int
|
||||||
for _, h := range me.hypers {
|
for _, h := range me.hypers {
|
||||||
// lastpoll time.Time // the last time the hypervisor polled
|
// lastpoll time.Time // the last time the hypervisor polled
|
||||||
dur := time.Since(h.lastpoll)
|
dur := time.Since(h.lastpoll)
|
||||||
|
@ -57,12 +59,19 @@ func dumpHypervisors(w http.ResponseWriter) {
|
||||||
for name, t := range h.lastDroplets {
|
for name, t := range h.lastDroplets {
|
||||||
dur := time.Since(t)
|
dur := time.Since(t)
|
||||||
tmp := shell.FormatDuration(dur)
|
tmp := shell.FormatDuration(dur)
|
||||||
|
totalDroplets += 1
|
||||||
d := findDroplet(name)
|
d := findDroplet(name)
|
||||||
if d == nil {
|
if d == nil {
|
||||||
|
totalUnknownDroplets += 1
|
||||||
fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp)
|
fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp)
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp, d.CurrentState)
|
fmt.Fprintln(w, "\t", h.pb.Hostname, "name =", name, "lastpoll:", tmp, d.CurrentState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if totalUnknownDroplets == 0 {
|
||||||
|
fmt.Fprintln(w, "\tTotal Droplets", totalDroplets)
|
||||||
|
} else {
|
||||||
|
fmt.Fprintln(w, "\tTotal Droplets", totalDroplets, "total libvirt only droplets =", totalUnknownDroplets)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
5
poll.go
5
poll.go
|
@ -194,15 +194,16 @@ func uptimeCheck() (bool, string) {
|
||||||
summary += "(killcount=" + fmt.Sprintf("%d", me.killcount) + ")"
|
summary += "(killcount=" + fmt.Sprintf("%d", me.killcount) + ")"
|
||||||
}
|
}
|
||||||
last := time.Since(me.unstable)
|
last := time.Since(me.unstable)
|
||||||
|
s := strings.TrimSpace(shell.FormatDuration(last))
|
||||||
if last > me.clusterStableDuration {
|
if last > me.clusterStableDuration {
|
||||||
// the cluster has not been stable for 10 seconds
|
// the cluster has not been stable for 10 seconds
|
||||||
s := strings.TrimSpace(shell.FormatDuration(last))
|
|
||||||
summary += "(stable=" + s + ")"
|
summary += "(stable=" + s + ")"
|
||||||
|
} else {
|
||||||
|
summary += "(unstable=" + s + ")"
|
||||||
}
|
}
|
||||||
for _, d := range missing {
|
for _, d := range missing {
|
||||||
summary += fmt.Sprint("\nmissing droplet: ", d.Hostname, " current state ", d.CurrentState)
|
summary += fmt.Sprint("\nmissing droplet: ", d.Hostname, " current state ", d.CurrentState)
|
||||||
}
|
}
|
||||||
summary += fmt.Sprint("\ngrid stable for: ", shell.FormatDuration(time.Since(me.unstable)))
|
|
||||||
if good {
|
if good {
|
||||||
return good, "GOOD=true " + summary
|
return good, "GOOD=true " + summary
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue