cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2618
Views
0
Helpful
23
Replies

EEM Script Modification Help

Hello Community,

David Lin, was the author of the Wan Load Alarm script.

When the alert appears it will appear as follows:

*Mar  1 00:46:31.027: %HA_EM-6-LOG: system:/lib/tcl/eem_scripts_registered/wan_load_alarm.tcl: Interface FastEthernet0/0 average load exceeded 4 percent over 1 seconds.

Is it possible to modify the script so that the text Interface FastEthernet0/0 average load exceeded 4 percent over 1 seconds., appears on separate line?

I need to strip out *Mar  1 00:46:31.027: %HA_EM-6-LOG: system:/lib/tcl/eem_scripts_registered/wan_load_alarm.tcl from the message

Cheers

1 Accepted Solution

Accepted Solutions

I found a few bugs in this script.  I think this version should work better.

View solution in original post

23 Replies 23

Joe Clarke
Cisco Employee
Cisco Employee

Whenever action_syslog is called, just add a "\n" at the start of the msg argument.  For example:

acton_syslog msg "\nThis appears on a new line"

Hi Joseph,

Thanks for getting back to me mate.

I will try your suggestion shortly.

In the meantime can you please tell me if the following line will work:

event manager environment wan_load_history_outfile tftp:wan_load_history_outfile.dat

Cheers mate

This can work, but it will slow the script down a bit.  It is recommended to use a local file.

Hi Joseph,

For some reason the wan_load-alarm.tcl isn't working.

I applied it last night and it worked fine. I've reapplied it to another device and its not working.

I wonder if you could take a quick glance at the configs and let me know if I've missed something?

Cheers

Joseph,

You will notice that I decreased the thresholds and duration to speed up the results....

Joseph,

Below is debug of tcl:

*Mar  1 02:11:58.831: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : CTL : cli_open called.

*Mar  1 02:11:59.067: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT :

*Mar  1 02:11:59.067: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT : R2>

*Mar  1 02:11:59.071: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : IN  : R2>enable

*Mar  1 02:11:59.279: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT :

*Mar  1 02:11:59.279: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT : R2#

*Mar  1 02:11:59.283: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : IN  : R2#enable

*Mar  1 02:11:59.483: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT :

*Mar  1 02:11:59.483: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT : R2#

*Mar  1 02:11:59.483: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : IN  : R2#show int Ethernet1/0 | inc txload

*Mar  1 02:11:59.695: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT :      reliability 255/255, txload 143/255, rxload 142/255

*Mar  1 02:11:59.695: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT : R2#

*Mar  1 02:11:59.727: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : IN  : R2#more flash:wan_load_history_outfile.dat

*Mar  1 02:11:59.935: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT :      reliability 255/255, txload 143/255, rxload 142/255

*Mar  1 02:11:59.935: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT : R2#

*Mar  1 02:11:59.935: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT :

*Mar  1 02:11:59.935: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : OUT : R2#

*Mar  1 02:11:59.959: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : CTL : cli_close called.

*Mar  1 02:11:59.959: %HA_EM-6-LOG: wan_load_alarm.tcl : DEBUG(cli_lib) : IN  : R2#exit

As you can see, threshold have been breached...

Joseph,

Could you show me how to remove

wan_load_history_outfile.dat

Cheers mate

Hi Joseph,

Sorry for bombarding you with messages,

I'm also getting the following error message

*Mar  1 00:43:37.207: %HA_EM-7-FMS_POLICY_MAX_ENTRIES: fh_schedule_policy: Maximum number of script publish entries exceeded; some events have been discarded

*Mar  1 00:43:39.211: %HA_EM-7-FMS_POLICY_MAX_ENTRIES: fh_schedule_policy: Maximum number of script publish entries exceeded; some events have been discarded

Is there a reason for this?

Cheers

This means that too many policies are being executed at one time, and the EEM server queue is filling up.  You might have some EEM policies stuck in the queue, or you've descreased the interval too low.

I found a few bugs in this script.  I think this version should work better.

How Joseph, thanks for getting back to me. I haven't had a chance to test the new script. Does it exclude the logging to flash? If not can you please show me how stop the logging. I tried myself but I failed miserably.

Appreciate it.

Sent from Cisco Technical Support iPad App

The "logging" needs to be done to track the multiple samples.  However, when the samples have been collected, the file will be deleted by the script.  That part of the script looked okay to me.

Hi Joseph,

I've tested the new script and it appears to working fine.

As I mentioned, would you be kind enough to show me how remove the out file,

'wan_load_history_outfile.dat' ?

Would really appreciate it mate.

Cheers

Carlton

Hi Joesph,

I presume you're too busy to help me with this any further ;-(

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:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco