$rx_packets = str_replace(' ', '', $data[$j]['rx_packets']); $tx_bytes = str_replace(' ', '', $data[$j]['tx_bytes']); $rx_bytes = str_replace(' ', '', $data[$j]['rx_bytes']); $LMS->RRD_UpdateSignalFile('node.' . $idek, $rx_signal, $tx_rate, $rx_rate, $currenttime, STEP_SIGNAL); $LMS->RRD_UpdateTransferFile('node.' . $idek, $tx_packets, $rx_packets, $tx_bytes, $rx_bytes, $currenttime, STEP_SIGNAL); if ($nd_list[$i]['nastype'] == '14') { $tx_signal = ceil(abs(intval(str_replace(' ', '', str_replace(',', '.', $data[$j]['tx_signal'] ? $data[$j]['tx_signal'] : 0))))); $signal_noise = ceil(intval(str_replace(' ', '', str_replace(',', '.', $data[$j]['signal_noise'] ? $data[$j]['signal_noise'] : 0)))); $tx_ccq = ceil(intval(str_replace(' ', '', str_replace(',', '.', $data[$j]['tx_ccq'] ? $data[$j]['tx_ccq'] : 0)))); $rx_ccq = ceil(intval(str_replace(' ', '', str_replace(',', '.', $data[$j]['rx_ccq'] ? $data[$j]['rx_ccq'] : 0)))); $ack_timeout = ceil(intval(str_replace(' ', '', str_replace(',', '.', $data[$j]['ack_timeout'] ? $data[$j]['ack_timeout'] : 0)))); $DB->Execute('INSERT INTO monitsignal (cdate, nodeid, rx_signal, tx_signal, signal_noise, tx_rate, rx_rate, rx_ccq, tx_ccq, ack_timeout) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ', array($currenttime, $idek, $rx_signal, $tx_signal, $signal_noise, $tx_rate, $rx_rate, $rx_ccq, $tx_ccq, $ack_timeout)); $LMS->RRD_UpdateSignalExpandedFile('node.' . $idek, $tx_signal, $signal_noise, $tx_ccq, $rx_ccq, $ack_timeout, $currenttime, STEP_SIGNAL); if (get_conf('monit.autocreate_chart', 0)) { $LMS->RRD_CreateSmallSignalImage('node.' . $idek, '-1d', 'now', NULL, true); } } else { if (get_conf('monit.autocreate_chart', 0)) { $LMS->RRD_CreateSmallSignalImage('node.' . $idek, '-1d', 'now', NULL, false); } $DB->Execute('INSERT INTO monitsignal (cdate, nodeid, rx_signal, tx_rate, rx_rate) VALUES (?, ?, ?, ?, ?) ', array($currenttime, $idek, $rx_signal, $tx_rate, $rx_rate)); } $DB->Execute('UPDATE monitnodes SET src_netdev = ? WHERE id = ? ;', array($nd_list[$i]['netdevid'], $idek)); } } } } } } }