@intflow/sentinelctl 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands.mjs +4 -3
package/package.json
CHANGED
package/src/commands.mjs
CHANGED
|
@@ -273,12 +273,13 @@ async function devicesOverview(context, { options, positionals }) {
|
|
|
273
273
|
normalRatio: Number.isFinite(history.normalRatio) ? Math.round(history.normalRatio * 1000) / 10 : null,
|
|
274
274
|
}];
|
|
275
275
|
}));
|
|
276
|
-
const describe = (item) => `${item.state ?? '-'} · ${item.outages ?? '-'} outages, ${item.missingMinutes ?? '-'} min missing (longest ${item.longestOutageMinutes ?? '-'} min), normal ${item.normalRatio ?? '-'}%`;
|
|
276
|
+
const describe = (item) => `${item.state ?? '-'} · ${item.outages ?? '-'} ${item.outages === 1 ? 'outage' : 'outages'}, ${item.missingMinutes ?? '-'} min missing (longest ${item.longestOutageMinutes ?? '-'} min), normal ${item.normalRatio ?? '-'}%`;
|
|
277
277
|
emit(context, { summary, ...body }, () => renderKeyValues([
|
|
278
278
|
['Agent ID', body.agentId], ['Name', body.device?.displayName], ['Window', options.range],
|
|
279
279
|
['Metrics', describe(summary.metrics)], ['Logs', describe(summary.logs)],
|
|
280
280
|
['Attention', (body.attentionReasons ?? []).join(', ') || 'none'],
|
|
281
|
-
['
|
|
281
|
+
['Hypervisor', body.related?.parent ? `${body.related.parent.displayName} (${body.related.parent.agentId})` : body.related?.expectedParent ?? null],
|
|
282
|
+
['VMs', (body.related?.children ?? []).map((child) => child.displayName ?? child.agentId).join(', ') || null],
|
|
282
283
|
]));
|
|
283
284
|
}
|
|
284
285
|
|
|
@@ -674,7 +675,7 @@ const commands = [
|
|
|
674
675
|
args: [{ name: 'agent-id' }],
|
|
675
676
|
options: { range: { alias: 'r', type: 'string', default: '24h', placeholder: 'window', description: 'History window, e.g. 24h or 7d.' } },
|
|
676
677
|
examples: ['sentinelctl devices overview <agent-id> -r 7d -o json'],
|
|
677
|
-
output: '{summary{metrics, logs}: {state, outages, delays, missingMinutes, longestOutageMinutes, normalRatio}, agentId, device, products, attentionReasons[], history, related[]}.',
|
|
678
|
+
output: '{summary{metrics, logs}: {state, outages, delays, missingMinutes, longestOutageMinutes, normalRatio}, agentId, device, products, attentionReasons[], history, related{parent, children[], expectedParent}}.',
|
|
678
679
|
},
|
|
679
680
|
{
|
|
680
681
|
group: 'metadata', name: 'get', run: metadataGet, role: 'viewer', mutates: false,
|