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

Garrett Skjelstad garrett at skjelstad.org
Tue Mar 11 09:03:51 EDT 2014


Why not frequently pull the config using the config-copy-MiB, link and store the interface & service-policy in a DB (or I guess CSV) and use that? I suppose you could also just in time pull the config, but for every transaction that would suck.

You do need TFTP access for this...

Sent from my (old) iPhone5

> On Mar 11, 2014, at 4:30, Michele Bergonzoni <bergonz at labs.it> wrote:
> 
> 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
> _______________________________________________
> cisco-nsp mailing list  cisco-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/



More information about the cisco-nsp mailing list