From 9254341f0852e09de1a89ac122a05e087564786b Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Fri, 29 May 2026 16:51:06 -0700 Subject: [PATCH] fix(poller): coerce invalid SCRIPT/SCRIPT_PHP output to U in cmd.php The SCRIPT and SCRIPT_PHP branches logged an invalid (non-numeric, shape-invalid) collector response but left $output as the raw junk, unlike the SNMP branch and cmd_realtime.php which reset it to 'U'. Mirror them so a bad value is stored as U rather than a raw string in poller_output. Signed-off-by: Thomas Vincent --- cmd.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd.php b/cmd.php index 07d58432e9..871898569b 100755 --- a/cmd.php +++ b/cmd.php @@ -729,6 +729,8 @@ function collect_device_data(&$item, &$error_ds) { if (read_config_option('spine_log_level') == 2) { cacti_log("WARNING: Invalid Response, Device[$host_id] DS[$ds] SCRIPT: " . $item['arg1'] . ", output: $output", $print_data_to_stdout, 'POLLER'); } + + $output = 'U'; } } @@ -753,6 +755,8 @@ function collect_device_data(&$item, &$error_ds) { if (read_config_option('spine_log_level') == 2) { cacti_log("WARNING: Invalid Response, Device[$host_id] DS[$ds] SERVER: " . $item['arg1'] . ", output: $output", $print_data_to_stdout, 'POLLER'); } + + $output = 'U'; } }