Can I use custom check attributes in the check command?

The documentation for checks says that “Custom check definition attributes may be defined to provide context about the check, or to control or modify check command or handler behaviors.” (https://sensuapp.org/docs/latest/reference/checks.html#custom-attributes)

How do i get a command to use data defined as custom attributes?

I know i can use command token substitution for using data from clients, but can it be used for custom check data?

Here’s an example:

check-http.rb --url https://gitlab.example.com/health_check.json?token=:::gitlab_health.token::: --response-code 200

``

And you’d have the following in e.g. your client.json:

“gitlab_health”:
{
“token”:“REDACTED”
},

``

I hope that answers your question :slight_smile:

···

On Tuesday, February 21, 2017 at 5:31:59 PM UTC+1, David Andrade wrote:

I know i can use command token substitution for using data from clients, but can it be used for custom check data?