How to access an url when interface has down for 5 minutes and will send an email if it has up before 5 mins (will not access url)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 02:09 AM
I've tried this one before and it works, but the problem is, I would like to use full tcl, do I need 3 tcl script to do that? And is there another way to implement that 5 minutes problem? Because it looks a bit brute force to cancel the trigger occurs...
#event manager directory user policy "flash:/Test"
#event manager policy test.tcl
#test.tcl already contain the http::get
event manager environment _email_from yyy@yyy.com
event manager environment _email_to yyy@yyy.com
event manager environment _email_server yyy@yyy.com
event manager environment _email_cc yyy@yyy.com
event manager applet one
event syslog pattern "Line protocol on Interface GigabitEthernet0/0, changed state to down"
action 1.0 cli command "enable"
action 1.1 cli command "show clock"
action 2.0 mail server "$_email_server" to "$_email_to" from "$_email_from" cc "$_email_cc" subject "Test" body "$_cli_result"
event manager applet two
event tag e1 syslog pattern "Line protocol on Interface GigabitEthernet0/0, changed state to down"
trigger occurs 1 delay 60
correlate event e1
action 1.0 cli command "enable"
action 1.6 cli command "tclsh flash:/Test/test.tcl"
event manager applet three
event syslog pattern "Line protocol on Interface GigabitEthernet0/0, changed state to up"
action 1.0 cli command "enable"
action 1.1 cli command "configure term"
action 1.2 cli command "event manager applet two"
action 1.3 cli command "no trigger occurs 1 delay 60"
action 1.4 cli command "trigger occurs 1 delay 60"
action 1.5 cli command "correlate event e1"
action 2.0 mail server "$_email_server" to "$_email_to" from "$_email_from" cc "$_email_cc" subject "Test" body "$_cli_result"
- Labels:
-
EEM Scripting