Compare commits
5
Commits
857be83724
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fdfd9e552 | ||
|
|
18523eae58 | ||
|
|
50db0ded4e | ||
|
|
62564a4796 | ||
|
|
f7ffa441f6 |
+2
-2
@@ -199,7 +199,7 @@ func (b *bridge) handle(w http.ResponseWriter, r *http.Request) {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
switch status {
|
||||
case 2: // DOWN (0=unknown,1=up,2=down per Kuma webhook)
|
||||
case 0: // Kuma heartbeat status: 0=down, 1=up, 2=pending, 3=maintenance
|
||||
if _, exists := b.open[k.Monitor.Name]; !exists {
|
||||
tid, err := b.glpi.openTicketFor(k.Monitor.Name)
|
||||
if err == nil && tid == 0 {
|
||||
@@ -228,7 +228,7 @@ func (b *bridge) handle(w http.ResponseWriter, r *http.Request) {
|
||||
if err := b.glpi.followup(tid, fu); err != nil {
|
||||
log.Printf("followup failed (continuing to solve): %v", err)
|
||||
}
|
||||
if err := b.glpi.do("POST", fmt.Sprintf("/Ticket/%d", tid), map[string]any{"input": map[string]any{"status": 11}}, nil); err != nil { // 11 = solved
|
||||
if err := b.glpi.do("PUT", fmt.Sprintf("/Ticket/%d", tid), map[string]any{"input": map[string]any{"status": 5}}, nil); err != nil { // ticket status 5 = solved
|
||||
log.Printf("solve failed: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user