I would like to monitor the CPU load of NX-OS node and send an SNMP trap in case of CPU Threshold Rising and Falling
In order to trigger an event I assume we have to the syslog message/ID generated in case CPU Threshold Rising or Failing.
And then adding a desired action, such as send an SNMP Trap.
I began to write an EEM script, but got stuck. I would appreciate, if someone could please advise on:
syslog message/IDs for CPU threshold rising/falling
What snmp-trap ID has to be sent under action.
Thanks a lot.
event manager applet RisingCPU
event syslog pattern "SYS-1-CPURISINGTHRESHOLD"
action 1.1 snmp-trap xxxxxx "CPU RISING Threshold"
intdata1 Enter integer data 1 to be included in the payload
intdata2 Enter integer data 2 to be included in the payload
strdata Enter the string data to be included in the payload
event manager applet FallingCPU
event syslog pattern "SYS-1-CPUFALLINGTHRESHOLD"
action 1.1 snmp-trap xxxxxx "CPU FALLING Threshold"
I suppose you can simply use "strdata" to write your message in the SNMP trap as "CPU RAISING/FALLING" or whatever is more informative for you.
In the end, you can update 2 integer and one string data objects, basically these OIDs:
So it's up to you and the NMS you use to know which one works better for you.
Thank you Sergiu.
So it would look like the EM applets suggested below?And if so, we still have to enable the traps - which would be the appropriate one?
event manager applet RisingCPUthresholdevent syslog pattern "SYS-1-CPURISINGTHRESHOLD"action 1.1 snmp-trap intdata1 22.214.171.124.126.96.36.199.188.8.131.52.1.2action 1.2 snmp-trap strdata "CPU Rising Threshold"
event manager applet FallingCPUthresholdevent syslog pattern "SYS-1-CPUFALLINGTHRESHOLD"action 1.1 snmp-trap intdata2 184.108.40.206.220.127.116.11.18.104.22.168.1.3action 1.2 snmp-trap strdata "CPU Falling Threshold"
(config)#snmp-server enable traps ?<CR>aaa Enable aaa trapsbridge Enable bridge trapscallhome Enable callhome trapscfs Enable cfs trapsconfig Enable config trapsentity Enable entity trapsfeature-control Enable feature-control trapsgeneric Enable generic trapslicense Enable license trapslink Enable link trapsrf Enable rf trapsrmon Enable rmon trapssnmp Enable snmp trapsstorm-control Enable storm-control trapsstpx Enable stpx trapssysmgr Enable sysmgr trapssystem Enable system trapsupgrade Enable upgrade trapsvtp Enable vtp trap
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: