fix: msyql errors bgp-peers, daily, callback (#5425)

* fix: msyql errors bgp-peers, daily, callback

* select cell instead of an row
This commit is contained in:
Tony Murray
2017-01-13 16:21:29 -06:00
committed by Neil Lathwood
parent 9fa8485f23
commit 370e368ffe
3 changed files with 3 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ if ($options['f'] === 'rrd_purge') {
if ($options['f'] === 'syslog') {
if (is_numeric($config['syslog_purge'])) {
$rows = dbFetchRow('SELECT MIN(seq) FROM syslog');
$rows = (int)dbFetchCell('SELECT MIN(seq) FROM syslog');
while (true) {
$limit = dbFetchRow('SELECT seq FROM syslog WHERE seq >= ? ORDER BY seq LIMIT 1000,1', array($rows));
if (empty($limit)) {

View File

@@ -31,8 +31,7 @@ if ($enabled == 1) {
'bills' => 'SELECT COUNT(`bill_type`) AS `total`,`bill_type` FROM `bills` GROUP BY `bill_type`',
'cef' => 'SELECT COUNT(`device_id`) AS `total` FROM `cef_switching`',
'cisco_asa' => 'SELECT COUNT(`oid`) AS `total`,`oid` FROM `ciscoASA` WHERE `disabled` = 0 GROUP BY `oid`',
'mempool' => 'SELECT COUNT(`cmpName`) AS `total`,`cmpName` FROM `cmpMemPool` GROUP BY `cmpName`',
'current' => 'SELECT COUNT(`current_type`) AS `total`,`current_type` FROM `current` GROUP BY `current_type`',
'mempool' => 'SELECT COUNT(`mempool_descr`) AS `total`,`mempool_descr` FROM `mempools` GROUP BY `mempool_descr`',
'dbschema' => 'SELECT COUNT(`version`) AS `total`, `version` FROM `dbSchema`',
'snmp_version' => 'SELECT COUNT(`snmpver`) AS `total`,`snmpver` FROM `devices` GROUP BY `snmpver`',
'os' => 'SELECT COUNT(`os`) AS `total`,`os` FROM `devices` GROUP BY `os`',

View File

@@ -201,7 +201,7 @@ if ($config['enable_bgp']) {
$afi = $entry['afi'];
$safi = $entry['safi'];
if (!$af_list[$afi][$safi] || !$af_list[$entry['bgpPeerIdentifier']][$afi][$safi]) {
dbDelete('bgpPeers_cbgp', '`device_id` = ? AND `bgpPeerIdentifier` = ?, afi=?, safi=?', array($device['device_id'], $peer['ip'], $afi, $safi));
dbDelete('bgpPeers_cbgp', '`device_id` = ? AND `bgpPeerIdentifier` = ? AND afi=? AND safi=?', array($device['device_id'], $peer['ip'], $afi, $safi));
}
}
}