CCNP - IP SLA With EEM Script
Lab 39 IP SLA With EEM Script
IP SLA, yang mana nantinya IP SLA ini digunakan untuk fitur monitoring, jadi jika IP SLA mendetect suatu link down maka EEM akan mengirimkan log ke email kita
Pertama konfigurasi-kan SLA pada R1
R1(config)#ip sla 1
R1(config-ip-sla)#icmp-echo 2.2.2.2
R1(config-ip-sla-echo)#frequency 10
R1(config-ip-sla-echo)#exit
R1(config)#ip sla schedule 1 life forever start-time now
R1(config)#track 1 ip sla 1 reachability
R1(config)#event manager applet TRACK_IP_DOWN
R1(config-applet)#event track 1 state down
R1(config-applet)#action 1.0 syslog msg "IP SLA 1 is down"
R1(config-applet)#action 2.0 mail server "smtp.gmail.com" to "idn.id" from
"support@idn.id" subject "IP SLA 1 is down" body "IP SLA 1 tidak menerima lagi
ICMP packet"
R1(config-applet)#exit
R1(config)#event manager applet IP_SLA_1_UP
R1(config-applet)#event track 1 state up
R1(config-applet)#action 1.0 syslog msg "IP SLA 1 is up"
Buat debug di R1
R1#debug event manager action cli
R1#debug event manager action mail
Matikan loopback yang ada di R2
R2(config)#int lo0
R2(config-if)#shutdown
R2(config-if)#exit
Sekarang kita cek di R1
R1(config)#
Translating "smtp.gmail.com"
*Feb 9 02:06:04.407: %TRACKING-5-STATE: 1 ip sla 1 reachability Up->Down
*Feb 9 02:06:04.423: %HA_EM-6-LOG: TRACK_IP_DOWN: IP SLA 1 is down
R1(config)#
*Feb 9 02:06:04.427: %HA_EM-6-LOG: TRACK_IP_DOWN : DEBUG(smtp_lib) :
smtp_connect_attempt: 1
*Feb 9 02:06:04.427: %HA_EM-6-LOG: TRACK_IP_DOWN : DEBUG(smtp_lib) :
fh_smtp_connect failed at attempt 1
R1(config)#
Translating "smtp.gmail.com"
*Feb 9 02:06:07.431: %HA_EM-6-LOG: TRACK_IP_DOWN : DEBUG(smtp_lib) :
smtp_connect_attempt: 2
*Feb 9 02:06:07.431: %HA_EM-6-LOG: TRACK_IP_DOWN : DEBUG(smtp_lib) :
fh_smtp_connect failed at attempt 2
Setelah itu kita nyalakan lagi loopback di R2
R2(config)#int lo0
R2(config-if)#no shutdown
R2(config-if)#exit
R1(config)#
*Feb 9 02:07:44.407: %TRACKING-5-STATE: 1 ip sla 1 reachability Down->Up
R1(config)#
*Feb 9 02:07:44.411: %HA_EM-6-LOG: IP_SLA_1_UP: IP SLA 1 is up
Kita cek lagi di R1
R1#show ip sla statistics
IPSLAs Latest Operation Statistics
IPSLA operation id: 1
Type of operation: icmp-echo
Latest RTT: 16 milliseconds
Latest operation start time: *02:08:34.115 UTC Sun Feb 9 2020
Latest operation return code: OK
Number of
successes: 10
Number of
failures: 10
Operation time to live: Forever
Selesai dech... :)
Komentar
Posting Komentar