Added token in argument of consul watch command (#243)
This commit is contained in:
parent
4ec70bbbfe
commit
93c4aff945
|
@ -170,10 +170,10 @@ func daemonMode(arguments map[string]interface{}) {
|
|||
log.Println("Started Consul-Alerts API")
|
||||
|
||||
if watchChecks {
|
||||
go runWatcher(consulAddr, consulDc, addr, loglevelString, "checks")
|
||||
go runWatcher(consulAddr, consulDc, addr, loglevelString, consulAclToken, "checks")
|
||||
}
|
||||
if watchEvents {
|
||||
go runWatcher(consulAddr, consulDc, addr, loglevelString, "event")
|
||||
go runWatcher(consulAddr, consulDc, addr, loglevelString, consulAclToken, "event")
|
||||
}
|
||||
|
||||
ch := make(chan os.Signal)
|
||||
|
|
|
@ -12,12 +12,13 @@ import (
|
|||
log "github.com/AcalephStorage/consul-alerts/Godeps/_workspace/src/github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
func runWatcher(consulAddr, datacenter, alertAddr, logLevel, watchType string) {
|
||||
func runWatcher(consulAddr, datacenter, alertAddr, logLevel, consulAclToken, watchType string) {
|
||||
consulAlert := os.Args[0]
|
||||
cmd := exec.Command(
|
||||
"consul", "watch",
|
||||
"-http-addr", consulAddr,
|
||||
"-datacenter", datacenter,
|
||||
"-token", consulAclToken,
|
||||
"-type", watchType,
|
||||
consulAlert, "watch", watchType, "--alert-addr", alertAddr, "--log-level", logLevel)
|
||||
cmd.Stdout = os.Stdout
|
||||
|
|
Loading…
Reference in New Issue