<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Modify port Vlan ID with PySnmp in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18532#M818</link>
    <description>Hi, Oscar. Hope you are doing well, thanks for the reply. I was finally able to set  the vlan Id via pySNMP with a different piece of code.&lt;BR /&gt;
from pysnmp.entity.rfc3413.oneliner import cmdgen&lt;BR /&gt;
from pysnmp.proto import rfc1902&lt;BR /&gt;
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().setCmd(&lt;BR /&gt;
    cmdgen.CommunityData('my-agent', My_Community, 1),&lt;BR /&gt;
    cmdgen.UdpTransportTarget(('192.168.20.10', 161)),&lt;BR /&gt;
    ((1,3,6,1,2,1,17,7,1,4,5,1,1,1), rfc1902.Gauge32('201'))&lt;BR /&gt;
    )&lt;BR /&gt;
print errorIndication&lt;BR /&gt;
print errorStatus   output form the switch:&lt;BR /&gt;
&lt;BR /&gt;
* (pacman) EXOS-VM.36 # sh port 1 vid&lt;BR /&gt;
         Untagged&lt;BR /&gt;
Port     /Tagged   VID(s)&lt;BR /&gt;
-------- --------  ------------------------------------------------------------&lt;BR /&gt;
1        Untagged  201&lt;BR /&gt;
&lt;BR /&gt;
Thanks for trying to help.&lt;BR /&gt;</description>
    <pubDate>Thu, 06 Jul 2017 02:31:00 GMT</pubDate>
    <dc:creator>GONÇALO_NUNO_CO</dc:creator>
    <dc:date>2017-07-06T02:31:00Z</dc:date>
    <item>
      <title>Modify port Vlan ID with PySnmp</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18530#M816</link>
      <description>Hi, im trying to modify the vlan id of port 24 on slot 2 (2:24) which as the ifindex of 152  according to snmpGet. I have been reading the documentation of PySnmp and from my point of view it is a bit vague, probably because i dont have yet a deep knowledge of programming and also on how SNMP is structured.&lt;BR /&gt;
&lt;BR /&gt;
Using the script provided from pysnmp documentation im unable to configure port 2:24 vlan ID. Im getting the following error:&lt;BR /&gt;
&lt;BR /&gt;
pysnmp.smi.error.SmiError: No symbol SNMPv2-SMI::mib-2.17.7.1.4.5.1.1 at my code:&lt;BR /&gt;
&lt;BR /&gt;
from pysnmp.hlapi import *&lt;BR /&gt;
g = setCmd(SnmpEngine(),&lt;BR /&gt;
            CommunityData(MyComm),&lt;BR /&gt;
            UdpTransportTarget(MyIP, 161)),&lt;BR /&gt;
            ContextData(),&lt;BR /&gt;
            ObjectType(ObjectIdentity('SNMPv2-SMI', 'mib-2.17.7.1.4.5.1.1', 152), '201'))&lt;BR /&gt;
next(g)&lt;BR /&gt;
Can someone help me?</description>
      <pubDate>Mon, 03 Jul 2017 12:32:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18530#M816</guid>
      <dc:creator>GONÇALO_NUNO_CO</dc:creator>
      <dc:date>2017-07-03T12:32:00Z</dc:date>
    </item>
    <item>
      <title>RE: Modify port Vlan ID with PySnmp</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18531#M817</link>
      <description>It seems pysnmp cannot find the mib, try using the oid. Below an example with a get.&lt;BR /&gt;
&lt;BR /&gt;
def SNMPGet(oid,host,community):&lt;BR /&gt;
    errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(&lt;BR /&gt;
        cmdgen.CommunityData(community),&lt;BR /&gt;
        cmdgen.UdpTransportTarget((host, 161)),&lt;BR /&gt;
        cmdgen.MibVariable(oid)&lt;BR /&gt;
    )&lt;BR /&gt;
&lt;BR /&gt;
    # Check for errors and print out results&lt;BR /&gt;
    if errorIndication:&lt;BR /&gt;
        print(errorIndication)&lt;BR /&gt;
    else:&lt;BR /&gt;
        if errorStatus:&lt;BR /&gt;
            print('%s at %s' % (&lt;BR /&gt;
                errorStatus.prettyPrint(),&lt;BR /&gt;
                errorIndex and varBinds[int(errorIndex)-1] or '?'&lt;BR /&gt;
            )&lt;BR /&gt;
        )&lt;BR /&gt;
        else:&lt;BR /&gt;
            for name, val in varBinds:&lt;BR /&gt;
                return val.prettyPrint()&lt;BR /&gt;
&lt;BR /&gt;
portInOctets=SNMPGet('1.3.6.1.2.1.31.1.1.1.6.1001',iphost,args.community)&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Jul 2017 11:23:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18531#M817</guid>
      <dc:creator>OscarK</dc:creator>
      <dc:date>2017-07-04T11:23:00Z</dc:date>
    </item>
    <item>
      <title>RE: Modify port Vlan ID with PySnmp</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18532#M818</link>
      <description>Hi, Oscar. Hope you are doing well, thanks for the reply. I was finally able to set  the vlan Id via pySNMP with a different piece of code.&lt;BR /&gt;
from pysnmp.entity.rfc3413.oneliner import cmdgen&lt;BR /&gt;
from pysnmp.proto import rfc1902&lt;BR /&gt;
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().setCmd(&lt;BR /&gt;
    cmdgen.CommunityData('my-agent', My_Community, 1),&lt;BR /&gt;
    cmdgen.UdpTransportTarget(('192.168.20.10', 161)),&lt;BR /&gt;
    ((1,3,6,1,2,1,17,7,1,4,5,1,1,1), rfc1902.Gauge32('201'))&lt;BR /&gt;
    )&lt;BR /&gt;
print errorIndication&lt;BR /&gt;
print errorStatus   output form the switch:&lt;BR /&gt;
&lt;BR /&gt;
* (pacman) EXOS-VM.36 # sh port 1 vid&lt;BR /&gt;
         Untagged&lt;BR /&gt;
Port     /Tagged   VID(s)&lt;BR /&gt;
-------- --------  ------------------------------------------------------------&lt;BR /&gt;
1        Untagged  201&lt;BR /&gt;
&lt;BR /&gt;
Thanks for trying to help.&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Jul 2017 02:31:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18532#M818</guid>
      <dc:creator>GONÇALO_NUNO_CO</dc:creator>
      <dc:date>2017-07-06T02:31:00Z</dc:date>
    </item>
    <item>
      <title>RE: Modify port Vlan ID with PySnmp</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18533#M819</link>
      <description>Glad to help.</description>
      <pubDate>Thu, 06 Jul 2017 11:31:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/modify-port-vlan-id-with-pysnmp/m-p/18533#M819</guid>
      <dc:creator>OscarK</dc:creator>
      <dc:date>2017-07-06T11:31:00Z</dc:date>
    </item>
  </channel>
</rss>

