Browse Source

Alarm message improvement

pull/98/merge
Doflatango 7 years ago
parent
commit
054ce02abd
  1. 14
      job.go

14
job.go

@ -566,15 +566,15 @@ func (j *Job) Notify(t time.Time, msg string) {
}
ts := t.Format(time.RFC3339)
body := "job: " + j.Key() + "\n" +
"job name: " + j.Name + "\n" +
"job cmd: " + j.Command + "\n" +
"node: " + j.runOn + "\n" +
"time: " + ts + "\n" +
"err: " + msg
body := "Job: " + j.Key() + "\n" +
"Job name: " + j.Name + "\n" +
"Job cmd: " + j.Command + "\n" +
"Node: " + j.hostname + "|" + j.ip + "[" + j.runOn + "]\n" +
"Time: " + ts + "\n" +
"Error: " + msg
m := Message{
Subject: "node[" + j.runOn + "] job[" + j.ShortName() + "] time[" + ts + "] exec failed",
Subject: "[Cronsun] node[" + j.hostname + "|" + j.ip + "] job[" + j.ShortName() + "] time[" + ts + "] exec failed",
Body: body,
To: j.To,
}

Loading…
Cancel
Save