cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
184
Views
0
Helpful
2
Replies

Cisco NX-OS EEM for CPU Threshold SNMP trap

Netmart
Beginner
Beginner

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

 

 

2 Replies 2

Sergiu.Daniluk
VIP Advisor VIP Advisor
VIP Advisor

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:

Screenshot 2022-09-11 220236.png

Reference: https://snmp.cloudapps.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1.4.1.9.10.134.1.2.3.1

So it's up to you and the NMS you use to know which one works better for you.

Take care,

Sergiu

Netmart
Beginner
Beginner


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

Getting Started

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:

Recognize Your Peers