Discussion:
Rename interfaces?
Joachim Tingvold
2011-03-16 02:58:25 UTC
Permalink
Hi,

Is there a way to rename the 'interface'-fields on a switch?

We have some (really) old switches (Netgear FSM726) that has really
long interface-names; "FSM726 Management Switch 10/100 Mbps Ethernet
Network Interface 1", which kinda breaks the "Switch port status"- and
"Switch port activity"-tabs on the "IP Device Info"-page of the
devices in question.

Could I change this in the DB in some way? Or will it just be
overwritten next time navcron runs?
--
Joachim
Morten Brekkevold
2011-03-16 08:42:30 UTC
Permalink
Post by Joachim Tingvold
Is there a way to rename the 'interface'-fields on a switch?
Not in NAV, no.
Post by Joachim Tingvold
We have some (really) old switches (Netgear FSM726) that has really long
interface-names; "FSM726 Management Switch 10/100 Mbps Ethernet Network
Interface 1", which kinda breaks the "Switch port status"- and "Switch port
activity"-tabs on the "IP Device Info"-page of the devices in question.
Could I change this in the DB in some way? Or will it just be overwritten next
time navcron runs?
We had similar issues with Cisco devices before NAV 3.6. For Cisco
devices we used their ifDescr value as interface names; a typical value
would be "GigabitEthernet3/2", which is way too long for the port matrix
in ipdevinfo (today we use the ifName value always, which in the Cisco
case would be "Gi3/2").

Before NAV 3.6, ipdevinfo had some shortening logic especially for Cisco
interfaces names, which knew how to shorten "GigabitEthernet3/2" into
"Gi3/2".

I might imagine some sort of generic algorithm for shortening interface
names if they happen to exceed some maximum length. Something that
might work in this case is to pick the rightmost word containing any
digits. Wouldn't work nicely for GigabitEthernet3/2, though.

Any idea what the ifDescr values look like on this device (snmpwalk
ifDescr)?
--
Morten Brekkevold
UNINETT
Joachim Tingvold
2011-03-16 12:58:09 UTC
Permalink
Post by Morten Brekkevold
We had similar issues with Cisco devices before NAV 3.6. For Cisco
devices we used their ifDescr value as interface names; a typical value
would be "GigabitEthernet3/2", which is way too long for the port matrix
in ipdevinfo (today we use the ifName value always, which in the Cisco
case would be "Gi3/2").
Before NAV 3.6, ipdevinfo had some shortening logic especially for Cisco
interfaces names, which knew how to shorten "GigabitEthernet3/2" into
"Gi3/2".
I might imagine some sort of generic algorithm for shortening
interface
names if they happen to exceed some maximum length. Something that
might work in this case is to pick the rightmost word containing any
digits. Wouldn't work nicely for GigabitEthernet3/2, though.
Any idea what the ifDescr values look like on this device (snmpwalk
ifDescr)?
It doesn't have ifName at all, so I guess NAV falls back to use ifDescr?

***@nav:~# snmpwalk -v 2c -c public sw-mgmt-cr2-x02 ifDescr
IF-MIB::ifDescr.1 = STRING: FSM726 Management Switch 10/100 Mbps
Ethernet Network Interface 1
[...]
IF-MIB::ifDescr.24 = STRING: FSM726 Management Switch 10/100 Mbps
Ethernet Network Interface 24
IF-MIB::ifDescr.25 = STRING: FSM726 Management Switch 1000 Mbps
Ethernet Network Interface 25
IF-MIB::ifDescr.26 = STRING: FSM726 Management Switch 1000 Mbps
Ethernet Network Interface 26
IF-MIB::ifDescr.27 = STRING: FSM726 Management Switch CPU Ethernet
Network Interface

It would be hard to filter this out on a general basis, I guess,
unless one use the ifIndex in conjunction with ifDescr.
--
Joachim
Morten Brekkevold
2011-03-17 14:57:44 UTC
Permalink
Post by Joachim Tingvold
Post by Morten Brekkevold
Any idea what the ifDescr values look like on this device (snmpwalk
ifDescr)?
It doesn't have ifName at all, so I guess NAV falls back to use ifDescr?
Correct. If the device doesn't reply to ifName requests, NAV substitutes
the ifDescr value as an ifName value.
Post by Joachim Tingvold
IF-MIB::ifDescr.1 = STRING: FSM726 Management Switch 10/100 Mbps Ethernet
Network Interface 1
[...]
IF-MIB::ifDescr.24 = STRING: FSM726 Management Switch 10/100 Mbps Ethernet
Network Interface 24
IF-MIB::ifDescr.25 = STRING: FSM726 Management Switch 1000 Mbps Ethernet
Network Interface 25
IF-MIB::ifDescr.26 = STRING: FSM726 Management Switch 1000 Mbps Ethernet
Network Interface 26
IF-MIB::ifDescr.27 = STRING: FSM726 Management Switch CPU Ethernet Network
Interface
It would be hard to filter this out on a general basis, I guess, unless one
use the ifIndex in conjunction with ifDescr.
We could go about this another way as well. If you look at each
individual switch port, NAV has assigned a port number to it, based on
the port number found in BRIDGE-MIB (this number is unique across the IP
device, even when it has multiple modules).

If a device doesn't reply to ifName, but a bridge port number was found,
it could substitute the port number for the ifName value - only falling
back to ifDescr if it's not a switch port. What do you think?

Are the port numbers NAV has found for your switch reasonable?
--
Morten Brekkevold
UNINETT
Joachim Tingvold
2011-03-18 12:58:36 UTC
Permalink
Post by Morten Brekkevold
We could go about this another way as well. If you look at each
individual switch port, NAV has assigned a port number to it, based on
the port number found in BRIDGE-MIB (this number is unique across the IP
device, even when it has multiple modules).
You are referring to dot1dBasePort, yes?
Post by Morten Brekkevold
If a device doesn't reply to ifName, but a bridge port number was found,
it could substitute the port number for the ifName value - only falling
back to ifDescr if it's not a switch port. What do you think?
Yes, that sounds good. If this happens, maybe one should also keep the
ifDescr in the «IP Device Info»-section?
Post by Morten Brekkevold
Are the port numbers NAV has found for your switch reasonable?
If you're referring to «Port» in the «IP Device Info»-section, then
yes, it's reasonable (it's an integer, going from 1 through 26).
--
Joachim
mels
2011-03-19 10:05:39 UTC
Permalink
Hello all,

I installed the latests nav version (nav-3.8.2) from source on OpenSuse
11.4 64 bit and used the INSTALL..rst for installation

After nav start only snmptrapd doesn't start and find no errors in the log.
nlnedmon0003:/srv/local/nav # bin/nav start
Starting: alertengine cricket eventengine ipdevpoll logengine mactrace
maintengine networkDiscovery pping servicemon smsd thresholdMon
Failed: snmptrapd

If I execute bin/snmptrapd.py this message is displayed:
nlnedmon0003:/srv/local/nav # bin/snmptrapd.py
Traceback (most recent call last):
File "bin/snmptrapd.py", line 33, in <module>
from nav.snmptrapd import agent
File "/srv/local/nav/lib/python/nav/snmptrapd/agent.py", line 17, in
<module>
from nav.Snmp import backend
File "/srv/local/nav/lib/python/nav/Snmp/__init__.py", line 35, in
<module>
version.verifyVersionRequirement(3, 4, 3)
AttributeError: 'tuple' object has no attribute 'verifyVersionRequirement'

For pysnmp I installed version pysnmp-4.1.16a

The nav buildconf.py:
"""NAV build configuration variables."""
prefix = "/srv/local/nav"
exec_prefix = "/srv/local/nav"
bindir = "/srv/local/nav/bin"
libdir = "/srv/local/nav/lib"
pythonlibdir = "/srv/local/nav/lib/python"
pythondir = "/srv/local/nav/lib/python"
sysconfdir = "/srv/local/nav/etc"
localstatedir = "/srv/local/nav/var"
webroot = "/srv/local/nav/share/htdocs"
webrootdir = "/srv/local/nav/share/htdocs"
initdir = "/srv/local/nav/etc/init.d"
crondir = "/srv/local/nav/etc/cron.d"
djangotmpldir = "/srv/local/nav/lib/templates"
VERSION = "3.8.2"

Mels
mels
2011-03-19 19:43:54 UTC
Permalink
Post by mels
Hello all,
I installed the latests nav version (nav-3.8.2) from source on OpenSuse
11.4 64 bit and used the INSTALL..rst for installation
After nav start only snmptrapd doesn't start and find no errors in the log.
nlnedmon0003:/srv/local/nav # bin/nav start
Starting: alertengine cricket eventengine ipdevpoll logengine mactrace
maintengine networkDiscovery pping servicemon smsd thresholdMon
Failed: snmptrapd
nlnedmon0003:/srv/local/nav # bin/snmptrapd.py
File "bin/snmptrapd.py", line 33, in <module>
from nav.snmptrapd import agent
File "/srv/local/nav/lib/python/nav/snmptrapd/agent.py", line 17, in
<module>
from nav.Snmp import backend
File "/srv/local/nav/lib/python/nav/Snmp/__init__.py", line 35, in
<module>
version.verifyVersionRequirement(3, 4, 3)
AttributeError: 'tuple' object has no attribute 'verifyVersionRequirement'
For pysnmp I installed version pysnmp-4.1.16a
"""NAV build configuration variables."""
prefix = "/srv/local/nav"
exec_prefix = "/srv/local/nav"
bindir = "/srv/local/nav/bin"
libdir = "/srv/local/nav/lib"
pythonlibdir = "/srv/local/nav/lib/python"
pythondir = "/srv/local/nav/lib/python"
sysconfdir = "/srv/local/nav/etc"
localstatedir = "/srv/local/nav/var"
webroot = "/srv/local/nav/share/htdocs"
webrootdir = "/srv/local/nav/share/htdocs"
initdir = "/srv/local/nav/etc/init.d"
crondir = "/srv/local/nav/etc/cron.d"
djangotmpldir = "/srv/local/nav/lib/templates"
VERSION = "3.8.2"
Mels
After I set in nav.conf DJANGO_DEBUG=True, I get this message in the
mail when I try login.

Traceback (most recent call last):

File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py",
line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/srv/local/nav/lib/python/nav/web/webfront/views.py", line 86,
in login
return do_login(request)

File "/srv/local/nav/lib/python/nav/web/webfront/views.py", line 122,
in do_login
origin = reverse('webfront-index')

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 351, in reverse
*args, **kwargs)))

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 272, in reverse
possibilities = self.reverse_dict.getlist(lookup_view)

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 194, in _get_reverse_dict
self._populate()

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 173, in _populate
for name in pattern.reverse_dict:

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 194, in _get_reverse_dict
self._populate()

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 162, in _populate
for pattern in reversed(self.url_patterns):

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 244, in _get_url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)

File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py",
line 239, in _get_urlconf_module
self._urlconf_module = import_module(self.urlconf_name)

File "/usr/lib/python2.7/site-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)

File "/srv/local/nav/lib/python/nav/web/seeddb/urls.py", line 20, in
<module>
from nav.web.seeddb.views import netbox, service, room, location,
organization

File "/srv/local/nav/lib/python/nav/web/seeddb/views/__init__.py",
line 21, in <module>
from nav.web.seeddb.views.list import netbox_list, service_list,
room_list

File "/srv/local/nav/lib/python/nav/web/seeddb/views/list.py", line
24, in <module>
from nav.web.seeddb.forms import NetboxFilterForm, RoomFilterForm

File "/srv/local/nav/lib/python/nav/web/seeddb/forms/__init__.py",
line 18, in <module>
from nav.web.seeddb.forms.edit import *

