Skip to content

Commit

Permalink
Make service name of icinga2 more human-readable
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpai committed Aug 30, 2016
1 parent 34e1aeb commit fd084ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (al *Alert) generateIcinga2Config() ([]Icinga2Apply, []Icinga2Service) {
// This service is not using template
newService := Icinga2Service{
ID: strconv.Itoa(service.ID),
Name: fmt.Sprintf("%s-%s", al.Name, service.Metric),
Name: fmt.Sprintf("%s-%s", al.Name, service.Name),
Warning: service.Warning,
Critical: service.Critical,
CheckAttempts: service.CheckAttempts,
Expand All @@ -97,7 +97,7 @@ func (al *Alert) generateIcinga2Config() ([]Icinga2Apply, []Icinga2Service) {
realMetric := strings.Replace(service.Metric, replacedStr, trimedValue, -1)
newService := Icinga2Service{
ID: fmt.Sprintf("%d-%d-%s", service.ID, tmpl.ID, trimedValue),
Name: fmt.Sprintf("%s-%s-%s", al.Name, service.Name, realMetric),
Name: fmt.Sprintf("%s-%s[%s]", al.Name, service.Name, trimedValue),
Warning: service.Warning,
Critical: service.Critical,
CheckAttempts: service.CheckAttempts,
Expand Down

0 comments on commit fd084ab

Please sign in to comment.