Skip to content

Commit

Permalink
log script probe output if any is generated
Browse files Browse the repository at this point in the history
  • Loading branch information
UiP9AV6Y committed Oct 13, 2023
1 parent 78100ca commit e2eb52f
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/prober/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,25 @@ fn proceed_replica_probe_script(script: &String) -> (Status, Option<Duration>) {
let start_time = SystemTime::now();

let status = match run_script::run(script, &Vec::new(), &ScriptOptions::new()) {
Ok((code, _, _)) => {
debug!(
"prober script execution succeeded with return code: {}",
code
);
Ok((code, stdout, stderr)) => {
if stdout == "" {
debug!(
"prober script execution succeeded with return code: {}",
code
);
} else {
debug!(
"prober script execution succeeded with return code: {} (output: {})",
code, stdout
);
}

if stderr != "" {
info!(
"prober script emitted error data: {}",
stderr
);
}

// Return code '0' goes for 'healthy', '1' goes for 'sick'; any other code is 'dead'
match code {
Expand Down

0 comments on commit e2eb52f

Please sign in to comment.