You've got a few steps to it. First is identifying the interfaces you want to change. Second is writing code to make the changes you want. Third is stitching those together.
IMC Configuration Templates support checking the output of a command, and using that as success/fail criteria. Unfortunately it doesn't support quite the level of branching you'd need in order to implement this all as one step.
You could use an IMC Compliance Policy to check the output of Display Commands, and use the "Check & Get" function. That could run the equivalent of "show int br | include 1000[SL]X". That would give you a list of switches & interfaces, although it might not be super-simple to export as a table.
You can write an IMC Configuration Template to run the equivalent of:
interface range X/Y - X/Z
no snmp trap link-status
The beginning & end of the range could be passed in as parameters. Then when you run that template, you could just give it the start & end interface. I'm guessing that there are some commonalities on your switches. So you might only need to do a couple of runs of that with a couple of different ranges set, and you'd cover most of your switches. You could then manually clean up the remainders. You'd use the Compliance Policy output to provide the lists of switches to use for each run.
It's a bit manual, but at least it's a little bit nicer than doing everything manually. Should cover the 80% case.
There are two alternatives I can think of:
- Do you have a consistent description on those uplink ports? Let's say all uplink ports have a consistent description of "UPLINK to switch ZZZZ X/Y."
If you have a standard like that, you could write a Compliance Policy that looks at interface configurations. It would look for something like "description UPLINK .*" AND NOT "no snmp trap link-status".
You could then give it a remediation action to run "snmp trap link-status". This may actually be the simplest way if you have some sort of policy around descriptions. - Write your own expect scripts that take a list of switches, and for each switch, runs the equivalent of "foreach interface in `show int br | include 1000[SL]X';do int $interface; no snmp trap link-status;done"
If you had API access, there's a couple more programmatic ways of doing it, including even using the API to fix up your interface descriptions if they're not set right.