Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⭐️ allow customisation of scan interval #1044

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

chris-rock
Copy link
Member

fixes #653

You can now pass in alternative values to cnspec serve to configure the timer and its splay.

> cnspec serve --help
Start cnspec in background mode.

Usage:
  cnspec serve [flags]

Flags:
  -h, --help                    help for serve
      --inventory-file string   Set the path to the inventory file
      --splay int               randomize the timer by up to this many minutes (default 60)
      --timer int               scan interval in minutes (default 60)

Global Flags:
      --api-proxy string   Set proxy for communications with Mondoo API
      --auto-update        Enable automatic provider installation and update (default true)
      --config string      Set config file path (default $HOME/.config/mondoo/mondoo.yml)
      --log-level string   Set log level: error, warn, info, debug, trace (default "info")
  -v, --verbose            Enable verbose output

To run server from CLI:

> cnspec serve --timer 30 --splay 30
→ start cnspec background service
→ scan interval is 30 minute(s) with a splay of 30 minutes(s)

When cnspec is used as a service, it is easier to configure the timer and the splay in the configuration:

api_endpoint: https://us.api.mondoo.com
scan_interval:
  timer: 5
  splay: 10
auto_update: true
...

@chris-rock chris-rock force-pushed the chris-rock/customize-scan-interval branch from 507698c to f87c700 Compare January 15, 2024 09:55
@chris-rock chris-rock force-pushed the chris-rock/customize-scan-interval branch from f87c700 to 2a14bd6 Compare January 15, 2024 09:57
Copy link
Member

@arlimus arlimus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so cool to have this configurable now

@arlimus arlimus merged commit 7fba869 into main Jan 15, 2024
9 checks passed
@arlimus arlimus deleted the chris-rock/customize-scan-interval branch January 15, 2024 10:01
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CNSPEC Client will not exit to console after changing the scan interval
2 participants