Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. [SCM] Netdot branch master updated.       netdot-1.0.6-11-g2ed6002
      ([email protected])
   2. [SCM] Netdot branch master updated.       netdot-1.0.6-14-ge33c47c
      ([email protected])
   3. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.6-14-ge33c47c ([email protected])
   4. [Netdot - Bug #1814] (New) Use of uninitialized   value
      $address in sprintf ([email protected])
   5. [Netdot - Bug #1815] (New) cron entries running as        root
      ([email protected])
   6. [Netdot - Bug #1816] (New) LLDP issues with Netgear       switches
      ([email protected])
   7. [Netdot - Bug #1816] LLDP issues with Netgear     switches
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Wed, 25 Jun 2014 13:46:50 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch master updated.
        netdot-1.0.6-11-g2ed6002
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, master has been updated
       via  2ed6002a9dcb8ca0ef73e1f87392c6b25e393d30 (commit)
       via  d3ad4b3b0200e4d8fc1e5c138580ea8426e6130f (commit)
       via  5998ae4724d21b8f7a218a5d3bf71eca20472551 (commit)
       via  9b8b7fa16f375499340e7f6b34a4a811fd9cbc3a (commit)
      from  c8ea633ab1240ef89a6228a22975092e35482262 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2ed6002a9dcb8ca0ef73e1f87392c6b25e393d30
Author: Carlos Vicente <[email protected]>
Date:   Tue Jun 10 10:00:05 2014 -0400

    Avoid Perl warning

diff --git a/lib/Netdot/Exporter/Rancid.pm b/lib/Netdot/Exporter/Rancid.pm
index fccd01e..a94f13d 100644
--- a/lib/Netdot/Exporter/Rancid.pm
+++ b/lib/Netdot/Exporter/Rancid.pm
@@ -187,7 +187,7 @@ sub _convert_mfg {
     }
     # More granularity for some vendors
     if ( defined($mfg) && $mfg eq 'cisco' ){
-       if ( $sysdescr =~ /NX-OS/o ){
+       if ( $sysdescr && $sysdescr =~ /NX-OS/o ){
            $mfg = 'cisco-nx';
        }
     }

commit d3ad4b3b0200e4d8fc1e5c138580ea8426e6130f
Author: Carlos Vicente <[email protected]>
Date:   Tue Jun 10 09:12:50 2014 -0400

    Typo

diff --git a/etc/netdot.meta b/etc/netdot.meta
index b13cf7c..ce1a275 100644
--- a/etc/netdot.meta
+++ b/etc/netdot.meta
@@ -2203,7 +2203,7 @@ $meta = {
         description => 'Configuration Management group (i.e. RANCID group)',
         length => '64',
         nullable => 1,
-        tag => 'Config Group?',
+        tag => 'Config Group',
         type => 'varchar'
       },
       monitored => {

commit 5998ae4724d21b8f7a218a5d3bf71eca20472551
Author: Carlos Vicente <[email protected]>
Date:   Thu May 29 14:05:55 2014 -0400

    Minor fix in error message

diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
index 787eaa7..f468f50 100644
--- a/lib/Netdot/Model/Device.pm
+++ b/lib/Netdot/Model/Device.pm
@@ -6085,7 +6085,7 @@ sub _update_interfaces {
        if ( ($ifs_old && !$ifs_new) || ($ifs_new && ($ifs_new < $ifs_old) &&
                                         ($ifs_new / $ifs_old) <= $int_thold) ){
            $logger->warn(sprintf("%s: new/old interface ratio: %.2f is below 
INT_COUNT_THRESHOLD".
-                                 "Skipping interface update. Re-discover 
manually if needed.",
+                                 " Skipping interface update. Re-discover 
manually if needed.",
                                  $host, $ifs_new/$ifs_old));
            return;
        }

-----------------------------------------------------------------------

Summary of changes:
 etc/netdot.meta                      | 2 +-
 htdocs/reports/device_inventory.html | 2 +-
 lib/Netdot/Exporter/Rancid.pm        | 2 +-
 lib/Netdot/Model/Device.pm           | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 2
Date: Wed, 25 Jun 2014 13:48:41 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch master updated.
        netdot-1.0.6-14-ge33c47c
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, master has been updated
       via  e33c47cf4f980ae6282810849a54e6501810b101 (commit)
       via  7c3107e4582f301f3ce745ab7c1f9765ffa8b9cd (commit)
       via  9ec7993c97eef51674ce170eaa7b80ecbdbbd046 (commit)
      from  2ed6002a9dcb8ca0ef73e1f87392c6b25e393d30 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e33c47cf4f980ae6282810849a54e6501810b101
Merge: 2ed6002 7c3107e
Author: Carlos Vicente <[email protected]>
Date:   Wed Jun 25 16:48:04 2014 -0400

    Merge branch 'master' of github.com:cvicente/Netdot


commit 7c3107e4582f301f3ce745ab7c1f9765ffa8b9cd
Merge: c8ea633 9ec7993
Author: Carlos Vicente <[email protected]>
Date:   Wed Jun 25 13:30:54 2014 -0400

    Merge pull request #16 from candlerb/candlerb/1808
    
    Apache 2.4 compatibility


commit 9ec7993c97eef51674ce170eaa7b80ecbdbbd046
Author: Brian Candler <[email protected]>
Date:   Wed Jun 25 18:06:09 2014 +0100

    Apache 2.4 compatibility
    
    Add netdot_apache24_local.conf which works with Apache 2.4 in Ubuntu 14.04
    (note: this requires a version of Apache2::AuthCookie based on the
    unreleased httpd24 branch, but Debian have done this)
    
    Fixes redmine #1808

diff --git a/etc/Makefile b/etc/Makefile
index ffb6bd7..4c88c7a 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -4,7 +4,7 @@ include $(SRCROOT)/etc/utility-Makefile
 # makefile for etc/
 
 
-FILES = Default.conf netdot_apache2_radius.conf netdot_apache2_ldap.conf 
netdot_apache2_local.conf netdot.meta
+FILES = Default.conf netdot_apache2_radius.conf netdot_apache2_ldap.conf 
netdot_apache2_local.conf netdot_apache24_local.conf netdot.meta
 
 all: 
        $(substitute)
diff --git a/etc/netdot_apache24_local.conf b/etc/netdot_apache24_local.conf
new file mode 100644
index 0000000..2c5aa33
--- /dev/null
+++ b/etc/netdot_apache24_local.conf
@@ -0,0 +1,154 @@
+# NOTE: THIS CONFIGURATION IS FOR APACHE 2.4 ONLY
+# (with Debian/Ubuntu version of Apache2::AuthCookie)
+#
+# Modify this to your liking and include it in httpd.conf.
+# -----------------------------------------------------------------------------
+
+PerlModule ModPerl::Util
+PerlModule Apache2::Request
+PerlModule Apache2::RequestRec
+PerlModule Apache2::RequestIO
+PerlModule Apache2::RequestUtil
+PerlModule Apache2::ServerUtil
+PerlModule Apache2::Connection
+PerlModule Apache2::Log
+PerlModule Apache::Session
+PerlModule APR::Table
+PerlModule ModPerl::Registry
+PerlModule "Apache2::Const => ':common'"
+PerlModule "APR::Const => ':common'"
+
+PerlModule Apache2::SiteControl
+PerlModule HTML::Mason::ApacheHandler
+
+# Uncomment this next line if you get errors from libapreq2
+# about an 'undefined symbol'
+#LoadModule apreq_module /usr/lib/apache2/modules/mod_apreq2.so
+
+# Add Netdot's libraries to @INC
+PerlSwitches -I<<Make:PREFIX>>/lib
+
+<Perl>
+# Set up the Mason handler and global variables and import modules.
+use Netdot::Mason;
+
+# Override SiteControl's login method 
+use Netdot::SiteControlLoginWrapper;
+</Perl>
+
+
+# If you would like to put netdot somewhere other than ``/netdot''
+# just change this alias, the location of the login target
+# (i.e. /netdot/NetdotLogin), and the variable NetdotPath below.  
+Alias /netdot "<<Make:PREFIX>>/htdocs/"
+
+# Force UTF8
+PerlSetVar MasonPreamble "use utf8;"
+AddDefaultCharset utf-8 
+
+# Set the path that will be protected.
+#
+# *NOTE* This variable is used to determine absolute paths where
+# needed in the netdot pages.  The Netdot corresponds to AuthName
+# Netdot below.  If you want to change the AuthName you will still
+# need this variable as the Mason code assumes you didn't change the
+# AuthName.
+PerlSetVar NetdotPath "/netdot/"
+
+# Indicate the path to the login page. Be careful, HTML::Mason can 
+# interfere with proper handling...make sure you know your dependencies.
+# See samples and Apache::AuthCookie for more information.
+PerlSetVar NetdotLoginScript /netdot/login.html
+
+# See Apache::AuthCookie for descriptions of these.  
+#
+# A general note about these Netdot variables: Some are accessed when
+# a user requests a page and others are accessed when a user attempts
+# to login.  In our setup the login target (NetdotLogin) is in the
+# same apache scope as the netdot pages (/netdot) and these variables
+# are specified at the global scope so there isn't an issue, but if
+# you decide to move them inside a Directory, Files, or Location block
+# and move the login target be sure that you put the right variables
+# in the right places (hint: you will probably have to read the
+# AuthCookie code as it is not clear from the docs, if you don't want
+# any duplicates).  The same probably goes for the SiteControl and
+# other non prefixed variables, but since they don't have prefixes it
+# would be inconsiderate to put them at the top level (pollute the
+# global name space), and so if you move the login target be sure to
+# duplicate any relevant variables (again, it might not be obvious
+# which).
+
+# If this is set you wont be able to use unqualified hostnames and
+# rely on DNS to supply the domain.  DNS will supply the domain no
+# doubt, but the browser doesn't see it so the cookie will be invalid.
+# Also, a hostname isn't valid here.
+#PerlSetVar NetdotDomain .uoregon.edu
+PerlSetVar NetdotCache 1
+
+# We change the value of NetdotExpires dynamically to implement both
+# temporary and permanent sessions.  NetdotTemporySessionExpires
+# specifies the length of the tempory sessions, i.e. it corresponds to
+# NetdotExpires in a typical AuthCookie setup.
+PerlSetVar NetdotTemporarySessionExpires +2h
+
+# Apache 2.4 Authorization
+PerlAddAuthzProvider user Apache2::SiteControl->authz_handler
+
+<Directory <<Make:PREFIX>>/htdocs/>
+   # Other applications may have attempted to override how .html files are
+   # interpreted.  We need to reset this so that HTML::Mason can work 
+   # correctly.
+   AddType text/html .html
+
+   # Defaults: everything is protected and handled by mason
+   SetHandler perl-script
+   PerlHandler Netdot::Mason
+   AuthType Apache2::SiteControl
+   AuthName Netdot
+   Require valid-user
+
+   # Prevent mason from handling css and javascript
+   <FilesMatch (\.css|\.js)$>
+       SetHandler default-handler
+   </FilesMatch>
+
+   # Allow access to the css and and title image so the login page
+   # displays correctly.
+   <FilesMatch (\.css|title\.png)$>
+       Require all granted
+   </FilesMatch>
+
+   <Files login.html>
+       Require all granted
+   </Files>
+
+   <Files NetdotLogin>
+       Require all granted
+       PerlHandler Netdot::SiteControlLoginWrapper->login
+   </Files>
+
+   # Use Local authentication
+   PerlSetVar SiteControlMethod Netdot::AuthLocal
+
+   # Turn on debugging
+   PerlSetVar AccessControllerDebug 1
+   PerlSetVar AuthCookieDebug 1
+   PerlSetVar SiteControlDebug 1
+
+   # Configure the factories. See SiteControl::UserFactory and
+   # SiteControl::ManagerFactory
+   PerlSetVar SiteControlManagerFactory Netdot::NetdotPermissionFactory
+
+   # Configure the location of the session data on server disks
+   # NOTE: apache should have read/write access to these locations. 
+   PerlSetVar SiteControlSessions <<Make:PREFIX>>/tmp/sessions
+   PerlSetVar SiteControlLocks <<Make:PREFIX>>/tmp/sessions/locks
+
+   # Tell mod_perl that you want this module to control access:
+   PerlAuthenHandler Apache2::SiteControl->authenticate
+
+   # See Apache2::SiteControl::UserFactory.  There are more variables,
+   # but this seems to be the only one which makess SiteControl insult
+   # you in the logs :P
+   PerlSetVar UserObjectPasswordKey "Netdot gets the last laugh"
+</Directory>

-----------------------------------------------------------------------

Summary of changes:
 etc/Makefile                                       |  2 +-
 ...ache2_local.conf => netdot_apache24_local.conf} | 67 ++++++++--------------
 2 files changed, 25 insertions(+), 44 deletions(-)
 copy etc/{netdot_apache2_local.conf => netdot_apache24_local.conf} (75%)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 3
Date: Wed, 25 Jun 2014 13:50:07 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.6-14-ge33c47c
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, netdot-1.0 has been updated
       via  e33c47cf4f980ae6282810849a54e6501810b101 (commit)
       via  7c3107e4582f301f3ce745ab7c1f9765ffa8b9cd (commit)
       via  9ec7993c97eef51674ce170eaa7b80ecbdbbd046 (commit)
       via  2ed6002a9dcb8ca0ef73e1f87392c6b25e393d30 (commit)
       via  d3ad4b3b0200e4d8fc1e5c138580ea8426e6130f (commit)
       via  5998ae4724d21b8f7a218a5d3bf71eca20472551 (commit)
      from  9b8b7fa16f375499340e7f6b34a4a811fd9cbc3a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 etc/Makefile                                       |  2 +-
 etc/netdot.meta                                    |  2 +-
 ...ache2_local.conf => netdot_apache24_local.conf} | 67 ++++++++--------------
 lib/Netdot/Exporter/Rancid.pm                      |  2 +-
 lib/Netdot/Model/Device.pm                         |  2 +-
 5 files changed, 28 insertions(+), 47 deletions(-)
 copy etc/{netdot_apache2_local.conf => netdot_apache24_local.conf} (75%)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 4
Date: Thu, 26 Jun 2014 00:03:34 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1814] (New) Use of
        uninitialized   value $address in sprintf
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1814 has been reported by Marc CYPRIEN.

----------------------------------------
Bug #1814: Use of uninitialized value $address in sprintf
https://osl.uoregon.edu/redmine/issues/1814

Author: Marc CYPRIEN
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
Resolution: 


Hello,
When I updated some devices with this command :

bin/updatedevices.pl -DIFA -v 2 -c public --match "my.zone"

I got this error:
Use of uninitialized value $address in sprintf at /usr/local/netdot/lib/Netdot/M
odel/Device.pm line 5645.
Use of uninitialized value $address in sprintf at /usr/local/netdot/lib/Netdot/M
odel/Device.pm line 5645.
Use of uninitialized value $address in sprintf at /usr/local/netdot/lib/Netdot/M
odel/Device.pm line 5645.

And the output is:
INFO - bin/updatedevices.pl started at Thu Jun 26 08:54:43 2014
INFO - Updating all devices in the DB
INFO - Using traditional method for SNMP collection
INFO - Device::snmp_update: device1: Finished updating
INFO - Device::snmp_update: device2: Finished updating
INFO - Device::snmp_update: device3: Finished updating
INFO - Device::snmp_update: device4: Finished updating
INFO - Device::snmp_update: device5: Finished updating
INFO - Device::snmp_update: device6: Finished updating
...
INFO - Device::snmp_update: device22: Finished updating
INFO - All Devices updated. 22 devices in 6 sec
INFO - bin/updatedevices.pl total runtime: 6 sec



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 5
Date: Thu, 26 Jun 2014 04:04:15 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1815] (New) cron entries
        running as      root
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1815 has been reported by Brian Candler.

----------------------------------------
Bug #1815: cron entries running as root
https://osl.uoregon.edu/redmine/issues/1815

Author: Brian Candler
Status: New
Priority: Low
Assignee: 
Category: 
Target version: 
Resolution: 


The sample crontab runs everything as root, including building of the topo 
graphs. So if you subsequently click the button in the web page to update it, 
you get the following error:

<pre>
Permission denied: open( 
/usr/local/netdot/htdocs/img/graphs/whole_network_with_vlans.png, 0x241 ) at 
/usr/share/perl5/GraphViz.pm line 1195
</pre>

This is easily fixed:

<pre>
# Update whole-network topology graphs
45 0 * * * www-data $PREFIX/bin/build_topo_graph.pl -f 
$PREFIX/htdocs/img/graphs/whole_network_no_vlans.png

50 0 * * * www-data $PREFIX/bin/build_topo_graph.pl -v -f 
$PREFIX/htdocs/img/graphs/whole_network_with_vlans.png
</pre>

But it does beg the question of whether *any* of these should be running as 
root.  Perhaps the sample crontab should have "apache" for all of the crontab 
entries (same as APACHEUSER defaults to), and users can then change them to 
www-data or whatever if their systems requires this?

Another suggestion: if the script is run as root it should setuid to this user, 
in case any data files are generated as a side-effect. pollstats.rrd is one I 
found.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 6
Date: Thu, 26 Jun 2014 04:50:52 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1816] (New) LLDP issues with
        Netgear switches
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1816 has been reported by Brian Candler.

----------------------------------------
Bug #1816: LLDP issues with Netgear switches
https://osl.uoregon.edu/redmine/issues/1816

Author: Brian Candler
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
Resolution: 


There are problems getting LLDP link relationships with Netgear switches.

Part of this is a problem with SNMP::Info. This is reported at
http://sourceforge.net/p/snmp-info/mailman/snmp-info-users/thread/53ABF242.30703%40pobox.com/#msg32507476
which includes detailed dumps of the SNMP MIBs.

But in summary it's down to the meaning of ifDescr, ifAlias and ifName as 
compared to LLDP "PortId" and "PortDesc".

The Netgear reports lldp{Rem,Loc}PortID as a string like "1/0/1" which matches 
ifName (not ifDescr or IfAlias), and the PortDesc is an optional user-entered 
comment (in my case sometimes I enter the name of the device this port is 
linked to). Example:

<pre>
iso.0.8802.1.1.2.1.3.7.1.3.45 = STRING: "1/0/45"   #lldpLocPortId
iso.0.8802.1.1.2.1.3.7.1.4.45 = STRING: "wrn-sw11" #lldpLocPortDesc

IF-MIB::ifDescr.45 = STRING: Unit: 1 Slot: 0 Port: 45 Gigabit - Level
IF-MIB::ifAlias.45 = STRING: wrn-sw11
IF-MIB::ifName.45 = STRING: 1/0/45
</pre>

This all seems pretty reasonable and standards-compliant behaviour. SNMP::Info 
was instead trying to map the lldpLocPortDesc (which is blank if the user 
hasn't entered any comment) against the ifDescr and ifAlias, and was giving 
arbitrary results. The mail pointed above includes patches to fix this.

However this still leaves some problems with Netdot.

<pre>
DEBUG - Topology::get_dp_links: Cannot find neighbor interface using 
20:4e:7f:7b:d5:e0
WARN - Topology::get_dp_links: wrn-sw11.int.example.net [Unit: 1 Slot: 0 Port: 
1 10G - Level]: Port 1/0/45 not found in Device: wrn-coresw1.int.example.net
</pre>

The general problem seems to be that dp_remote_port is "1/0/45" which needs to 
be matched against ifName on the other device, but as far as I can see, ifName 
is not actually stored in the interface table.

<pre>
*************************** 1. row ***************************
       admin_duplex: NULL
       admin_status: up
           auto_dns: 1
bpdu_filter_enabled: 0
 bpdu_guard_enabled: 0
            circuit: NULL
        contactlist: NULL
        description: NULL
             device: 5
               dlci: NULL
         doc_status: snmp
          down_from: NULL
         down_until: NULL
       dp_remote_id: 74:44:01:8d:56:e0
       dp_remote_ip: 192.168.0.10
     dp_remote_port: 1/0/1
     dp_remote_type: XSM7224S - 24-Port 10G SFP+ Layer 2 Stackable Managed 
Switch with four 10G combo ports
                 id: 2116
          ignore_ip: 0
               info: NULL
               jack: NULL
          jack_char: NULL
 loop_guard_enabled: 0
          monitored: 0
      monitorstatus: 3
               name: Unit: 1 Slot: 0 Port: 45 Gigabit - Level
           neighbor: 8
     neighbor_fixed: 0
    neighbor_missed: 0
             number: 45
        oper_duplex: NULL
        oper_status: up
    overwrite_descr: 0
           physaddr: 759128
          room_char: NULL
 root_guard_enabled: 0
       snmp_managed: 1
              speed: 1000000000
             stp_id: NULL
               type: ethernet-csmacd
</pre>

The "name" column appears to come from ifDescr currently.

I can think of two solutions.

(1) if ifName is non-empty, store it in the database instead of ifDescr. That 
is a change of behavior and might break other things. On a Cisco I have handy:

<pre>
IF-MIB::ifDescr.1 = STRING: GigabitEthernet0/0/0
IF-MIB::ifName.1 = STRING: Gi0/0/0
</pre>

(actually I'd prefer the shorter name to be used in the GUI anyway)

(2)  Add another column for ifName. This is arguably the Right Thing but is a 
schema change. Then it would require more changes in the searching code - 
whenever looking for an interface try ifName in addition to ifDescr. And it has 
to be decided whether ifDescr or ifName is displayed in the GUI (selectable 
globally? per device type?)




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

Message: 7
Date: Thu, 26 Jun 2014 05:56:35 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1816] LLDP issues with Netgear
        switches
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8


Issue #1816 has been updated by Brian Candler.


On the Cisco I have here, which is a 1901 running 15.2(4)M4: it uses the short 
name for LLDP PortId (matching ifName) and the long name for LLDP PortDesc 
(matching ifDescr).

<pre>
$ snmpwalk xxx-rtr1 iso.0.8802.1.1.2.1.3.7.1.3
iso.0.8802.1.1.2.1.3.7.1.3.1 = STRING: "Gi0/0/0"
iso.0.8802.1.1.2.1.3.7.1.3.2 = STRING: "Em0/0"
iso.0.8802.1.1.2.1.3.7.1.3.3 = STRING: "Gi0/0"
iso.0.8802.1.1.2.1.3.7.1.3.4 = STRING: "Gi0/1"
iso.0.8802.1.1.2.1.3.7.1.3.5 = STRING: "Gi0/3"

$ snmpwalk xxx-rtr1 iso.0.8802.1.1.2.1.3.7.1.4
iso.0.8802.1.1.2.1.3.7.1.4.1 = STRING: "GigabitEthernet0/0/0"
iso.0.8802.1.1.2.1.3.7.1.4.2 = STRING: "Embedded-Service-Engine0/0"
iso.0.8802.1.1.2.1.3.7.1.4.3 = STRING: "GigabitEthernet0/0"
iso.0.8802.1.1.2.1.3.7.1.4.4 = STRING: "GigabitEthernet0/1"
iso.0.8802.1.1.2.1.3.7.1.4.5 = STRING: "GigabitEthernet0/3"
</pre>

So it seems to me reasonable that the ifName should be considered the canonical 
name for the port. (But maybe this wasn't the case in older IOS).

One other data point: on an ASA5520 I see ifname like "GigabitEthernet0/1" but 
ifDescr like "Adaptive Security Appliance 'GigabitEthernet0/1' interface". 
However there is code in SNMP/Info/Layer3/CiscoASA.pm (sub i_description) which 
extracts just the part within the single quotes.

Now, digging round for how to implement option (1), I find Netdot already has 
an option IFNAME_SHORT which chooses between {orig_i_name} and {i_description} 
which come from SNMP::Info. And if I set IFNAME_SHORT=>1, not only is the GUI 
less cluttered, but link detection works!

<pre>
DEBUG - Topology::get_dp_links: Cannot find neighbor interface using 
20:4e:7f:7b:d5:e0
DEBUG - Topology::get_dp_links: Found link using remote port: 8 -> 2116
</pre>

So it's probably worth mentioning in the Default.conf comments that the 
IFNAME_SHORT selection does not just affect the display, it can also affect 
topology detection.

----------------------------------------
Bug #1816: LLDP issues with Netgear switches
https://osl.uoregon.edu/redmine/issues/1816#change-3188

Author: Brian Candler
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
Resolution: 


There are problems getting LLDP link relationships with Netgear switches.

Part of this is a problem with SNMP::Info. This is reported at
http://sourceforge.net/p/snmp-info/mailman/snmp-info-users/thread/53ABF242.30703%40pobox.com/#msg32507476
which includes detailed dumps of the SNMP MIBs.

But in summary it's down to the meaning of ifDescr, ifAlias and ifName as 
compared to LLDP "PortId" and "PortDesc".

The Netgear reports lldp{Rem,Loc}PortID as a string like "1/0/1" which matches 
ifName (not ifDescr or IfAlias), and the PortDesc is an optional user-entered 
comment (in my case sometimes I enter the name of the device this port is 
linked to). Example:

<pre>
iso.0.8802.1.1.2.1.3.7.1.3.45 = STRING: "1/0/45"   #lldpLocPortId
iso.0.8802.1.1.2.1.3.7.1.4.45 = STRING: "wrn-sw11" #lldpLocPortDesc

IF-MIB::ifDescr.45 = STRING: Unit: 1 Slot: 0 Port: 45 Gigabit - Level
IF-MIB::ifAlias.45 = STRING: wrn-sw11
IF-MIB::ifName.45 = STRING: 1/0/45
</pre>

This all seems pretty reasonable and standards-compliant behaviour. SNMP::Info 
was instead trying to map the lldpLocPortDesc (which is blank if the user 
hasn't entered any comment) against the ifDescr and ifAlias, and was giving 
arbitrary results. The mail pointed above includes patches to fix this.

However this still leaves some problems with Netdot.

<pre>
DEBUG - Topology::get_dp_links: Cannot find neighbor interface using 
20:4e:7f:7b:d5:e0
WARN - Topology::get_dp_links: wrn-sw11.int.example.net [Unit: 1 Slot: 0 Port: 
1 10G - Level]: Port 1/0/45 not found in Device: wrn-coresw1.int.example.net
</pre>

The general problem seems to be that dp_remote_port is "1/0/45" which needs to 
be matched against ifName on the other device, but as far as I can see, ifName 
is not actually stored in the interface table.

<pre>
*************************** 1. row ***************************
       admin_duplex: NULL
       admin_status: up
           auto_dns: 1
bpdu_filter_enabled: 0
 bpdu_guard_enabled: 0
            circuit: NULL
        contactlist: NULL
        description: NULL
             device: 5
               dlci: NULL
         doc_status: snmp
          down_from: NULL
         down_until: NULL
       dp_remote_id: 74:44:01:8d:56:e0
       dp_remote_ip: 192.168.0.10
     dp_remote_port: 1/0/1
     dp_remote_type: XSM7224S - 24-Port 10G SFP+ Layer 2 Stackable Managed 
Switch with four 10G combo ports
                 id: 2116
          ignore_ip: 0
               info: NULL
               jack: NULL
          jack_char: NULL
 loop_guard_enabled: 0
          monitored: 0
      monitorstatus: 3
               name: Unit: 1 Slot: 0 Port: 45 Gigabit - Level
           neighbor: 8
     neighbor_fixed: 0
    neighbor_missed: 0
             number: 45
        oper_duplex: NULL
        oper_status: up
    overwrite_descr: 0
           physaddr: 759128
          room_char: NULL
 root_guard_enabled: 0
       snmp_managed: 1
              speed: 1000000000
             stp_id: NULL
               type: ethernet-csmacd
</pre>

The "name" column appears to come from ifDescr currently.

I can think of two solutions.

(1) if ifName is non-empty, store it in the database instead of ifDescr. That 
is a change of behavior and might break other things. On a Cisco I have handy:

<pre>
IF-MIB::ifDescr.1 = STRING: GigabitEthernet0/0/0
IF-MIB::ifName.1 = STRING: Gi0/0/0
</pre>

(actually I'd prefer the shorter name to be used in the GUI anyway)

(2)  Add another column for ifName. This is arguably the Right Thing but is a 
schema change. Then it would require more changes in the searching code - 
whenever looking for an interface try ifName in addition to ifDescr. And it has 
to be decided whether ifDescr or ifName is displayed in the GUI (selectable 
globally? per device type?)




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://osl.uoregon.edu/redmine/my/account


------------------------------

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 87, Issue 7
*******************************************

Reply via email to