Hi,

I'm trying to set some parameters of QoS Profile and I have some problems.
In fact, in my script, I want to change 6 parameters but only 3 don't give
segmentation fault.

Here is the script (with the segmentation fault parts commented) :

import netsnmp
>
> print("---------------------\n")
> print("Editing a QoS Profile\n")
> print("---------------------\n")
>
> profileNb = raw_input("Which QoS Profile to edit ?\n")
>
> value = "rbQoSProfileName"
> qosName = raw_input("Enter the new name :\n")
> oid = netsnmp.Varbind(value, profileNb, qosName)
> result = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> print("%s = %s") %(value,result)
>
> ## Here is a block that returns segfault
> ## ---------------------------------------------------
>
> qosType = raw_input("Enter the new type (0 = rbCG, 1 = rbRT, 2 = rbNRT, 3 =
> rbBE) :\n")
> value = "rbQoSProfileType"
> oid = netsnmp.Varbind(value, profileNb, qosType)
> result = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> print("%s = %s") %(value,result)
>
> ## ---------------------------------------------------
>
> qosCIR = raw_input("Enter the new CIR (1-12000 Kbps) :\n")
> value = "rbQoSProfileParam1"
> oid = netsnmp.Varbind(value, profileNb, qosCIR)
> result = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> print("%s = %s") %(value,result)
>
> qosMIR = raw_input("Enter the new MIR (1-12000 Kbps) :\n")
> value = "rbQoSProfileParam2"
> oid = netsnmp.Varbind(value, profileNb, qosMIR)
> result = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> print("%s = %s") %(value,result)
>
> ## Here is a block that returns segfault
> ## ---------------------------------------------------
>
> qosCT = raw_input("Enter the new CT (1 = short, 2 = medium, 3 = long) :\n")
> value = "rbQoSProfileParamTime"
> oid = netsnmp.Varbind(value, profileNb, qosCT)
> result = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> print("%s = %s") %(value,result)
>
> ## ---------------------------------------------------
>
> ## Here is a block that returns segfault
> ## ---------------------------------------------------
>
> qosRowStatus = raw_input("Enter the new status (1 = active, 4 =
> createAndGo, 6 = destroy) :\n")
> value = "rbAQoSProfileRowStatus"
> oid = netsnmp.Varbind(value, profileNb, qosRowStatus)
> result = netsnmp.snmpset(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> result = netsnmp.snmpget(oid, DestHost = "10.0.0.1", Community = "private",
> Version = 2)
> print("%s = %s") %(value,result)
>
> ## ---------------------------------------------------
>
> print("Done")


This is just a script to check if I can modify a QoS Profile with SNMP. I
can change this parameters with a based-SNMP GUI, so I know that it is
possible.

Thank you for helping.

François
------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to