cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5224
Views
26
Helpful
20
Replies

Event manager $_cli_pattern ignored

Ditter
Level 8
Level 8

Hi to all,

 

i would like to send the output of a single command to an email address so i have created a simple script you can see below.


The email is successfully sent to the recipient with the correct subject but the body is empty without the output of the show interface status command which i need to send by email.


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

event manager applet show-int-status
description show-int-status
event none sync yes
action 0.5 cli command "enable"
action 1.0 cli command "show int status"
action 1.5 mail server "mta.xyz.com" to "support@xyz.com" from "rtr@xyz.com" subject "show int status output" body "show int status $_cli_pattern"


I also noticed that although i did put the $_cli_pattern is in the email command when i created it , when i enter a

"show event manager policy registered" i do not see the $_cli_pattern variable in this specific line as if i did not put it in the command in the first place.

 

That is :


action 1.5 mail server "mta.xyz.com" to "support@xyz.com" from "rtr@xyz.com" subject "show int status output" body "show int status" and there is not present the rest of the input that is the "WITHOUT THE $_CLI_PATTERN" part.


Any ideas, why the email is sent without the body and why the $_cli_pattern has disappeared from the command?


Thanks,

 

Ditter.

20 Replies 20

Ditter
Level 8
Level 8

Hi to all,

 

i made some progress that i would like to share with you and ask for your opinion in case you met this before.

 

Two exactly the same Cat 6500 with SUP720 , with the exact software image, one is ignoring the $_cli_result variable, the second one runs the eem script with the $_cli_result variable just fine.

 

Any ideas of why this happens?

 

Thanks

Ditter.

Can you post-show version of both one, working and not working ( I am sure there may be a small IOS difference)

 

BB

=====️ Preenayamo Vasudevam ️=====

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Ditter
Level 8
Level 8

Please look at the attached png.

Both are the same IOS - thank you for the clarification, now the question comes to looking full configuration of both - is there any small information we missing here? (a high level we do not see any reason this was not worked, since i have same 15.X code it works as expected)

 

until some other information overriding the same variable - we need to look full config. (if possible  remove all sensitive information and share the config of both - or compare yourself in notepad++ - to get an idea) - why this was not working.

 

BB

=====️ Preenayamo Vasudevam ️=====

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hi,

 

i found the culprit!

 

In the past i had activated shell processing in the one of the two 6500. So it parsed the $ sign whenever i was trying to enter the $_cli_result parameter in order to interpret it as part of a script !

 

I removed shell processing and now everything works as expected.

 

Many thanks balaji.bandi for his help and advice (as well as Georg Pauwen).

 

Ditter.

balaji.bandi
Hall of Fame
Hall of Fame

Glad you were able to find the culprit and fix the issue.

BB

=====️ Preenayamo Vasudevam ️=====

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help