CCNP - Event OSPF Adjancency Via Email
Lab 29 Event OSPF Adjancency Via Email
*LAB INI LANJUTAN DARI LAB SEBELUMNYA
Selain event syslog dan CLI tadi kita juga bisa memanfaatkan EEM ini untuk mengirimkan informasi ke email kita, misalnya OSPF kita down maka, router kita otomatis akan mengirimkan debug ospf ke email kita. Untuk topology masih sama.
R1(config)#event manager applet OSPF_DOWN
R1(config-applet)#event syslog pattern "Nbr 2.2.2.2 on FastEthernet0/0 from FULL
to DOWN"
R1(config-applet)#action 1.0 cli command "enable"
R1(config-applet)#action 2.0 cli command "debug ip ospf adj"
R1(config-applet)#action 3.0 mail server "smtp.gmail.com" to "hilmy45a@gmail.com" from "R1@idn.id" subject "OSPF IS DOWN" body"Please fix OSPF"
R1#debug event manager action mail Debug EEM action mail debugging is on
R1(config)#no event manager applet INTERFACE_DOWN
R1(config)#interface f0/0
R1(config-if)#shutdown R1
Sekarang kita cek
R1(config-if)#
Translating "smtp.gmail.com"
*Feb 7 07:54:43.747: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on FastEthernet0/0
from FULL DOWN, Neighbor Down: Interface down or detached
*Feb 7 07:54:43.895: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : CTL :
cli_open called.
*Feb 7 07:54:43.919: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : OUT : R1>
*Feb 7 07:54:43.919: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : IN :
R1>enable
*Feb 7 07:54:43.951: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : OUT : R1#
*Feb 7 07:54:43.951: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : IN :
R1#debug ip ospf adj
*Feb 7 07:54:43.979: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : OUT : OSPF
adjacency events debugging is on
*Feb 7 07:54:43.979: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : OUT : R1#
R1(config-if)#
R1(config)#
*Feb 7 07:54:43.979: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(smtp_lib) :
smtp_connect_attempt: 1
*Feb 7 07:54:43.979: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(smtp_lib) :
fh_smtp_connect failed at attempt 1
*Feb 7 07:54:44.251: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq
0x8000000C, process 10
*Feb 7 07:54:44.255: OSPF: We are not DR to build Net Lsa for interface
FastEthernet0/0
*Feb 7 07:54:55.979: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(smtp_lib) :
smtp_connect_attempt: 5
*Feb 7 07:54:55.979: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(smtp_lib) :
fh_smtp_connect failed at attempt 5
*Feb 7 07:54:55.979: %HA_EM-3-FMPD_SMTP: Error occurred when sending mail to
SMTP server: smtp.gmail.com : error in connecting to SMTP server
*Feb 7 07:54:55.979: %HA_EM-3-FMPD_ERROR: Error executing applet
OSPF_DOWN statement 3.0
R1(config)#
*Feb 7 07:54:55.979: %HA_EM-6-LOG: OSPF_DOWN : DEBUG(cli_lib) : : CTL :
cli_close called.
Dengan ini konfigurasi kita sudah berhasil
Komentar
Posting Komentar