License
MIT License
v0.1.1 · public · Published over 4 years ago
This check executes InSpec profiles and generates a Sensu event for each non-passing control.
check-inspec.rb
Usage: check-inspec.rb (options)
-l, --handler HANDLER
-d, --tests-dir /tmp/dir
Run a local profile and set Sensu event handler to example_handler:
check-inspec.rb -d /tmp/my_inspec_profile -l example_handler
Run a remote profile and set Sensu event handler to example_handler:
check-inspec.rb -d https://my-inspec-profile.s3.amazonaws.com/example-profile.tar.gz -l example_handler
Assets are the best way to make use of this plugin. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:
sensuctl asset add sensu-plugins/sensu-plugins-inspec
If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai Asset Index page.
---
type: CheckConfig
spec:
command: "check-inspec.rb -d /tmp/my_inspec_profile -l example_handler"
handlers: []
high_flap_threshold: 0
interval: 10
low_flap_threshold: 0
publish: true
runtime_assets:
- sensu-plugins/sensu-plugins-disk-checks
- sensu/sensu-ruby-runtime
subscriptions:
- linux
{
"checks": {
"check-inspec": {
"command": "check-inspec.rb -d /tmp/my_inspec_profile -l example_handler",
"subscribers": ["linux"],
"interval": 10,
"refresh": 10
}
}
}
check-inspec
Run inspec controls and generate a new Sensu event for each failed inspect test.
This check will return critical if any inspec tests fail.
The -l
option sets the handler to use in the generated Sensu events. Defaults to the default
handler.
The -d
option sets the directory containing tests to run.
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×