Skip to content

Commit

Permalink
Merge pull request #219 from taomaree/feature-agent-endpoint
Browse files Browse the repository at this point in the history
[agent] support get agent endpoint from ENV FALCON_ENDPOINT
  • Loading branch information
laiwei authored Aug 15, 2017
2 parents a9f8762 + d038b7d commit 1bd8d2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/agent/g/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ func Hostname() (string, error) {
return hostname, nil
}

if os.Getenv("FALCON_ENDPOINT") != "" {
hostname = os.Getenv("FALCON_ENDPOINT")
return hostname, nil
}

hostname, err := os.Hostname()
if err != nil {
log.Println("ERROR: os.Hostname() fail", err)
Expand Down

0 comments on commit 1bd8d2b

Please sign in to comment.