Author SHA1 Message Date
ic-builder 9fdfd9e552 Merge pull request 'fix DOWN enum: Kuma heartbeat 0=down (was 2)' (#5) from ic-builder/status-enum into main
ci / vet (push) Successful in 41s
2026-09-06 20:29:52 +00:00
ic-builder 18523eae58 fix: Kuma heartbeat status enum — 0 is DOWN, not 2
ci / vet (pull_request) Successful in 59s
Live-path debug found the bridge silently ignored real Kuma down-events:
Kuma heartbeat.status is 0=down/1=up/2=pending, not the webhook-doc
guess used earlier. DOWN now keyed on 0.
Ticket: https://projects.knownelement.com/issues/824
2026-09-06 15:29:48 -05:00
ic-builder 50db0ded4e Merge pull request 'solve via PUT (POST no-oped)' (#4) from ic-builder/solve-put into main
ci / vet (push) Successful in 1m0s
2026-09-06 18:29:21 +00:00
ic-builder 62564a4796 solve: PUT not POST — GLPI updates require the update verb
ci / vet (pull_request) Successful in 46s
The POST on /Ticket/<id> silently no-oped; the manual PUT worked.
Ticket: https://projects.knownelement.com/issues/824
2026-09-06 13:29:17 -05:00
ic-builder f7ffa441f6 solve uses Ticket status 5 (solved), not the Change value
Ticket: https://projects.knownelement.com/issues/824
2026-09-06 13:18:05 -05:00
ic-builder 857be83724 Merge pull request 'UP solves open tickets after restarts' (#3) from ic-builder/up-solve-search into main
ci / vet (push) Successful in 1m25s
2026-09-06 18:09:39 +00:00
ic-builder de9b9c4a35 UP events solve open tickets even after bridge restarts
ci / vet (pull_request) Successful in 47s
In-memory dedupe resets on pod restart; recovery then no-ops and leaves
stale open tickets. UP now falls back to a GLPI search for an unsolved
ticket for that monitor.
Ticket: https://projects.knownelement.com/issues/824
2026-09-06 13:09:34 -05:00
ic-builder 39abf7f0b8 Merge pull request 'CI node fix + GLPI 11 ITILFollowup recovery path' (#2) from ic-builder/ci-node-and-followup into main
ci / vet (push) Successful in 1m25s
2026-09-06 18:01:01 +00:00
2 changed files with 7 additions and 3 deletions
BIN
View File
Binary file not shown.
+7 -3
View File
@@ -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 {
@@ -216,7 +216,11 @@ func (b *bridge) handle(w http.ResponseWriter, r *http.Request) {
case 1: // UP
tid, exists := b.open[k.Monitor.Name]
if !exists {
return
// restarts wipe the in-memory map; search GLPI for an open ticket
tid, _ = b.glpi.openTicketFor(k.Monitor.Name)
if tid == 0 {
return
}
}
delete(b.open, k.Monitor.Name)
go func() {
@@ -224,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)
}
}()