Fixed BGP session count to exclude sessions that no longer have a device associated

This commit is contained in:
laf
2014-10-29 19:52:50 +00:00
parent b3d9bf03a4
commit a792d10a76

View File

@@ -305,7 +305,7 @@ echo('
<?php
}
$routing_count['bgp'] = dbFetchCell("SELECT COUNT(bgpPeer_id) from `bgpPeers`");
$routing_count['bgp'] = dbFetchCell("SELECT COUNT(bgpPeer_id) from `bgpPeers` LEFT JOIN devices AS D ON bgpPeers.device_id=D.device_id WHERE D.device_id IS NOT NULL");
$routing_count['ospf'] = dbFetchCell("SELECT COUNT(ospf_instance_id) FROM `ospf_instances` WHERE `ospfAdminStat` = 'enabled'");
$routing_count['cef'] = dbFetchCell("SELECT COUNT(cef_switching_id) from `cef_switching`");
$routing_count['vrf'] = dbFetchCell("SELECT COUNT(vrf_id) from `vrfs`");