Hi All,

I have a small suggestion regarding the info displayed together with each interface under 'Port' => 'Detail' .

There we noticed the observium displays all other devices on the same subnet from other devices at the last column of each interface irrespective of whether they are real IPs ( internet routable ) or Private IP addresses ( defined in RFC 1918 ).

Although this feature is really good, we feel that if there is an option to exclude certain IP subnets from this selection, specially the private IP addresses
it would make sense because we found there are lot of unrelated interfaces are getting listed ( about 50 items ) under this merely because of the fact that they are having the same IP addresses/subnets but which are completely different  and isolated device interfaces in other VPNs which is common in IP VPN setups.

We found the location where this logic is programmed, and we can easily changed the SQL query to accommodate this as follows ( `ipv4_address` NOT LIKE '192.168.% etc. )  shown below

But it would be elegant if these excluding subnets could be defined as a config parameter and filter them here.

This is just a suggestion, there may be better ideas out there with you guys

What do you all think ?

/opt/observium/html/includes/print-interface.inc.php  :



  if ($port_details)
  { // Show which other devices are on the same subnet as this interface
    foreach (dbFetchRows("SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `port_id` = ? AND `ipv4_address` NOT LIKE '127.%' AND `ipv4_address` NOT LIKE '192.168.%'", array($port['port_id'])) as $net)
    {
      $sql = "SELECT N.*, P.`port_id`, P.`device_id` FROM `ipv4_addresses` AS A, `ipv4_networks` AS N, `ports` AS P
              WHERE A.`port_id` = P.`port_id` AND P.`device_id` != ?
              AND A.`ipv4_network_id` = ? AND N.`ipv4_network_id` = A.`ipv4_network_id`
              AND P.`ifAdminStatus` = 'up'";

      $params = array($device['device_id'], $net['ipv4_network_id']);

      foreach (dbFetchRows($sql, $params) AS $new)
      {
        if ($cache['devices']['id'][$new['device_id']]['disabled'] && !$config['web_show_disabled']) { continue; }
        $int_links[$new['port_id']] = $new['port_id'];
        $int_links_v4[$new['port_id']][] = $new['ipv4_network'];
      }
    }


-- 
With Best Regards,

Supun Rathnayake

Lanka communication Services (Pvt) Ltd.
65C, Dharmapala Mawatha,
Colombo 07.
Sri Lanka.
Tel: +94-11-2437545
http://www.lankacom.net
http://blog.lankacom.net