Page 1 of 1

CLI Script to enable SNMP link traps

Posted: 12 Dec 2017 10:03
by meilon
Hi,

we'd like to send a script to all our switches to enable SNMP link up/down traps (and some other commands). Because we have single and stacked switches, 24 and 48 ports, how should I issue the "trap x/y-z port link enable" command? If I send 1/1-50 on an 24 port switch, I get "ERROR: Slot/Port out of range <1027>".

Because we didn't mix 24 and 48 port switches in stacks, I could use cli.deviceType() so see how many ports a switch has. But how do I repeat this commands for stacked switches?

Kind regards,
meilon

Re: CLI Script to enable SNMP link traps

Posted: 15 Dec 2017 01:55
by silvio
you need some knowledge about javascript. For understanding there are some build-in scripts in omnivista. Maybe them will help you to understand.
regards
Silvio

Re: CLI Script to enable SNMP link traps

Posted: 15 Dec 2017 13:38
by meilon
Hi silvio,

the coding isn't the problem (I'm pretty good with JS actually), but how to find out the number of chassis in a stack. The documentation doesn't give me any details how to find that out. Because a stack of switches with for example 3 switches consumes 3 AOS licenses I thought I could use that, but can't find a variable which gives me this number. Is there no variable/function which can give me port details? Do I have to run a "show interface status" and work with the output?

Kind regards
meilon