{"id":2102,"date":"2020-08-14T00:41:00","date_gmt":"2020-08-13T23:41:00","guid":{"rendered":"https:\/\/www.balajibandi.com\/?p=2102"},"modified":"2024-03-14T09:37:06","modified_gmt":"2024-03-14T09:37:06","slug":"eem-script-with-boolean","status":"publish","type":"post","link":"https:\/\/www.balajibandi.com\/?p=2102","title":{"rendered":"EEM Script with boolean"},"content":{"rendered":"\n<p>same lab to test :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"264\" height=\"313\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-1.png\" alt=\"\" class=\"wp-image-2103\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-1.png 264w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-1-253x300.png 253w\" sizes=\"auto, (max-width: 264px) 100vw, 264px\" \/><\/figure>\n\n\n\n<p>SW35 run EEM Script and tracl eth 0\/0 and eth0\/1<\/p>\n\n\n\n<p>if both the interface down, then run EEM Script to download other LAN Interface. Once both the Interface come up and bring up the LAN Interface.<\/p>\n\n\n\n<p>track 1 ip sla 1 reachability<br>track 2 ip sla 2 reachability<br>track 3 list boolean and<br>object 1<br>object 2<br>delay down 60<\/p>\n\n\n\n<p>track 4 list boolean or<br>object 1<br>object 2<br>delay up 10<\/p>\n\n\n\n<p><br>exit<\/p>\n\n\n\n<p><br>!<br>ip sla 1<br>icmp-echo 10.10.20.1 source-interface Ethernet0\/1<br>frequency 10<br>exit<br>ip sla schedule 1 life forever start-time now<br>!<br>ip sla 2<br>icmp-echo 10.10.30.1 source-interface Ethernet0\/0<br>frequency 10<br>exit<br>ip sla schedule 2 life forever start-time now<br>!<\/p>\n\n\n\n<p>event manager applet test_down<br>event syslog pattern &#8220;%TRACK-6-STATE: 3 list boolean and Up -> Down&#8221;<br>action 1 cli command &#8220;enable&#8221;<br>action 2 cli command &#8220;configure terminal&#8221;<br>action 3 cli command &#8220;interface range Et0\/2-3&#8221;<br>action 4 cli command &#8220;shutdown&#8221;<br>action 5 cli command &#8220;end&#8221;<br>action 8 cli command &#8220;write memory&#8221;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Track up we use here Track 4 &#8211; if any one of the up we bring up the interface range<\/p>\n\n\n\n<p>event manager applet test_up<br>event syslog pattern &#8220;%TRACK-6-STATE: 4 list boolean or Down -> Up&#8221;<br>action 1 cli command &#8220;enable&#8221;<br>action 2 cli command &#8220;configure terminal&#8221;<br>action 3 cli command &#8220;interface range Et0\/2-3&#8221;<br>action 4 cli command &#8220;no shutdown&#8221;<br>action 5 cli command &#8220;end&#8221;<br>action 8 cli command &#8220;write memory&#8221;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Testing shutdown eth0\/0 and eth0\/1<\/p>\n\n\n\n<p>%TRACK-6-STATE: 1 ip sla 1 reachability Up -&gt; Down<\/p>\n\n\n\n<p>%TRACK-6-STATE: 2 ip sla 2 reachability Up -&gt; Down<\/p>\n\n\n\n<p>%TRACK-6-STATE: 3 list boolean and Up -&gt; Down<\/p>\n\n\n\n<p>and EEM Script runs :<\/p>\n\n\n\n<p>%SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:test_down)<\/p>\n\n\n\n<p>we can see eth0\/2 and0\/3 disabled &#8211; that means EEM script run as expected<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"126\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-2.png\" alt=\"\" class=\"wp-image-2104\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-2.png 593w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-2-300x64.png 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"321\" height=\"149\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-3.png\" alt=\"\" class=\"wp-image-2105\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-3.png 321w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-3-300x139.png 300w\" sizes=\"auto, (max-width: 321px) 100vw, 321px\" \/><\/figure>\n\n\n\n<p>Lets bring up Eth 0\/0 and eth 0\/1 and show track 3<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"325\" height=\"129\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-4.png\" alt=\"\" class=\"wp-image-2106\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-4.png 325w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-4-300x119.png 300w\" sizes=\"auto, (max-width: 325px) 100vw, 325px\" \/><\/figure>\n\n\n\n<p>and we can see log message EEM Script up activated.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"369\" height=\"135\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-6.png\" alt=\"\" class=\"wp-image-2111\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-6.png 369w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-6-300x110.png 300w\" sizes=\"auto, (max-width: 369px) 100vw, 369px\" \/><\/figure>\n\n\n\n<p>%SYS-5-CONFIG_I: Configured from console by on vty0 (<strong>EEM:test_up<\/strong>)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"126\" src=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-5.png\" alt=\"\" class=\"wp-image-2107\" srcset=\"https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-5.png 598w, https:\/\/www.balajibandi.com\/wp-content\/uploads\/2024\/03\/image-5-300x63.png 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/figure>\n\n\n\n<p>happy Labbing&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>same lab to test : SW35 run EEM Script and tracl eth 0\/0 and eth0\/1 if both the interface down, then run EEM Script to download other LAN Interface. Once both the Interface come up and bring up the LAN Interface. track 1 ip sla 1 reachabilitytrack 2 ip sla 2 reachabilitytrack 3 list boolean [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,2],"tags":[],"class_list":["post-2102","post","type-post","status-publish","format-standard","hentry","category-ccie-rns","category-cisco"],"_links":{"self":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/2102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2102"}],"version-history":[{"count":3,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/2102\/revisions"}],"predecessor-version":[{"id":2112,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/2102\/revisions\/2112"}],"wp:attachment":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}