09-10-2022 07:08 PM
Hello,
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.
Netmart
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"
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
09-11-2022 12:02 PM - edited 09-11-2022 12:04 PM
Hi @Netmart
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.
Take care,
Sergiu
09-11-2022 02:09 PM - edited 09-11-2022 02:23 PM
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 RisingCPUthreshold
event syslog pattern "SYS-1-CPURISINGTHRESHOLD"
action 1.1 snmp-trap intdata1 1.3.6.1.4.1.9.10.134.1.2.3.1.2
action 1.2 snmp-trap strdata "CPU Rising Threshold"
event manager applet FallingCPUthreshold
event syslog pattern "SYS-1-CPUFALLINGTHRESHOLD"
action 1.1 snmp-trap intdata2 1.3.6.1.4.1.9.10.134.1.2.3.1.3
action 1.2 snmp-trap strdata "CPU Falling Threshold"
(config)#snmp-server enable traps ?
<CR>
aaa Enable aaa traps
bridge Enable bridge traps
callhome Enable callhome traps
cfs Enable cfs traps
config Enable config traps
entity Enable entity traps
feature-control Enable feature-control traps
generic Enable generic traps
license Enable license traps
link Enable link traps
rf Enable rf traps
rmon Enable rmon traps
snmp Enable snmp traps
storm-control Enable storm-control traps
stpx Enable stpx traps
sysmgr Enable sysmgr traps
system Enable system traps
upgrade Enable upgrade traps
vtp Enable vtp trap
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide