Arnold error on port quarantine

Bug #666195 reported by Steinar Otto Sjøholt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
High
Morten Brekkevold

Bug Description

On NAV 3.6.0 trying to quarantine a port on a HP switch gives the following error:

URI: '/arnold/doquarantine'
Location: None
Directory: '/usr/share/nav/htdocs/arnold/'
Filename: '/usr/share/nav/htdocs/arnold/doquarantine'
PathInfo: ''

Phase: 'PythonHandler'
Handler: 'nav.web.arnoldhandler'

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/var/lib/python-support/python2.5/nav/web/arnoldhandler.py", line 328, in handler
    req.session['user']['login'], 'quarantine', vlan)

  File "/var/lib/python-support/python2.5/nav/arnold.py", line 445, in blockPort
    fromvlan = changePortVlan(sw['ip'], sw['ifindex'], vlan)

  File "/var/lib/python-support/python2.5/nav/arnold.py", line 815, in changePortVlan
    snmpset.set(query, type, vlan)

  File "/var/lib/python-support/python2.5/nav/Snmp/pysnmp_se.py", line 151, in set
    (value_class, self.version))

ValueError: Unsigned32 not supported in SNMP version 1

---

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

I'm unable to test this completely, since I have no write access to an HP switch, but the code confirms your problem.

Arnold never specifies which SNMP version to use when doing SNMP operations. Though parts of it seem to require v2c-only stuff, the default of the SNMP library is to use version 1 if nothing is specified. As confirmed outside the tracker, your problem is that the HP switch supports SNMP v2c, but Arnold still tries to use SNMP v1.

Arnold should be amended to actually use the SNMP version NAV has discovered that the switch supports.

Changed in nav:
assignee: nobody → Morten Brekkevold (mbrekkevold)
importance: Undecided → High
milestone: none → 3.6.4
status: New → Confirmed
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: Confirmed → Fix Committed
Revision history for this message
Jon Skarpeteig (jon-skarpeteig) wrote :

I am using version 3.7.0 and have problems with blocking util as well. I tried both using IP, and mac of the host (it resolves fine in machine tracker)

The switch in question is a Cisco Catalyst296048TT

MOD_PYTHON ERROR

ProcessId: 2340
Interpreter: 'nav.rd.tandberg.com'

ServerName: 'nav.rd.tandberg.com'
DocumentRoot: '/usr/share/nav/htdocs'

URI: '/arnold/domanualdetain'
Location: None
Directory: '/usr/share/nav/htdocs/arnold/'
Filename: '/usr/share/nav/htdocs/arnold/domanualdetain'
PathInfo: ''

Phase: 'PythonHandler'
Handler: 'nav.web.arnoldhandler'

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/var/lib/python-support/python2.5/nav/web/arnoldhandler.py", line 507, in handler
    req.write(page.respond())

  File "/var/lib/python-support/python2.5/nav/web/templates/MainTemplate.py", line 477, in respond
    _v = VFFSL(SL,"content",False)() # '$content()' on line 112, col 1

  File "/var/lib/python-support/python2.5/nav/web/templates/ArnoldTemplate.py", line 280, in content
    _v = VFFSL(SL,"printConfirmBlock",False)(VFFSL(SL,"candidates",True), VFFSL(SL,"arg",True), VFFSL(SL,"type",True)) # '$printConfirmBlock($candidates, $arg, $type)' on line 119, col 3

  File "/var/lib/python-support/python2.5/nav/web/templates/ArnoldTemplate.py", line 1248, in printConfirmBlock
    _v = VFFSL(SL,"arg",True)['reason'] # "$arg['reason']" on line 577, col 39

KeyError: 'reason'

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Jon, this is issue is unrelated to the SNMP problem described in this bug report - please file it as a separate bug.

Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.