[c-nsp] Help: attach a service-policy to an interface, without knowing which one is already attached

Michele Bergonzoni bergonz at labs.it
Tue Mar 11 07:30:43 EDT 2014


I am writing an automated configuration script, where I want to create a 
policy-map and attach it to an interface, in some ME 3400's.

The environment is such that I would like to determine the configuration 
commands to give, using SNMP only, i.e. without any "show" command and 
without access to the CLI. I know this is terrible, but that's the 
situation I'm into.

The problem is that to apply a service-policy I have to remove any 
existing service policy from that interface, and to do that I have to 
know its name. The 3400 does not support the CLASS-BASED-QOS-MIB so I 
don't know where to get this information.

So, if I do:

policy-map mymap
  class class-default
   (whatever)

Switch(config)#int gi0/1
Switch(config-if)#service-policy output mymap
Policy map hismap is already attached

At this point I know that "hismap" was attached, but it's too late. What 
I would like to do is:

Switch(config)#int gi0/1
Switch(config-if)#no service-policy output
% Incomplete command.

Or:

Switch(config-if)#default service-policy output
% Incomplete command.

I cannot use "default interface" because it cleans too much. I could 
delete the policy-map, and that would automatically detach it from all 
ports, but to do that I still have to know its name. I tried to search 
in a complete dump of the SNMP tree (from .1) but the name of the 
attached policy is not present.

So, if you read this far, and you know some smarter command that I'm 
missing, that would be of great help. Of course there are workarounds, 
but in this particular environment they are all very, very ugly.

Thanks in advance,
				Bergonz

-- 
Ing. Michele Bergonzoni - Laboratori Guglielmo Marconi S.p.a.
Phone:+39-051-6781926 e-mail: bergonz at labs.it
alt.advanced.networks.design.configure.operate


More information about the cisco-nsp mailing list