This repository was archived by the owner on Aug 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1- if context.error != null {
1+ # Only act if this check actually involves an MCP layer
2+ var mcpLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "mcp" {
5+ mcpLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if mcpLayer == null {
11+ # Not an MCP check — ignore
12+ } else if context.error != null {
213 var mcpServerName = "unknown";
314 var mcpServerVersion = "?";
415
5- for layer in context.metadata.layers {
6- if layer.name == "mcp" && layer.data != null {
7- const srv = layer.data.serverInfo;
8- if srv != null {
9- mcpServerName = srv.name;
10- mcpServerVersion = srv.version;
11- }
12- break;
16+ if mcpLayer.data != null {
17+ const srv = mcpLayer.data.serverInfo;
18+ if srv != null {
19+ mcpServerName = srv.name;
20+ mcpServerVersion = srv.version;
1321 }
1422 }
1523
Original file line number Diff line number Diff line change 1- if context.error == null {
1+ # Only act if this check actually involves an MCP layer
2+ var mcpLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "mcp" {
5+ mcpLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if mcpLayer == null {
11+ # Not an MCP check — ignore
12+ } else if context.error == null {
213 incident.recover();
314} else {
415 var mcpServerName = "unknown";
516 var mcpServerVersion = "?";
617
7- for layer in context.metadata.layers {
8- if layer.name == "mcp" && layer.data != null {
9- const srv = layer.data.serverInfo;
10- if srv != null {
11- mcpServerName = srv.name;
12- mcpServerVersion = srv.version;
13- }
14- break;
18+ if mcpLayer.data != null {
19+ const srv = mcpLayer.data.serverInfo;
20+ if srv != null {
21+ mcpServerName = srv.name;
22+ mcpServerVersion = srv.version;
1523 }
1624 }
1725
Original file line number Diff line number Diff line change 1- if context.error == null {
1+ # Only act if this check actually involves an MCP layer
2+ var mcpLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "mcp" {
5+ mcpLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if mcpLayer == null {
11+ # Not an MCP check — ignore
12+ } else if context.error == null {
213 incident.recover();
314} else {
415 var mcpServerName = "unknown";
516 var mcpServerVersion = "?";
617
7- for layer in context.metadata.layers {
8- if layer.name == "mcp" && layer.data != null {
9- const srv = layer.data.serverInfo;
10- if srv != null {
11- mcpServerName = srv.name;
12- mcpServerVersion = srv.version;
13- }
14- break;
18+ if mcpLayer.data != null {
19+ const srv = mcpLayer.data.serverInfo;
20+ if srv != null {
21+ mcpServerName = srv.name;
22+ mcpServerVersion = srv.version;
1523 }
1624 }
1725
Original file line number Diff line number Diff line change 1- if context.error == null {
1+ # Only act if this check actually involves an MCP layer
2+ var mcpLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "mcp" {
5+ mcpLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if mcpLayer == null {
11+ # Not an MCP check — ignore
12+ } else if context.error == null {
213 incident.recover();
314} else {
415 var mcpServerName = "unknown";
516 var mcpServerVersion = "?";
617
7- for layer in context.metadata.layers {
8- if layer.name == "mcp" && layer.data != null {
9- const srv = layer.data.serverInfo;
10- if srv != null {
11- mcpServerName = srv.name;
12- mcpServerVersion = srv.version;
13- }
14- break;
18+ if mcpLayer.data != null {
19+ const srv = mcpLayer.data.serverInfo;
20+ if srv != null {
21+ mcpServerName = srv.name;
22+ mcpServerVersion = srv.version;
1523 }
1624 }
1725
Original file line number Diff line number Diff line change 1- # Priority 1: connection/handshake error
2- if context.error != null {
1+ # Only act if this check actually involves a TLS layer
2+ var tlsLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "tls" {
5+ tlsLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if tlsLayer == null {
11+ # Not a TLS check — ignore
12+ } else if context.error != null {
13+ # Priority 1: connection/handshake error
314 alerting.send({
415 header: "Monitor [%s] TLS connection failed from %s"
516 .format(context.monitor.name, context.location),
@@ -13,16 +24,7 @@ if context.error != null {
1324 }
1425 });
1526} else {
16- # Find TLS layer
17- var tlsLayer = null;
18- for layer in context.metadata.layers {
19- if layer.name == "tls" {
20- tlsLayer = layer;
21- break;
22- }
23- }
24-
25- if tlsLayer != null && tlsLayer.data != null {
27+ if tlsLayer.data != null {
2628 const tlsData = tlsLayer.data;
2729 const certChain = tlsData.certChain;
2830
Original file line number Diff line number Diff line change 1- # Priority 1: connection/handshake error
2- if context.error != null {
1+ # Only act if this check actually involves a TLS layer
2+ var tlsLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "tls" {
5+ tlsLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if tlsLayer == null {
11+ # Not a TLS check — ignore
12+ } else if context.error != null {
13+ # Priority 1: connection/handshake error
314 incident.signal({
415 severity: "critical",
516 title: "Monitor [%s] TLS connection failed from %s"
@@ -8,16 +19,7 @@ if context.error != null {
819 .format(context.error.message, context.error.code, context.check.id)
920 });
1021} else {
11- # Find TLS layer
12- var tlsLayer = null;
13- for layer in context.metadata.layers {
14- if layer.name == "tls" {
15- tlsLayer = layer;
16- break;
17- }
18- }
19-
20- if tlsLayer != null && tlsLayer.data != null {
22+ if tlsLayer.data != null {
2123 const tlsData = tlsLayer.data;
2224 const certChain = tlsData.certChain;
2325
Original file line number Diff line number Diff line change 1- # Priority 1: connection/handshake error
2- if context.error != null {
1+ # Only act if this check actually involves a TLS layer
2+ var tlsLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "tls" {
5+ tlsLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if tlsLayer == null {
11+ # Not a TLS check — ignore
12+ } else if context.error != null {
13+ # Priority 1: connection/handshake error
314 incident.signal({
415 severity: "major",
516 title: "Monitor [%s] TLS connection failed from %s"
@@ -8,16 +19,7 @@ if context.error != null {
819 .format(context.error.message, context.error.code, context.check.id)
920 });
1021} else {
11- # Find TLS layer
12- var tlsLayer = null;
13- for layer in context.metadata.layers {
14- if layer.name == "tls" {
15- tlsLayer = layer;
16- break;
17- }
18- }
19-
20- if tlsLayer != null && tlsLayer.data != null {
22+ if tlsLayer.data != null {
2123 const tlsData = tlsLayer.data;
2224 const certChain = tlsData.certChain;
2325
Original file line number Diff line number Diff line change 1- # Priority 1: connection/handshake error
2- if context.error != null {
1+ # Only act if this check actually involves a TLS layer
2+ var tlsLayer = null;
3+ for layer in context.metadata.layers {
4+ if layer.name == "tls" {
5+ tlsLayer = layer;
6+ break;
7+ }
8+ }
9+
10+ if tlsLayer == null {
11+ # Not a TLS check — ignore
12+ } else if context.error != null {
13+ # Priority 1: connection/handshake error
314 incident.signal({
415 severity: "minor",
516 title: "Monitor [%s] TLS connection failed from %s"
@@ -8,16 +19,7 @@ if context.error != null {
819 .format(context.error.message, context.error.code, context.check.id)
920 });
1021} else {
11- # Find TLS layer
12- var tlsLayer = null;
13- for layer in context.metadata.layers {
14- if layer.name == "tls" {
15- tlsLayer = layer;
16- break;
17- }
18- }
19-
20- if tlsLayer != null && tlsLayer.data != null {
22+ if tlsLayer.data != null {
2123 const tlsData = tlsLayer.data;
2224 const certChain = tlsData.certChain;
2325
You can’t perform that action at this time.
0 commit comments