1
0
Fork 0
mirror of https://github.com/Luzifer/elb-instance-status.git synced 2024-12-23 03:11:20 +00:00

Make output of the commands more visible

This commit is contained in:
Knut Ahlers 2016-08-04 12:15:44 +02:00
parent 13f2fb88ec
commit 337bffcf0c
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -31,6 +31,8 @@ var (
CheckInterval time.Duration `flag:"check-interval" default:"1m" description:"How often to execute checks (do not set below 10s!)"` CheckInterval time.Duration `flag:"check-interval" default:"1m" description:"How often to execute checks (do not set below 10s!)"`
ConfigRefreshInterval time.Duration `flag:"config-refresh" default:"10m" description:"How often to update checks from definitions file / url"` ConfigRefreshInterval time.Duration `flag:"config-refresh" default:"10m" description:"How often to update checks from definitions file / url"`
Verbose bool `flag:"verbose,v" default:"false" description:"Attach stdout of the executed commands"`
Listen string `flag:"listen" default:":3000" description:"IP/Port to listen on for ELB health checks"` Listen string `flag:"listen" default:":3000" description:"IP/Port to listen on for ELB health checks"`
VersionAndExit bool `flag:"version" default:"false" description:"Print version and exit"` VersionAndExit bool `flag:"version" default:"false" description:"Print version and exit"`
}{} }{}
@ -136,6 +138,10 @@ func executeAndRegisterCheck(ctx context.Context, checkID string) {
start := time.Now() start := time.Now()
cmd := exec.Command("/bin/bash", "-c", check.Command) cmd := exec.Command("/bin/bash", "-c", check.Command)
cmd.Stderr = os.Stderr
if cfg.Verbose {
cmd.Stdout = os.Stdout
}
err := cmd.Start() err := cmd.Start()
if err == nil { if err == nil {