Sensu check: command not found

All,
could someone help me to pointing out what am I doing wrong here as my check based on my asset is giving my “command not found” and I cannot figure out why …

NOTE: forum is not allowing more than 2 urls in the post for new users so server addresses will be replaced.

I have created an asset called passwww-check which I have setup and I can see it in sensu:
passwww-check myserver/…/passwww-check.tar.gz da2451e

It holds simple bash script called passwww-check.sh tar-gzipped and put on the server.
Tar is getting copied as expected and I can see it un-gzipped on the host I am trying to run it on.

Check itself prompts me that the script was not found. I do not see anything in logs even though I have other (even info) level messages in the logs.

This is my asset config:
type: Asset
api_version: core/v2
metadata:
name: passwww-check
labels:
spec:
url: http://myserver.local:8080/passwww-check.tar.gz
sha512: da2451e90b6fca5e43eaeaf3fdb03b66638f7fb49e2eb75b0f8089124729d65e9f69f029694fcd85241c25066183edbc3bf061b15f811adf0b1472c8e1eeb3d2

and this is my check config:
type: CheckConfig
api_version: core/v2
metadata:
created_by: sensu
labels:
sensu.io/managed_by: sensuctl
name: dpa-passwww-check-full-holding
spec:
check_hooks: null
command: passwww-check.sh /var/tmp/sensudata destination-website
env_vars: null
handlers:
high_flap_threshold: 0
interval: 60
low_flap_threshold: 0
output_metric_format: “”
output_metric_handlers: null
proxy_entity_name: “”
publish: true
round_robin: false
runtime_assets:

  • passwww-check
    secrets: null
    stdin: false
    subdue: null
    subscriptions:
  • dpa
    timeout: 0
    ttl: 0

and this is listing of the /var/cache/… folder on the host itself:
root@umpf # ls -la /var/cache/sensu/sensu-agent/da2451e90b6fca5e43eaeaf3fdb03b66638f7fb49e2eb75b0f8089124729d65e9f69f029694fcd85241c25066183edbc3bf061b15f811adf0b1472c8e1eeb3d2/passwww-check/bin/
total 12
drwxr-xr-x 2 sensu sensu 4096 Jan 6 00:00 .
drwxr-xr-x 5 sensu sensu 4096 Jan 6 00:00 …
-rwx------ 1 sensu sensu 699 Jan 6 00:00 passwww-check.sh

Script works when run from the client all is fine when it comes to providing the script to the clients but for some reason check does not see the script which is on this server. What am I missing here?

OK - I have fixed it.
For those who are still looking for the answer …

When you are preparing tar.gz file ensure that bin/ lib/ and so on are at the top of the file tree.
I have had all the files in passwww-check directory which caused the problem.

So the path to the script was:
/var/cache/sensu/sensu-agent/da24…b3d2/passwww-check/bin/passwww-check.sh

but should be:
/var/cache/sensu/sensu-agent/da24…b3d2/bin/passwww-check.sh

Then it works like a charm!

1 Like