File "/srv/local/nav/lib/python/nav/web/seeddb/forms/edit.py", line
27, in <module>
from nav.Snmp import Snmp, TimeOutException, SnmpError

File "/srv/local/nav/lib/python/nav/Snmp/__init__.py", line 35, in
<module>
version.verifyVersionRequirement(3, 4, 3)

AttributeError: 'tuple' object has no attribute 'verifyVersionRequirement'

<ModPythonRequest
path:/index/login/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'origin': [u''], u'username': [u'admin'],
u'password': [u'admin']}>,
COOKIES:{'nav_sessid': 'd093027f55116d809fa88e501eb4c0c6'},
META:{'AUTH_TYPE': None,
'CONTENT_LENGTH': '37',
'CONTENT_TYPE': 'application/x-www-form-urlencoded',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT':
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
'HTTP_ACCEPT_LANGUAGE': 'nl,en-us;q=0.7,en;q=0.3',
'HTTP_AUTHORIZATION': 'Basic YWRtaW46',
'HTTP_CONNECTION': 'keep-alive',
'HTTP_CONTENT_LENGTH': '37',
'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded',
'HTTP_COOKIE': 'nav_sessid=d093027f55116d809fa88e501eb4c0c6',
'HTTP_HOST': 'nav',
'HTTP_KEEP_ALIVE': '115',
'HTTP_REFERER': 'http://10.31.1.121/index/login/',
'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US;
rv:1.9.2.13) Gecko/20101203 SUSE/3.6.13-0.2.1 Firefox/3.6.13',
'PATH_INFO': u'/index/login/',
'PATH_TRANSLATED': None,
'QUERY_STRING': None,
'REMOTE_ADDR': '10.31.106.79',
'REMOTE_HOST': None,
'REMOTE_IDENT': None,
'REMOTE_USER': None,
'REQUEST_METHOD': 'POST',
'SCRIPT_NAME': '',
'SERVER_NAME': 'nav.test.local',
'SERVER_PORT': 80,
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SOFTWARE': 'mod_python'}>
Morten Brekkevold
2011-03-21 20:55:41 UTC
Permalink
Post by mels
Hello all,
I installed the latests nav version (nav-3.8.2) from source on OpenSuse
11.4 64 bit and used the INSTALL..rst for installation
[snip]
Post by mels
version.verifyVersionRequirement(3, 4, 3)
AttributeError: 'tuple' object has no attribute 'verifyVersionRequirement'
For pysnmp I installed version pysnmp-4.1.16a
I see, but INSTALL.rst specifies that NAV needs PySNMP-SE, not PySNMP 4.

If you need to install PySNMP-SE from source, it can be found here:
http://sourceforge.net/projects/twistedsnmp/files/pysnmp-se/3.5.2/
--
mvh
Morten Brekkevold
UNINETT
Morten Brekkevold
2011-03-21 20:50:55 UTC
Permalink
Post by Joachim Tingvold
Post by Morten Brekkevold
individual switch port, NAV has assigned a port number to it, based on
the port number found in BRIDGE-MIB (this number is unique across the IP
device, even when it has multiple modules).
You are referring to dot1dBasePort, yes?
Correct.
Post by Joachim Tingvold
Post by Morten Brekkevold
If a device doesn't reply to ifName, but a bridge port number was found,
it could substitute the port number for the ifName value - only falling
back to ifDescr if it's not a switch port. What do you think?
Yes, that sounds good. If this happens, maybe one should also keep the ifDescr
in the «IP Device Info»-section?
As long as an ifDescr value was found for an interface, it is stored in
the db. We're only discussing alternate ways to derive an ifName value
if none is found on the device.
Post by Joachim Tingvold
Post by Morten Brekkevold
Are the port numbers NAV has found for your switch reasonable?
If you're referring to «Port» in the «IP Device Info»-section, then yes, it's
reasonable (it's an integer, going from 1 through 26).
I've posted this as a wishlist item here:
https://bugs.launchpad.net/nav/+bug/739718
--
mvh
Morten Brekkevold
UNINETT
Continue reading on narkive:
Loading...