Reset Search



How to create an SNMP trap based on CPU utilization in EXOS?

« Go Back


TitleHow to create an SNMP trap based on CPU utilization in EXOS?
Create an SNMP trap if the CPU utilization goes over a predefined amount
  • EXOS based switch
  • EXOS 15.6 or higher
  • Switch must have at least an Edge license on it for Universal Port Manager
Create a script to check the CPU utilization. The script included below checks for a CPU utilization greater than 50%.

1. At the switch prompt type:
2. Go into Insert mode in vi by hitting the 'i' key.
3. Paste in the following script. On line 6, that value can be changed to a different value, based on monitoring requirements
import re
def main_func():
    cu = exsh.clicmd("show snmp get",capture=True)
    c ='extremeSwMonitor.1.2.0\s=\s(.*)',cu)
    cpu =
    if cpu > 50:  #change this value if you want to adjust the threshold
        exsh.clicmd("create snmp trap severity warning event highCPU \"cpu "+str (cpu)+"%\"")
4. Exit vi by hitting the Esc key, followed by ':wq'
5. Configure Universal Port Manager to run the script every 5 minutes:
create upm profile chkcpu
run script
create upm timer chkcpu_timer
configure upm timer chkcpu_timer profile chkcpu
configure upm timer chkcpu_timer after 10 every 300

To verify the script is running, use the command:
show upm timers

Additional notes



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255