script_exporter icon indicating copy to clipboard operation
script_exporter copied to clipboard

Script with space character in name or path

Open acdmail opened this issue 2 years ago • 1 comments

hi, Could you advise please on how is it possible to specify in the config file the path to the script which contains spaces, example of what I mean:

scripts:

  • name: test_spaces script: /opt/test dir/test_spaces.sh timeout: max_timeout: 55 enforced: true

For this config I am getting following error:

script_exporter: 2022/05/18 14:43:24 Script failed: fork/exec /opt/test: no such file or directory

Whatever escaping, putting in comma etc. I am trying it is still not able to execute the script

Thanks in advance

acdmail avatar May 18 '22 11:05 acdmail

Hi @acdmail, this is currently not possible.

Currently we simply split on a space, so that a user can also specify arguments for the script he wants to run.

Maybe we can add sth. like a special character which can be used in front of the space to avoid this.

ricoberger avatar May 18 '22 19:05 ricoberger

This is fixed by https://github.com/ricoberger/script_exporter/issues/55.

Nick-Triller avatar Sep 07 '22 12:09 Nick-Triller