Konfigurasi Event CLI
Kali ini kita akan coba EEM based on command CLI,
Untuk topology masih sama, berikut konfigurasinya :
R1
R1(config)#event manager applet SHOW_INTERFACE_UP
R1(config-applet)#event cli pattern "show ip interface brief" sync yes
R1(config-applet)#action 1.0 cli command "enable"
R1(config-applet)#action 2.0 cli command "show ip interface brief | include up"
R1(config-applet)#action 3.0 puts "$_cli_result"
R1(config-applet)#action 4.0 set $_exit_status "0"
Lakukan debug pada R1
R1
R1#debug event manager action cli
Debug EEM action cli debugging is on
Coba verifikasi interface dan lihat output nya.
R1
R1#show ip interface brief
FastEthernet0/0..........................12.12.12.1 YES manual up up
Loopback0 1.1.1.1 YES manual up up R1#
*Feb 7 08:07:22.327: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
CTL : cli_open called.
*Feb 7 08:07:22.335: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
OUT : R1>
*Feb 7 08:07:22.335: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : : IN
: R1>enable
*Feb 7 08:07:22.347: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
OUT : R1#
*Feb 7 08:07:22.347: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
IN
: R1#show ip interface brief | include up
*Feb 7 08:07:22.383: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
OUT : FastEthernet0/0........................ 12.12.12.1 YES manual up up
R1#
*Feb 7 08:07:22.383: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
OUT : Loopback0 1.1.1.1 YES manual up up
*Feb 7 08:07:22.383: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
OUT : R1#
*Feb 7 08:07:22.387: %HA_EM-6-LOG: SHOW_INTERFACE_UP : DEBUG(cli_lib) : :
CTL : cli_close called.
Seperti yang kita lihat ketika kita mengetik show ip interface brief maka output yang
keluar hanya interface yang up saja.
Tidak ada komentar:
Posting Komentar