ricoberger / script_exporter

Prometheus exporter to execute scripts and collect metrics from the output or the exit status.
MIT License
354 stars 82 forks source link

Cannot obtain the script output/result from the script_exporter probe #83

Closed massano-davide closed 1 year ago

massano-davide commented 1 year ago

Looking at the probe page of my custom script execution, and following of course the readme examples, there's no way to obtain the script stdout result. In an example script, that returns only and always the value "50" looking at probe values it returns only

# HELP script_success Script exit status (0 = error, 1 = success).
# TYPE script_success gauge
script_success{script="pint01"} 0
# HELP script_duration_seconds Script execution time, in seconds.
# TYPE script_duration_seconds gauge
script_duration_seconds{script="pint01"} 0.005414
# HELP script_exit_code The exit code of the script.
# TYPE script_exit_code gauge
script_exit_code{script="pint01"} 0

without any trace of the output. In the readme file, it's only explained how to ignore the output on the prometheus.yaml, not how to force it. What am I missing? :(

ricoberger commented 1 year ago

Hi @massano-davide, can you maybe share your script? I'm not quite sure what the problem could be here.

ricoberger commented 1 year ago

I will close the issue for now, because of missing feedback.

If you still have an issue please let me know and I can re-open the issue.