Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-4001

Separate $port['ifDescr'] and $port['ifName'] filtering in is_port_valid()

    XMLWordPrintable

Details

    • Help
    • Resolution: Not A Bug
    • Trivial
    • None
    • Professional Edition
    • Default
    • PHP8, Ubuntu 20

    Description

      Hello,

       

      Currently, the configuration variable "bad_if" and "bad_if_regexp" are used to filtered port on $port['ifDescr'] and $port['ifName'] in includes/entities/port.inc.php.

       

       

         // FIXME. Prefer regexp
        if ($valid_ifDescr && str_icontains_array($port['ifDescr'], (array)$config['bad_if'])) {
          $bi = $GLOBALS['str_last_needle'];
          print_debug("ignored (by ifDescr): ".$port['ifDescr']." [ $bi ]");
          return FALSE;
        }
        if ($valid_ifName && $nosame_ifName && str_icontains_array($port['ifName'], (array)$config['bad_if'])) {
          $bi = $GLOBALS['str_last_needle'];
          print_debug("ignored (by ifName): ".$port['ifName']." [ $bi ]");
          return FALSE;
        }
      

       

      I have problems with this in a Juniper and Nokia environment.
      The two manufacturers do not use the field in the same way, Nokia add ifAlias in the ifDescr :

       

      $config['bad_if'] = array("em", "me", "dsc", "tap", "gre", "gr", "pe", "mt", "ipip", "pime", "pimd", "mtun", "demux", "ip", "pe", "vt", "mt", "pd", "cbp", "pp", "lt", "ut", "ud", "lc", "lsi", "pfe", "pfh", "esi", "jsrv");

       

      NOKIA :

      Xignored (by ifDescr): lag-10, IP interface, IPYX/012345/800/ABC customer name [ ip ]

        [1342177290] => array(
                          [ifDescr]      => string(101) "lag-10, IP interface, IPYX/012345/800/ABC customer name via esat-1/1/1, esat-1/1/2 and esat-1/1/3"
                          [ifAlias]      => string(82) "IPYX/012345/800/ABC customer via esat-1/1/1, esat-1/1/2 and esat-1/1/3"
                          [ifName]       => string(6) "lag-10"
                          [ifType]       => string(13) "ieee8023adLag"
                          [ifOperStatus] => string(2) "up"
                        )

      JUNIPER :

        [576] => array(
                   [ifDescr]      => string(12) "ge-1/1/4.100"
                   [ifAlias]      => string(36) "IPYX/12345/001/ABC customer name."
                   [ifName]       => string(12) "ge-1/1/4.100"
                   [ifType]       => string(6) "l2vlan"
                   [ifOperStatus] => string(14) "lowerLayerDown"
                 )

       

      Maybe interesting to have possibility to split  $port['ifDescr'] and $port['ifName'].
      Or define "bad_if" and "bad_if_regexp" by OS?
      In the meantime, I search with "bad_if_regexp" instead "bad_if", or $config['os'][$os]['ports_ignore']. But less easy.

       

      Thank you!

      Attachments

        Activity

          People

            landy Mike Stupalov
            johann Johann Mallet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: