EEM KONFIGURASI EVENT OSPF ADJACENCY ( EMAIIL ) - NETWORK AUTOMATION #9 ( CCNP )

 NETWORK AUTOMATION #9 :

EEM KONFIGURASI EVENT OSPF ADJACENCY ( EMAIL )

Selain event syslog 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.


Konfigurasinya seperti berikut :

 
R1
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
"sahrul@idnfoundation.org" from "R1@idn.id" subject "OSPF IS DOWN"
body "Please fix OSPF"
R1(config-applet)#exit


Lakukan debug event dan hapus EEM interface down bekas konfigurasi
sebelumnya. 

 
R1
R1#debug event manager action mail Debug EEM action mail debugging is on
R1(config)#no event manager applet INTERFACE_DOWN
Shutdown interface f0/0 pada R1
R1
R1(config)#interface f0/0
R1(config-if)#shutdown
R1(config-if)#exit
R1
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.


Dari hasil debug kita bisa lihat bahwa router mencoba konek ke smtp server tapi
hasilnya “Translating "smtp.gmail.com" hal ini dikarenakan router kita tidak
terkoneksi ke internet. Tapi bisa kita simpulkan bahwa event email ini berhasil.


Komentar

Postingan populer dari blog ini

IPv6 ROUTING DYNAMIC ( RIPnG,OSPFv3 & EIGRP ) - IPv6 #3 ( CCNP )

BGP BASIC CONFIGURATION - BGP #2 ( CCNP )

OTP - EIGRP #17 ( CCNP )