Skip to content

Commit

Permalink
Change project to be alligned with Go programming best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
PatMis16 committed Apr 14, 2021
1 parent b8ff433 commit 27240a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/PatMis16/promalert2bmctsom

go 1.15
2 changes: 2 additions & 0 deletions promalert2bmctsom.go → main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ func (config Config) Run() {
if events != nil {
if SendEventToTS(tsToken.getToken(), config.Server.TrueSight.TSIMServer, config.Server.TrueSight.TSIMPort, config.Server.TrueSight.TSCell, events) {
InfoLogger.Println("Event sent to TrueSight.")
fmt.Fprintf(w, "Event(s) created")
} else {
WarningLogger.Println("Failed to send event(s) to TrueSight.")
promAlertsCache.Add(RandomString(10), events, cache.DefaultExpiration)
http.Error(w, "Something went wrong on the server!", http.StatusInternalServerError)
}
}
}
Expand Down

0 comments on commit 27240a9

Please sign in to comment.