Hello,
I'm interested in helping out adding support for the 3Com switch family 2900 also known as HP V1910. I've managed to find the SNMP OIDs it uses to store VLAN information and I've also discovered how it stores it (it may be very standard though, I've just never done this before) and I've also managed to get my hands on the MIB-files to cover it.
I've already ran into some problems trying to figure out how to write to the OIDs for VLANs though. There are multiple storing the same kind of data in different formats, but all of them gives me 'inconsistentValue' when I try writing to them in - as far as I can figure out - a 'proper' format.
I'm in your IRC channel on freenode asking around and they directed me here.
I appreciate any assistance I can get in the matter!
On Sep 6, 2011, at 9:22 AM, Mikael Knutsson wrote:
Hello,
Hello
We are a little slow to answer emails on this list since our main and senior developer for NAV is on paternal leave. In the meantime I will give it a try to help You out.
I'm interested in helping out adding support for the 3Com switch family 2900 also known as HP V1910. I've managed to find the SNMP OIDs it uses to store VLAN information and I've also discovered how it stores it (it may be very standard though, I've just never done this before) and I've also managed to get my hands on the MIB-files to cover it. I've already ran into some problems trying to figure out how to write to the OIDs for VLANs though. There are multiple storing the same kind of data in different formats, but all of them gives me 'inconsistentValue' when I try writing to them in - as far as I can figure out - a 'proper' format.
I'm in your IRC channel on freenode asking around and they directed me here.
I appreciate any assistance I can get in the matter!
Please, bear with me, - but I need some background-information: Are You thinking about the portadmin-tool,- and the setting of VLANs and aliases?
In that case, it should be relative simple to write an extension to the existing code if You are familiar with writing code and patterns in object-oriented languages and have the corresponding OIDs.
Sincerely
Trond.
Hello,
Yes, that is the primary thing. But also for identifying which VLAN is on which port and what VLANs are available on the status page for the switch. I'm not sure that is the PortAdmin module?
I am however as stated having some problems with writing to the VLAN OIDs as stated, I'm getting inconsistentValue returned no matter what I try, it feels like. I'm not sure what I'm doing wrong and if someone seasoned with SNMP could help me out with how to track down the error, that would be greatly appreciated!
// MVH Mikael K.
************************************ Webhallen Sverige AB Svetsarvägen 10B 171 41 Solna Tel: 08 - 673 60 00 Fax: 08 - 650 00 30 Sida: www.webhallen.com Mail: mikael@webhallen.com ************************************
On 09/08/2011 10:38 AM, trond kandal wrote:
On Sep 6, 2011, at 9:22 AM, Mikael Knutsson wrote:
Hello,
Hello
We are a little slow to answer emails on this list since our main and senior developer for NAV is on paternal leave. In the meantime I will give it a try to help You out.
I'm interested in helping out adding support for the 3Com switch family 2900 also known as HP V1910. I've managed to find the SNMP OIDs it uses to store VLAN information and I've also discovered how it stores it (it may be very standard though, I've just never done this before) and I've also managed to get my hands on the MIB-files to cover it. I've already ran into some problems trying to figure out how to write to the OIDs for VLANs though. There are multiple storing the same kind of data in different formats, but all of them gives me 'inconsistentValue' when I try writing to them in - as far as I can figure out - a 'proper' format.
I'm in your IRC channel on freenode asking around and they directed me here.
I appreciate any assistance I can get in the matter!
Please, bear with me, - but I need some background-information: Are You thinking about the portadmin-tool,- and the setting of VLANs and aliases?
In that case, it should be relative simple to write an extension to the existing code if You are familiar with writing code and patterns in object-oriented languages and have the corresponding OIDs.
Sincerely
Trond.
On Sep 8, 2011, at 11:08 AM, Mikael Knutsson wrote:
Hello,
Hello, again
Yes, that is the primary thing. But also for identifying which VLAN is on which port and what VLANs are available on the status page for the switch. I'm not sure that is the PortAdmin module?
No, that information is not coming from PortAdmin and I have not written that code and I am afraid I cannot help You much with that particular code. Sorry.
Still I would advice You to take a look at the snmp-code for PortAdmin. I think it will give You some ideas how You could do this.
You will find the code in: python/nav/portadmin/snmputils.py
I am however as stated having some problems with writing to the VLAN OIDs as stated, I'm getting inconsistentValue returned no matter what I try, it feels like. I'm not sure what I'm doing wrong and if someone seasoned with SNMP could help me out with how to track down the error, that would be greatly appreciated!
I am not quite sure if I understand,- but I guess You are talking about the confusion regarding what value-type to use when writing back to the equipment. Some take an unsigned integer and some don't. A VLAN is a positive integer and in most cases you would use an unsigned integer. If You take a look at the code, You will see that we in some cases try both.
If You also want to change VLAN on a port You must also remember to remove the port from the VLAN You are moving away from.
Is this of any help to You?
Sincerely
Trond.
Thanks. I took a look at the code and tried playing around a little with the OIDs that you are using for VLANs on standard boxes, I'm still getting inconsistentValue errors though, like this:
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.2.1.17.7.1.4.5.1.1.28 u 2 Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.2.1.17.7.1.4.5.1.1.28
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.2.1.17.7.1.4.5.1.1.28 i 2 Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.2.1.17.7.1.4.5.1.1.28
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.2.1.17.7.1.4.5.1.1.28 x "02" Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.2.1.17.7.1.4.5.1.1.28
I tried hex string just to see if I still got wrongType. The OIDs I've found on the switch are very.. obscure, it would seem. They look like this:
A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
And when I try setting them, I'm getting this:
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 x "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 x "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 x "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24: Value out of range (Bad string length :: {(0..256)})
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 i 0 A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24: Bad variable type (Type of attribute is OCTET STRING, not INTEGER)
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 u 0 A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24: Bad variable type (Type of attribute is OCTET STRING, not Unsigned32)
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 = 0 Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 u 0 Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 i 0 Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24
The second one is the one that is supposed to be 'correct' and I'm just trying to set the OID to the same as the value before. There are a couple of other private OIDs connected to VLANs, one that is per VLAN with a hex string that you set to which ports are allowed which is only six hex groups long.
Do you have any idea what I might be doing wrong?
// MVH Mikael K.
************************************ Webhallen Sverige AB Svetsarvägen 10B 171 41 Solna Tel: 08 - 673 60 00 Fax: 08 - 650 00 30 Sida: www.webhallen.com Mail: mikael@webhallen.com ************************************
On 09/08/2011 12:32 PM, trond kandal wrote:
On Sep 8, 2011, at 11:08 AM, Mikael Knutsson wrote:
Hello,
Hello, again
Yes, that is the primary thing. But also for identifying which VLAN is on which port and what VLANs are available on the status page for the switch. I'm not sure that is the PortAdmin module?
No, that information is not coming from PortAdmin and I have not written that code and I am afraid I cannot help You much with that particular code. Sorry.
Still I would advice You to take a look at the snmp-code for PortAdmin. I think it will give You some ideas how You could do this.
You will find the code in: python/nav/portadmin/snmputils.py
I am however as stated having some problems with writing to the VLAN OIDs as stated, I'm getting inconsistentValue returned no matter what I try, it feels like. I'm not sure what I'm doing wrong and if someone seasoned with SNMP could help me out with how to track down the error, that would be greatly appreciated!
I am not quite sure if I understand,- but I guess You are talking about the confusion regarding what value-type to use when writing back to the equipment. Some take an unsigned integer and some don't. A VLAN is a positive integer and in most cases you would use an unsigned integer. If You take a look at the code, You will see that we in some cases try both.
If You also want to change VLAN on a port You must also remember to remove the port from the VLAN You are moving away from.
Is this of any help to You?
Sincerely
Trond.
Hello again,
I found a MIB Companion guide for a 3Com 4500G switch that apparently covered the MIBs in question and it solved my problem! It told me that there were a few conditionals on writing to the OIDs I was trying to write to. For the big hex string, they come in a group of four: hwifHybridUnTaggedVlanListLow hwifHybridUnTaggedVlanListHigh hwifHybridTaggedVlanListLow hwifHybridTaggedVlanListHigh
And they all need to be set with the same snmpset command. That is only to change VLAN on hybrid (or trunk ports), there is another hex string per VLAN that is which ports that the VLAN is on, it only allows you to change it on untagged ports set to access mode.
So, to change a port from an access port to a trunk port, you need to modify multiple variables. First, you need to set the: A3COM-HUAWEI-LswINF-MIB::hwifVLANType.28 = hybrid (3) After which you need to know the IDs of all VLANs. Then you need to set the four big hex strings in one set with each bit corresponding to the VLAN in question. I've also figured out how to create and remove VLANs, which for once seemed rather straight forward.
How much of this functionality is possible to control with PortAdmin right now? :)
// MVH Mikael K.
************************************ Webhallen Sverige AB Svetsarvägen 10B 171 41 Solna Tel: 08 - 673 60 00 Fax: 08 - 650 00 30 Sida: www.webhallen.com Mail: mikael@webhallen.com ************************************
On 09/08/2011 06:01 PM, Mikael Knutsson wrote:
Thanks. I took a look at the code and tried playing around a little with the OIDs that you are using for VLANs on standard boxes, I'm still getting inconsistentValue errors though, like this:
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.2.1.17.7.1.4.5.1.1.28 u 2 Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.2.1.17.7.1.4.5.1.1.28 mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.2.1.17.7.1.4.5.1.1.28 i 2 Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.2.1.17.7.1.4.5.1.1.28 mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.2.1.17.7.1.4.5.1.1.28 x "02" Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.2.1.17.7.1.4.5.1.1.28
I tried hex string just to see if I still got wrongType. The OIDs I've found on the switch are very.. obscure, it would seem. They look like this:
A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
And when I try setting them, I'm getting this:
mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 x "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 x "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 x "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24: Value out of range (Bad string length :: {(0..256)}) mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 i 0 A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24: Bad variable type (Type of attribute is OCTET STRING, not INTEGER) mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 u 0 A3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24: Bad variable type (Type of attribute is OCTET STRING, not Unsigned32) mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitchA3COM-HUAWEI-LswINF-MIB::hwifHybridUnTaggedVlanListHigh.24 = 0 Error in packet. Reason: inconsistentValue (The set value is illegal or unsupported in some way) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 u 0 Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 mikael@mikn:/var/lib/mibs/ietf$ snmpset -On -v2c -cprivate testswitch1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24 i 0 Error in packet. Reason: wrongType (The set datatype does not match the data type the agent expects) Failed object: .1.3.6.1.4.1.43.45.1.2.23.1.1.3.1.5.24
The second one is the one that is supposed to be 'correct' and I'm just trying to set the OID to the same as the value before. There are a couple of other private OIDs connected to VLANs, one that is per VLAN with a hex string that you set to which ports are allowed which is only six hex groups long.
Do you have any idea what I might be doing wrong? // MVH Mikael K.
Webhallen Sverige AB Svetsarvägen 10B 171 41 Solna Tel: 08 - 673 60 00 Fax: 08 - 650 00 30 Sida:www.webhallen.com Mail:mikael@webhallen.com
On 09/08/2011 12:32 PM, trond kandal wrote:
On Sep 8, 2011, at 11:08 AM, Mikael Knutsson wrote:
Hello,
Hello, again
Yes, that is the primary thing. But also for identifying which VLAN is on which port and what VLANs are available on the status page for the switch. I'm not sure that is the PortAdmin module?
No, that information is not coming from PortAdmin and I have not written that code and I am afraid I cannot help You much with that particular code. Sorry.
Still I would advice You to take a look at the snmp-code for PortAdmin. I think it will give You some ideas how You could do this.
You will find the code in: python/nav/portadmin/snmputils.py
I am however as stated having some problems with writing to the VLAN OIDs as stated, I'm getting inconsistentValue returned no matter what I try, it feels like. I'm not sure what I'm doing wrong and if someone seasoned with SNMP could help me out with how to track down the error, that would be greatly appreciated!
I am not quite sure if I understand,- but I guess You are talking about the confusion regarding what value-type to use when writing back to the equipment. Some take an unsigned integer and some don't. A VLAN is a positive integer and in most cases you would use an unsigned integer. If You take a look at the code, You will see that we in some cases try both.
If You also want to change VLAN on a port You must also remember to remove the port from the VLAN You are moving away from.
Is this of any help to You?
Sincerely
Trond.
On Sep 9, 2011, at 8:21 AM, Mikael Knutsson wrote:
Hello again,
Hello again
I found a MIB Companion guide for a 3Com 4500G switch that apparently covered the MIBs in question and it solved my problem! It told me that there were a few conditionals on writing to the OIDs I was trying to write to. For the big hex string, they come in a group of four: hwifHybridUnTaggedVlanListLow hwifHybridUnTaggedVlanListHigh hwifHybridTaggedVlanListLow hwifHybridTaggedVlanListHigh
And they all need to be set with the same snmpset command. That is only to change VLAN on hybrid (or trunk ports), there is another hex string per VLAN that is which ports that the VLAN is on, it only allows you to change it on untagged ports set to access mode.
So, to change a port from an access port to a trunk port, you need to modify multiple variables. First, you need to set the: A3COM-HUAWEI-LswINF-MIB::hwifVLANType.28 = hybrid (3) After which you need to know the IDs of all VLANs. Then you need to set the four big hex strings in one set with each bit corresponding to the VLAN in question. I've also figured out how to create and remove VLANs, which for once seemed rather straight forward.
How much of this functionality is possible to control with PortAdmin right now? :)
As far as I know You are not allowed to change trunk ports and access ports into trunk ports in portadmin.
But, however, it is pretty straight forward to write a class in Python that is able to handle set/change VLANs for 3Com switches in PortAdmin if You know the OIDs and how to do what You want.
Have You looked at the code for PortAdmin?
Sincerely
Trond.