cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2626
Views
0
Helpful
3
Replies

If condition in EEM Script

Cisco Freak
Level 4
Level 4

Hi All,

I am wondering how to write an if condition in an EEM script. This is my requirement:

If txload > 15
    Send an email "HIGH TX LOAD"
If rxload > 15
    Send an email "HIGH RX LOAD"

Any help would be appreciated!

CF

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

Some thing like this, for example:

action 010 if $txload gt 15

 action 011 mail from ...

action 012 end

action 013 if $rxload gt 15

 action 014 mail from ...

action 015 end

Hi Joe,

I got one more question.

I assume that $txload is a variable. How do I send the value of interface txload to the variable txload.

CF

I don't know enough about your intended EEM use case.  If you're using an interface event, then there is a built-in variable.  If you're doing something else, you could parse the output of "show interface" and get the txload and rxload values from there using the regexp action.