mirror of
https://github.com/Luzifer/elb-instance-status.git
synced 2024-12-22 19:01:19 +00:00
Make output of the commands more visible
This commit is contained in:
parent
13f2fb88ec
commit
337bffcf0c
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue