7890d92
--- cacti-1.1.38/cmd.php.orig	2018-04-15 23:13:47.000000000 +0200
7890d92
+++ cacti-1.1.38/cmd.php	2018-07-25 15:08:18.846078292 +0200
7890d92
@@ -104,6 +104,25 @@ function open_snmp_session($host_id, &$i
7890d92
 	}
7890d92
 }
7890d92
 
7890d92
+function get_max_column_width() {
7890d92
+	$pcol_data = db_fetch_row("SHOW COLUMNS FROM poller_output WHERE Field='output'");
7890d92
+	$bcol_data = db_fetch_row("SHOW COLUMNS FROM poller_output_boost WHERE Field='output'");
7890d92
+
7890d92
+	if (isset($pcol_data['Type'])) {
7890d92
+		$pcol = $pcol_data['Type'];
7890d92
+		$data = explode('(', $pcol);
7890d92
+		$pmax  = trim($data[1], ')');
7890d92
+	}
7890d92
+
7890d92
+	if (sizeof($bcol_data)) {
7890d92
+		$bcol = $bcol_data['Type'];
7890d92
+		$data = explode('(', $bcol);
7890d92
+		$bmax  = trim($data[1], ')');
7890d92
+	}
7890d92
+
7890d92
+	return min($pmax, $bmax);
7890d92
+}
7890d92
+
7890d92
 function display_version() {
7890d92
 	$version = get_cacti_version();
7890d92
 	echo "Cacti Legacy Host Data Collector, Version $version, " . COPYRIGHT_YEARS . "\n";
7890d92
@@ -159,6 +178,7 @@ $debug     = false;
7890d92
 $mibs      = false;
7890d92
 $mode      = 'online';
7890d92
 $poller_id = $config['poller_id'];
7890d92
+$maxwidth  = get_max_column_width();
7890d92
 
7890d92
 if (sizeof($parms)) {
7890d92
 	foreach($parms as $parameter) {
7890d92
@@ -410,6 +430,7 @@ if ((sizeof($polling_items) > 0) && (rea
7890d92
 	$output_array = array();
7890d92
 	$output_count = 0;
7890d92
 	$error_ds     = array();
7890d92
+	$width_dses   = array();
7890d92
 
7890d92
 	/* create new ping socket for host pinging */
7890d92
 	$ping = new Net_Ping;
7890d92
@@ -502,10 +523,8 @@ if ((sizeof($polling_items) > 0) && (rea
7890d92
 						case POLLER_ACTION_SNMP: /* snmp */
7890d92
 							open_snmp_session($host_id, $item);
7890d92
 
7890d92
-
7890d92
 							if (isset($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']])) {
7890d92
-								$sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']]->quick_print = true;
7890d92
-								$output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1'], true);
7890d92
+								$output = cacti_snmp_session_get($sessions[$host_id . '_' . $item['snmp_version'] . '_' . $item['snmp_port']], $index_item['arg1']);
7890d92
 							} else {
7890d92
 								$output = 'U';
7890d92
 							}
7890d92
@@ -729,6 +748,11 @@ if ((sizeof($polling_items) > 0) && (rea
7890d92
 			} /* End Switch */
7890d92
 
7890d92
 			if (isset($output)) {
7890d92
+				if (read_config_option('poller_debug') == 'on' && strlen($output) > $maxwidth) {
7890d92
+					$width_dses[] = $data_source;
7890d92
+					$width_errors++;
7890d92
+				}
7890d92
+
7890d92
 				/* insert a U in place of the actual value if the snmp agent restarts */
7890d92
 				if (($set_spike_kill) && (!substr_count($output, ':'))) {
7890d92
 					$output_array[] = sprintf('(%d, %s, %s, "U")', $item['local_data_id'], db_qstr($item['rrd_name']), db_qstr($host_update_time));
7890d92
@@ -742,7 +766,8 @@ if ((sizeof($polling_items) > 0) && (rea
7890d92
 						(local_data_id, rrd_name, time, output)
7890d92
 						VALUES ' . implode(', ', $output_array));
7890d92
 
7890d92
-					if (read_config_option('boost_redirect') == 'on') {
7890d92
+					if (read_config_option('boost_redirect') == 'on'
7890d92
+						&& read_config_option('boost_rrd_update_enable') == 'on') {
7890d92
 						db_execute('INSERT IGNORE INTO poller_output_boost
7890d92
 							(local_data_id, rrd_name, time, output)
7890d92
 							VALUES ' . implode(', ', $output_array));
7890d92
@@ -768,6 +793,10 @@ if ((sizeof($polling_items) > 0) && (rea
7890d92
 		cacti_log('WARNING: Invalid Response(s), Errors[' . sizeof($error_ds) . '] Device[' . $last_host . '] Thread[1] DS[' . implode(', ', $error_ds) . ']', false, 'POLLER');
7890d92
 	}
7890d92
 
7890d92
+	if (sizeof($width_dses)) {
7890d92
+		cacti_log('WARNING: Long Responses Errors[' . sizeof($width_dses) . '] DS[' . implode(', ', $width_dses) . ']', false, 'POLLER');
7890d92
+	}
7890d92
+
7890d92
 	if ($output_count > 0) {
7890d92
 		db_execute('INSERT IGNORE INTO poller_output
7890d92
 			(local_data_id, rrd_name, time, output)