Skip to content

Options

Run modes

cmt has no long-running mode by default - every invocation resolves its config, runs the checks once, and exits. There are three ways to schedule that:

Mode How Notes
Ad hoc cmt Interactive/one-off: runs every resolved check regardless of conf.frequency; only ships to cli unless --report is also passed.
External scheduler cmt --cron (cron/systemd, re-invoking cmt on a fixed tick) Implies --report; enables per-check conf.frequency gating, so a check configured to run every 5m isn’t re-run on every 1-minute tick.
Built-in loop cmt daemon A long-running in-binary interval loop (global.interval, sub-minute capable - not expressible via external cron). Always implies --cron/--report. Singleton via a non-blocking file lock (<cmtDir>/daemon.lock): a second concurrent cmt daemon just exits 0. Self-recycles after global.max_daemon_loops ticks; meant to be pointed at by an OS-native supervisor (systemd Restart=always, a Scheduled Task, cron */1 * * * * as a restart-if-dead check) so it comes back after a recycle or a crash.
# crontab, one line
* * * * * /usr/local/bin/cmt --cron >> /var/log/cmt.log 2>&1

# or the built-in loop, under systemd/supervision
cmt daemon

Reporting and preview

  • --report - invoke every non-cli output and persist hysteresis state. cli always runs regardless.
  • --dryrun - build each output’s payload but skip the actual send (only meaningful for an output already invoked via --report/--cron).
  • --debug - print each output’s constructed payload before sending.
cmt --report --dryrun --debug     # preview every output's payload, send nothing

Ad hoc filters

  • -c, --check <name> - run only the check with this name.
  • -m, --module <name> - run only checks of this module.
  • --output <name> - ship results only to the output with this name (still gated by --report/--cron unless it’s cli).
  • -l, --long - long/detailed cli output instead of the default one-line-per-check summary.
  • --single - sequential mode (equivalent to --parallel 1).

Config-fetch control

Only relevant once global.url/client_id are set (see Configuration):

  • default - fetch; fall back to the on-disk cache (remote.json) within max_conf_age on failure.
  • --refresh-conf - force a fresh fetch; error out instead of falling back to the cache.
  • --cached-conf - skip the network entirely, use the last cached config (errors out if nothing was ever cached).

Identity/connection flags

--url, --client_id, --client_secret, --node, --timeout, --ssl_skipverify, --parallel mirror the matching global.* config fields (see Configuration) - useful for a one-off override without editing conf.yml.

Other commands

  • cmt checkconfig - print the merged effective config (secrets redacted) and exit.
  • cmt listmodules - list registered check modules.
  • cmt doc [topic|module] - built-in reference for global/outputs/checks, or one module’s conf: fields.
  • cmt available <module> - list real-world targets a module could check on this host (e.g. running processes, mountpoints), for modules where that’s meaningful.
  • cmt version - print the version.

Run cmt --help (or cmt <command> --help) for the exhaustive, current list.