From d8c359bd8a7ac5f95ba2aebbdfa432026ff11432 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 11 Jan 2023 17:49:58 -0800 Subject: [PATCH] instructions documenting added ability to trigger collector at startup. Disabled by default, (enable by setting `-e COLLECTOR_RUN_STARTUP=true`) Added COLLECTOR_RUN_STARTUP_SLEEP env variable to specify seconds before calling scrutiny collector on first run, default sleep value = 1s. --- docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md b/docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md index 793d3cb..3a9476a 100644 --- a/docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md +++ b/docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md @@ -305,3 +305,20 @@ Or if you're not using docker, you can pass CLI arguments to the collector durin ```bash scrutiny-collector-metrics run --debug --log-file /tmp/collector.log ``` + +## Collector trigger on startup + +When the `omnibus` docker image starts up, it will automatically trigger the collector, which will populate the Scrutiny +Webui with your disks. +This is not the case when running the collector docker image in **hub/spoke** mode, as the collector and webui are +running in different containers (and potentially different host machines), so +the web container may not be ready for incoming connections. By default the container will only run the collector at the +time specified in the cron schedule. + +You can force the collector to run on startup using the following env variables: + +- `-e COLLECTOR_RUN_STARTUP=true` - forces the collector to run on startup (cron will be started after the collector + completes) +- `-e COLLECTOR_RUN_STARTUP_SLEEP=10` - if `COLLECTOR_RUN_STARTUP` is enabled, you can use this env variable to + configure the delay before the collector is run (default: `1` second). Used to ensure the web container has started + successfully.