prometheus-community / node-exporter-textfile-collector-scripts

Scripts for node-exporter's textfile collector
Apache License 2.0
512 stars 191 forks source link

nvme_metrics.sh does not work at crontab #138

Closed g00g1 closed 1 year ago

g00g1 commented 1 year ago

When launch nvme_metrics.sh manually from shell, the script successfully returns metrics. But when I launch it from crontab using bash script, the execution fails with the error nvme_metrics.sh: nvme is not installed. Aborting. which is not true at all - I have nvme-cli installed and working, as well as jq.

As a temporary fix I have commented this if block, but this should be properly fixed at upstream, however I cannot figure out why this is happening.

Impact123 commented 1 year ago

It's probably because it's not in the PATH of your cron job. One fix is using a full path, the other is to set PATH in your cron job. Also see #137

g00g1 commented 1 year ago

My bad, haven't seen that issue.

Yes, the issue was with PATH environment variable. Thank you for so quick reply!