Skip to content

Commit e2eb52f

Browse files
committed
log script probe output if any is generated
closes valeriansaliou#138
1 parent 78100ca commit e2eb52f

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/prober/manager.rs

+19-5
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,25 @@ fn proceed_replica_probe_script(script: &String) -> (Status, Option<Duration>) {
521521
let start_time = SystemTime::now();
522522

523523
let status = match run_script::run(script, &Vec::new(), &ScriptOptions::new()) {
524-
Ok((code, _, _)) => {
525-
debug!(
526-
"prober script execution succeeded with return code: {}",
527-
code
528-
);
524+
Ok((code, stdout, stderr)) => {
525+
if stdout == "" {
526+
debug!(
527+
"prober script execution succeeded with return code: {}",
528+
code
529+
);
530+
} else {
531+
debug!(
532+
"prober script execution succeeded with return code: {} (output: {})",
533+
code, stdout
534+
);
535+
}
536+
537+
if stderr != "" {
538+
info!(
539+
"prober script emitted error data: {}",
540+
stderr
541+
);
542+
}
529543

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

0 commit comments

Comments
 (0)