1
0
mirror of https://github.com/Luzifer/elb-instance-status.git synced 2024-09-16 13:48:34 +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!)"`
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"`
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()
cmd := exec.Command("/bin/bash", "-c", check.Command)
cmd.Stderr = os.Stderr
if cfg.Verbose {
cmd.Stdout = os.Stdout
}
err := cmd.Start()
if err == nil {