How do assets work?

At runtime, the agent sequentially fetches assets and stores them in its local cache. Asset dependencies are then injected into the PATH so they are available when the command is executed. Subsequent check executions look for the asset in local cache and ensure the contents match the checksum. An agent’s local cache can be set using the --cache-dir flag; it defaults to /var/cache/sensu/sensu-agent (C:\\ProgramData\sensu\cache\sensu-agent on Windows systems). If the requested asset is not in the local cache, it is downloaded from the asset url. The Sensu backend does not currently provide any storage for assets; they are expected to be retrieved over HTTP or HTTPS.

The agent expects that an asset is a TAR archive that may optionally be GZip’d. Any scripts or executables should be within a bin/ folder within in the archive.

The following are injected into the execution context:

  • {PATH_TO_ASSET}/bin is injected into the PATH environment variable.
  • {PATH_TO_ASSET}/lib is injected into the LD_LIBRARY_PATH environment variable.
  • {PATH_TO_ASSET}/include is injected into the CPATH environment variable.

Assets specification


description The unique name of the asset, validated with go regex \A[\w\.\-]+\z
required true
type String
"name": "check_script"
description The URL location of the asset.
required true
type String
"url": ""
description The checksum of the asset.
required true
type String
"sha512": "4f926bf4328..."
description Information about the asset, in the form of key value pairs.
required false
type Map
"metadata": {
"Content-Type": "application/zip", 
"X-Intended-Distribution": "trusty-14"}
description A set of Sensu query expressions used by the agent to determine if the asset should be installed. If multiple expressions are included, each expression must return true in order for the agent to install the asset. Modifier operators (for example: +, -, and !) cannot be used in asset filters.
required false
type Array
"filters": ["System.OS=='linux'", "System.Arch=='amd64'"] 
description The Sensu RBAC organization that this asset belongs to.
required false
type String
default current organization value configured for sensuctl (ie default)
  "organization": "default"


Asset definition

  "name": "asset_example",
  "url": "",
  "sha512": "4f926bf4328fbad2b9cac873d117f771914f4b837c9c85584c38ccf55a3ef3c2e8d154812246e5dda4a87450576b2c58ad9ab40c9e2edc31b288d066b195b21b",
  "metadata": null,
  "filters": [
  "organization": "default"