Agent don't find plugins file

Hey, I published memory check to our clients but I’m getting this error:
sh: 1: check-memory.rb: not found

What I did:
sensu-plugins-memory-checks was installed on client using sensu-install
check defined as documented in Bonsai
asset sensu-plugins/sensu-plugins-memory-check installed using sensuctl

Sensu Log shows:
sensu-agent[27288]: {“assets”:[“sensu-plugins/sensu-plugins-memory-check”,“sensu/sensu-ruby-runtime”],“check”:“check_memory_usage”,“component”:“agent”,“level”:“debug”,“msg”:“no assets defined for this check”,“namespace”:“default”,“time”:“2021-05-04T13:23:07+03:00”}

“no assets defined for this check” but assets defined as documented in bonsai

BTW - I installed cpu asset using same procedure and it worked perfectly


You are mixing and matching plugin usage instructions in an incompatible way. Things installed with sensu-install do not need to reference a run time asset. If you installed the plugin via sensu-install on the host, then you do not need to define any runtime asset configuration in your check.

For anything that was installed with sensu-install will need to either use the full path to the plugin executable in your check definition or modify the Sensu agent running environment to make sure the directory sensu-install installs executables into is part of the agent’s executable PATH environment.

sensu-install uses an existing ruby environment already present on the host, to install Sensu ruby plugins from source based ruby gems packages. sensu-install is basically a thin wrapper over the gem tool with some special syntax to install into a special location.

The executable path that sensu-install uses i think can depend on how you installed sensu-install but on my rpm based linux system with sensu-install installed using the sensu-plugins-ruby package… the directory is /opt/sensu-plugins-ruby/embedded/bin/

So assuming my system is similar to yours, the check command needs to be: /opt/sensu-plugins-ruby/embedded/bin/check-memory.rb

Or you can update the agent’s PATH environment variable and set it explicitly such that you include which ever executable paths you want using the agent’s start-up environment override file.