diff --git a/cmd_realtime.php b/cmd_realtime.php index b8a3d1355b..79dfb90e22 100644 --- a/cmd_realtime.php +++ b/cmd_realtime.php @@ -83,15 +83,17 @@ if (!count($local_data_ids)) { exit(-1); } -$ids = array(); -$hosts = array(); +$ids = array(); +$hosts = array(); +$idbyhost = array(); + foreach ($local_data_ids as $row) { $ids[$row['local_data_id']] = $row['local_data_id']; $hosts[$row['host_id']] = $row['host_id']; + $idbyhost[$row['host_id']][] = $row['local_data_id']; } - $print_data_to_stdout = true; if (sizeof($idbyhost)) { @@ -179,7 +181,7 @@ if (sizeof($idbyhost)) { $poller_items = db_fetch_assoc_prepared('SELECT * FROM poller_item WHERE host_id = ? - AND local_data_id IN(' . implode(',', $local_data_ids) . ')', + AND local_data_id IN(' . implode(',', $local_data_ids['local_data_ids']) . ')', array($host_id)); if (sizeof($poller_items)) { @@ -189,7 +191,10 @@ if (sizeof($idbyhost)) { if (($item['snmp_version'] == 0) || (($item['snmp_community'] == '') && ($item['snmp_version'] != 3))) { $output = 'U'; } else { - $host = db_fetch_row_prepared('SELECT ping_retries, max_oids FROM host WHERE id = ?', array($host_id)); + $host = db_fetch_row_prepared('SELECT ping_retries, max_oids + FROM host + WHERE id = ?', + array($host_id)); if (!sizeof($host)) { $host['ping_retries'] = 1; @@ -276,3 +281,4 @@ if (sizeof($idbyhost)) { $return_value = proc_close($cactiphp); } } + diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 93d8953cae..51d829a703 100644 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -19,6 +19,7 @@ Cacti CHANGELOG -issue#1306: Fix issue #1306 where multi-value args are not parsing correctly -issue#1309: Provide meaningful authentication errors in graph_json.php and graph_image.php -issue#1310: Unable to return to previous page from auth_changepassword.php +-issue#1315: Realtime not working on local data collector 1.1.34 -issue#1040: PHP version 7.2 - ERROR PHP WARNING: sizeof() diff --git a/graph_realtime.php b/graph_realtime.php index bbf3348136..1f8fee4ba7 100644 --- a/graph_realtime.php +++ b/graph_realtime.php @@ -228,7 +228,7 @@ $selectedTheme = get_selected_theme();