04-25-2013 05:36 PM
Is it possible this way if I'm making two script? Thanks.
Script 1
For this log:
Apr 24 07:40:01.884 MNL: %LINK-3-UPDOWN: Interface Cellular0/2/0, changed state
to down
ROUTER(config)#event manager applet cell1
ROUTER(config-applet)# event syslog pattern "Interface Cellular0/2/0, changed state to down"
ROUTER(config-applet)# action 1.0 cli command "enable"
ROUTER(config-applet)# action 1.1 cli cmmand "configure term"
ROUTER(config-applet)# action 1.2 cli command "interface Cellular0/2/0"
ROUTER(config-applet)# action 1.3 cli command "no shut"
ROUTER(config-applet)#
Script 2
For this log:
Apr 25 11:17:49.881 MNL: %CELLWAN-2-MODEM_DOWN: Modem in HWIC slot 0/2 is DOWN
ROUTER(config)#event manager applet cell2
ROUTER(config-applet)# event syslog pattern "Modem in HWIC slot 0/2 is DOWN"
ROUTER(config-applet)# action 1.0 cli command "enable"
ROUTER(config-applet)# action 1.1 cli cmmand "reload at 19:00"
ROUTER(config-applet)#
Solved! Go to Solution.
12-03-2013 04:31 PM
hi joseph, what is the script to put inside the event manager environment q "
event manager environment q
action 3.2 cli command "config t"
action 3.3 cli command "event manager applet reload-at-seven"
action 3.4 cli command "event timer cron cron-entry $q 0 19 * * *$q"
action 3.5 cli command "action 1.0 reload"
action 3.6 cli command "end"
is this it?
12-03-2013 05:49 PM
All this does is create a variable, q, to stand for the double quote character. All you need to configure is:
event manager environment q "
Then you can use $q in your applets to stand for the embedded double quote.
08-27-2013 12:00 AM
Hi Joseph, I just found an error on using the script and the action doesn't work. It says there's something wrong with the variable "hour". How can I resolve this? Thanks.
Aug 25 08:23:57.362: %CELLWAN-2-MODEM_DOWN: Modem in HWIC slot 0/0 is DOWN
Aug 25 08:23:57.690: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: hour
Aug 25 08:23:57.690: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: hour
08-27-2013 08:13 AM
The output of show clock must not be matching the regexp. Run "debug event manager action cli" and look at the output to see what "show clock" looks like to EEM.
08-27-2013 11:38 PM
I have now executed the command, so how do i exactly see the output? thanks
ROUTER#debug event manager action cli
Debug EEM action cli debugging is on
ROUTER#sh clo
14:32:03.655 Wed Aug 28 2013
08-28-2013 08:34 AM
I meant enable debug, get your policy to execute, then look at the debug output to see what the show clock output looks like to EEM.
08-29-2013 12:33 AM
This is what looks like.
Aug 29 14:31:07.757 MNL: %CELLWAN-2-MODEM_DOWN: Modem in HWIC slot 0/0 is DOWN
Aug 29 14:31:07.761 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : CTL : cli_open called.
Aug 29 14:31:07.761 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : ROUTER>
Aug 29 14:31:07.761 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : IN : ROUTER>enable
Aug 29 14:31:08.073 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : No authorization entry found for 172.29.7.17
Aug 29 14:31:08.073 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT :
Aug 29 14:31:08.073 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : ROUTER>
Aug 29 14:31:08.073 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : IN : ROUTER>show clock
Aug 29 14:31:08.085 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : 14:31:08.077 MNL Thu Aug 29 2013
Aug 29 14:31:08.085 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : ROUTER>
Aug 29 14:31:08.085 MNL: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: hour
Aug 29 14:31:08.085 MNL: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: hour
Aug 29 14:31:08.085 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : CTL : cli_close called.
08-29-2013 02:28 PM
Not sure what your applet looks like now, but try this:
action 003 regexp "([0-9]+):[0-9]+:[0-9]+" $_cli_result match hour
08-30-2013 01:47 AM
ok thanks. i'll inform you if it works.
09-04-2013 05:02 PM
This is what it looks like. does the script works?
Sep 4 08:19:14.565 MNL: %CELLWAN-2-MODEM_DOWN: Modem in HWIC slot 0/0 is DOWN
Sep 4 08:19:14.565 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : CTL : cli_open called.
Sep 4 08:19:14.569 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : PHILAM-ANT-BR01>
Sep 4 08:19:14.569 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : IN : PHILAM-ANT-BR01>enable
Sep 4 08:19:14.881 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : No authorization entry found for 172.29.7.17
Sep 4 08:19:14.881 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT :
Sep 4 08:19:14.881 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : PHILAM-ANT-BR01>
Sep 4 08:19:14.881 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : IN : PHILAM-ANT-BR01>show clock
Sep 4 08:19:14.893 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : 08:19:14.881 MNL Wed Sep 4 2013
Sep 4 08:19:14.893 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : PHILAM-ANT-BR01>
Sep 4 08:19:14.893 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : CTL : cli_close called.
Sep 4 08:19:31.233 MNL: %LINK-5-CHANGED: Interface Cellular0/0/0, changed state to reset
Sep 4 08:19:34.477 MNL: %CELLWAN-2-MODEM_UP: Modem in HWIC slot 0/0 is now UP
09-04-2013 05:22 PM
hi joseph, there should be an enable password after these bold text indicated. how to put password on it? thanks
Sep 4 16:49:21.764 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : IN : PHILAM-BLA-BR01>enable
Sep 4 16:49:22.076 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT : No authorization entry found for 172.29.7.20
Sep 4 16:49:22.076 MNL: %HA_EM-6-LOG: cell2 : DEBUG(cli_lib) : : OUT :
09-04-2013 05:56 PM
Hi joseph, I think it needed an username before action "enable" and a password after "enable". so how can i put that in the script? thanks
09-05-2013 10:33 AM
Configure:
event manager session cli username USER
Where USER is a username authorized to run all of the CLI commands in your applet.
09-08-2013 07:06 PM
is it also possible to configure telnet password and enable password?
09-08-2013 08:37 PM
No. They are not used or needed by EEM.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide