Taufik
"even cli pattern not capturing "conf t" ?"
what do you mean by this?
your debug looks fine
*Mar 1 06:14:16.546: check_eem_cli_policy_handler: command_string=configure
> terminal
> *Mar 1 06:14:16.546: check_eem_cli_policy_handler: num_matches = 1,
Here you can see that when you typed conf t it has been converted to
"configure terminal" automatically.
This is then matched against the cli pattern you configured.
Previously I think you were using just "conf t"
so when the applet was trying to match "configure terminal" with "conf
t" it was failing.
Thats why when you use "conf.* t.*" this matches "configure terminal"
ok and the applet runs.
As for the exit status you need to manually type it (it is not
available using tab). In this case the exit status defaulted to 0, if
you wanted the command to run then you would set exit status to 1.
*Mar 1 06:14:16.554: fh_io_msg: EEM callback policy NOCONF has ended with
> normal exit status of 0x0
make sense?
On 7 August 2010 20:56, Taufik Kurniawan <ktaufik_at_gmail.com> wrote:
> Hi Muzammil,
>
> It is working ...
> I don't use "set _exit_status" it is not available
>
> why
> even cli pattern not capturing "conf t" ?
> any explanation ?
>
> thanks
>
>
> the debug
>
> Router#conf t
> Router#
> *Mar 1 06:14:16.546: cli_history_entry_add: free_hist_list size=0,
> hist_list size=7
> *Mar 1 06:14:16.546: cli_conn_tm_alloc: ptp=0x66C4CC60
> *Mar 1 06:14:16.546: fh_fd_cli_event_match: publish_timer=0x66C4CA80,
> ptp=0x66C4CC60, max_delay=30000
> *Mar 1 06:14:16.546: cli_conn_tm_add: re=0x66DE2B14, ptp=0x66C4CC60
> *Mar 1 06:14:16.546: cli_pubinfo_enqueue: publish_entry EOK
> *Mar 1 06:14:16.546: fh_fd_cli_event_match: re=0x66DE2B14, ptp=0x66C4CC60,
> str=configure terminal
> *Mar 1 06:14:16.546: check_eem_cli_policy_handler: command_string=configure
> terminal
> *Mar 1 06:14:16.546: check_eem_cli_policy_handler: num_matches = 1,
> response_code = 4
> *Mar 1 06:14:16.546: fh_send_server_sig_hndlr: received a pulse from CLI
> Event Detector on node0/0 with fdid: 5
> *Mar 1 06:14:16.546: fh_send_cli_fd_msg: msg_type=62
> *Mar 1 06:14:16.546: fh_send_cli_fd_msg: sval=0
> *Mar 1 06:14:16.546: fh_send_server_sig_hndlr: received
> FH_MSG_EVENT_PUBLISH_SYNC
> *Mar 1 06:14:16.546: fh_schedule_callback: fh_schedule_callback:
> cc=66C037F8 prev_epc=0; epc=6675A428
> *Mar 1 06:14:16.546: fh_schedule_callback: EEM callback policy NOCONF has
> been scheduled to run
> *Mar 1 06:14:16.550: fh_io_msg: received FH_MSG_API_INIT; jobid=16,
> processid=230, client=6, job name=EEM Callback Thread
> *Mar 1 06:14:16.550: fh_server: fh_io_msg: received msg
> FH_MSG_EVENT_REQINFO from client 6 pclient 1
> *Mar 1 06:14:16.550: %HA_EM-0-LOG: NOCONF: NOT ALLOWED
> *Mar 1 06:14:16.554: fh_server: fh_io_msg: received msg
> FH_MSG_CALLBACK_DONE from client 6 pclient 1
> *Mar 1 06:14:16.554: fh_io_msg: EEM callback policy NOCONF has ended with
> normal exit status of 0x0
> *Mar 1 06:14:16.554: fh_send_cli_fd_msg: msg_type=16
> *Mar 1 06:14:16.554: fh_fd_cli_publish_done: rc=0, publish_expired=0
> *Mar 1 06:14:16.554: sid=3, ptp=0x66C4CC60, connp=0x66C5E6C8
> *Mar 1 06:14:16.554: fh_fd_cli_publish_done: num_sync_msgs=0,
> response_code=6
> *Mar 1 06:14:16.554: cli_conn_tm_remove: re=0x66DE2B14, ptp=0x66C4CC60
> *Mar 1 06:14:16.554: fh_fd_cli_conn_tm_free: ptp=0x66C4CC60
> *Mar 1 06:14:16.554: fh_send_cli_fd_msg: sval=0
> *Mar 1 06:14:16.554: fh_schedule_callback: fh_schedule_callback:
> cc=66C037F8 prev_epc=6675A428; epc=0
> *Mar 1 06:14:16.554: fh_schedule_policy: prev_epc=0x00000000;
> epc=0x00000000
> *Mar 1 06:14:16.554: fh_server: fh_io_msg: received msg FH_MSG_API_CLOSE
> from client 6 pclient 1
> *Mar 1 06:14:16.554: fh_io_msg: received FH_MSG_API_CLOSE client=6
> *Mar 1 06:14:16.554: check_eem_cli_policy_handler: out of wait EEM policy
> execution, response_code = 6
>
>
> On 7 August 2010 17:08, Muzammil Malick <malickmuz_at_gmail.com> wrote:
>>
>> Try this
>>
>> event manager applet NOCONF
>> event cli pattern "conf.* t.*" sync yes
>> action 1 syslog priority emergencies msg "NOT ALLOWED"
>> action 2 set _exit_status "0"
>>
>>
>>
>> On 7 August 2010 14:50, Taufik Kurniawan <ktaufik_at_gmail.com> wrote:
>> >
>> > http://www.cisco.com/en/US/prod/collateral/switches/ps5718/ps708/prod_white_paper0900aecd805457c3.html
>> >
>> > 3 lines EEM
>> >
>> > event manager applet myapplet
>> > event cli pattern "conf t" sync no skip no
>> > action 1.0 syslog msg "Configuration by Authorized Personnel ONLY"
>> >
>> > I try in GNS using 3600, 3750 and 7200
>> > None working ....
>> >
>> > Can anyone help ?
>> > thanks
>> >
>> >
>> > Router(config-applet)#action 1.0 sys
>> > Router(config-applet)#$ "Configuration by Authorized Personnel ONLY"
>> >
>> > Router(config-applet)#end
>> > Router#
>> > *Mar 1 00:03:51.479: %SYS-5-CONFIG_I: Configured from console by
>> > console
>> > Router#
>> > Router#debug eve man all
>> > All possible Embedded Event Manager debugging has been turned on
>> > Router#
>> > Router#
>> > Router#conf t
>> > Enter configuration commands, one per line. End with CNTL/Z.
>> > Router(config)#
>> > *Mar 1 00:04:06.691: cli_history_entry_add: free_hist_list size=0,
>> > hist_list size=7
>> > *Mar 1 00:04:06.691: check_eem_cli_policy_handler:
>> > command_string=configure
>> > terminal
>> > *Mar 1 00:04:06.691: check_eem_cli_policy_handler: num_matches = 0,
>> > response_code = 1
>> > Router(config)#
>> > Router(config)#do sh run | b even
>> >
>> > *Mar 1 00:04:37.263: cli_history_entry_add: free_hist_list size=0,
>> > hist_list size=7
>> > *Mar 1 00:04:37.263: check_eem_cli_policy_handler: command_string=do sh
>> > run
>> > | b even
>> > *Mar 1 00:04:37.263: check_eem_cli_policy_handler: num_matches = 0,
>> > response_code = 1
>> > *Mar 1 00:04:37.283: cli_history_entry_add: free_hist_list size=0,
>> > hist_list size=7
>> > *Mar 1 00:04:37.283: check_eem_cli_policy_handler: command_string=show
>> > running-config
>> > *Mar 1 00:04:37.283: check_eem_cli_policy_handler: num_matches = 0,
>> > response_code = 1event manager applet myapplet
>> > event cli pattern "conf t" sync no skip no
>> > action 1.0 syslog msg "Configuration by Authorized Personnel ONLY"
>> > !
>> > end
>> >
>> > Router(config)#
>> > *Mar 1 00:05:00.003: fh_fd_timer_process_async
>> > *Mar 1 00:05:00.003: cron_tick: num_matches 0$syslog msg "Configuration
>> > by
>> > Auth
>> > Router(config)#
>> >
>> >
>> > Blogs and organic groups at http://www.ccie.net
>> >
>> > _______________________________________________________________________
>> > Subscription information may be found at:
>> > http://www.groupstudy.com/list/CCIELab.html
Blogs and organic groups at http://www.ccie.net
Received on Sat Aug 07 2010 - 22:10:38 ART
This archive was generated by hypermail 2.2.0 : Wed Sep 01 2010 - 11:20:52 ART