openvibers/openvibe.host Commits

Host: service add lists the monitoring, browser check and restore drill steps a new service needs (#103)

OP OpenVibers committed 29 days ago · 27c51dfbe4 · 2 files, +8 −0

**`ovhost service add` lists the monitoring, browser check and restore drill steps a new service needs.**

**Why:** on 2026-10-15, fifteen services added since the first inventory turned out to be missing from all three systems that watch the host:
- **Prometheus scraped none of them:** bot, watch, run, services, space, actor, food, help, work, quest, rent, media-hub, inventory, play and zone. Their readiness and error alerts could not fire. The config is generated from the inventory by `scripts/prometheus-config.js`, but nothing said to regenerate it.
- **The browser check skipped twelve of them** (Host#102).
- **Ten had no restore drill** (Host#100).

Everything is fixed on production now: 50 targets up, 37 sites watched, 12 drills passed. The cause was that `service add`'s remaining steps ended at `ovhost validate; ovhost deploy`.

**Change (`lib/commands/service-add.js`):** the remaining steps add:
- **monitoring:** regenerate the scrape config from the inventory, `promtool check config`, install, `systemctl reload prometheus`;
- **browser check:** add the service to `--sites` in `openvibe-browsercheck.service` when it has a public site;
- **restore drill:** add a drill block (`docs/restore-drills.md`), then after the first backup run `ovhost backup <id> --logical; ovhost drill <id>`.

**Test:** `service-add.test.js` checks all three steps for a new service. The 13 test files that reach the change pass.

Changes

ddiff --git a/lib/commands/service-add.js b/lib/commands/service-add.js
iindex a6b959b..2777353 100644
---- a/lib/commands/service-add.js
++++ b/lib/commands/service-add.js
@@@ -53,6 +53,10 @@ function remainingSetup(id, envFile, envText, provisioned, overridden, netRepo,
remaining.push(`service principal (Network's production env; create, or rotate if Network already has ${id}): if ${run} list | grep -Eq '^${id}[[:space:]]'; then verb=rotate; else verb=create; fi; ${run} "$verb" ${id} --env-file ${envFile} # secret never printed`);
}
remaining.push(`then: ovhost validate ${id}; ovhost deploy ${id} --restart`);
++ // Found 2026-10-15: fifteen services added this way were never scraped, watched or drilled.
++ remaining.push(`monitoring: regenerate the scrape config from the inventory (scripts/prometheus-config.js > a temp file; promtool check config; install as /etc/prometheus/prometheus.yml; systemctl reload prometheus)`);
++ remaining.push(`browser check: add ${id} to --sites in openvibe-browsercheck.service (deploy/systemd) when it has a public site`);
++ remaining.push(`restore drill: add a drill block for ${id} (docs/restore-drills.md), then after its first backup: ovhost backup ${id} --logical; ovhost drill ${id}`);
return { unset, remaining };
}
async function add(ctx, id, { selfPath, dryRun = false } = {}) {
ddiff --git a/test/service-add.test.js b/test/service-add.test.js
iindex b287141..c234e6a 100644
---- a/test/service-add.test.js
++++ b/test/service-add.test.js
@@@ -79,6 +79,10 @@ runTests([
assert.ok(step.includes('then verb=rotate; else verb=create; fi'), step);
assert.ok(step.includes('"$verb" bot --env-file /etc/openvibe/bot.env'), step);
assert.match(r.remaining.join('\n'), /ovhost validate bot; ovhost deploy bot --restart/);
++ // The steps that were missed for fifteen services: scraping, the browser check and a restore drill.
++ assert.match(r.remaining.join('\n'), /prometheus-config\.js/);
++ assert.match(r.remaining.join('\n'), /add bot to --sites in openvibe-browsercheck\.service/);
++ assert.match(r.remaining.join('\n'), /ovhost backup bot --logical; ovhost drill bot/);
const repeat = await cli('service', 'add', 'bot');
assert.strictEqual(repeat.code, 1);
assert.match(repeat.out, /already exists/);