I have a per script that I have bundled as an asset per the doc and uploaded to one of my internal repositories. However, when I execute the perl script as a part of the Check, it says
sh: 1 script not found
Per this Jef Practice: Preparing to use assets , I also printed the PATH and LD_LIBRARY_PATH and the asset path "/var/cache/sensu/sensu-agent//asset/bin/ on the agent is not present/getting appended to both of them.
Do these have to be manually set in the path for the respective assets ?
Can you confirm that your asset is defined as a runtime_asset for the check?
Can you test that the agent is able to download via the URL listed for the asset by logging onto the agent and running a curl or wget with the URL?
Can you confirm that the agent is downloading the asset as defined? On an agent that has a subscription that includes your check there should be a directory in /var/cache/sensu/sensu-agent that matches the SHA-512 checksum of your asset.
Hi Todd - Thanks for your quick reply. I see the asset downloaded on the agent and SHA value does match the downloaded one too. I have also mentioned the same in the runtime_assets directive as well.
One quick question is, does the agent and the backend need to be run as sensu user ?
Typically the backend and agent run as the sensu user, yes. And therefore the /var/cache/sensu directory structure is owned by the sensu user.
Can you provide your check and asset definitions here (redact what information you may need to such as internal URLs). Please output them as yaml using sensuctl check info <check name> --format yaml and sensuctl asset info --format yaml`. And could you also post the top line (the #! one) from the script that is in the asset?