cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1812
Views
0
Helpful
14
Replies

DDNS EEM

farguisito
Level 1
Level 1

Hi,

I have 2 tracks because I want to change the domain in one HTTP method in No-ip service.

I have a problem because when I see the running-config I see that the ? is not incluide in the HTTP Method.

This is my EEM

event manager applet TRACK1
event track 1 state up

action 4.0 cli command "ip ddns update method no-ip"
action 4.1 cli command "HTTP"
action 4.2 cli command "no add http://user:password@dynupdate.no-ip.com/nic/update?hostname=domain2&myip=<a>"
action 4.3 cli command "add http://user:password@dynupdate.no-ip.com/nic/update?hostname=domain1&myip=x.y.z.f"
action 4.4 cli command "interval maximum 0 0 5 0"
action 4.5 cli command "interval minimum 0 0 5 0"
action 4.6 cli command "exit"

event manager applet TRACK2
event track 2 state up

action 4.0 cli command "ip ddns update method no-ip"
action 4.1 cli command "HTTP"
action 4.2 cli command "no add http://user:password@dynupdate.no-ip.com/nic/update?hostname=domain1&myip=<a>"
action 4.3 cli command "add http://user:password@dynupdate.no-ip.com/nic/update?hostname=domain2&myip=x.y.z.f"
action 4.4 cli command "interval maximum 0 0 5 0"
action 4.5 cli command "interval minimum 0 0 5 0"
action 4.6 cli command "exit"

I see this one, when is up the track 2

ip ddns update method no-ip
HTTP
add http://user:password@dynupdate.no-ip.com/nic/updatehostname=domain2&myip=x.y.z.f"
interval maximum 0 0 5 0
interval minimum 0 0 5 0

I haven't ? in the add. Then I my router isn't update the domain.

Could anybody help me please??

Thanks

Regards.

14 Replies 14

Joe Clarke
Cisco Employee
Cisco Employee

The '?' will trigger the context help.  So you need to escape it.  Do it this way:

event manager environment q "?"

To put the '?' in the config, you'll need to do "Control+V" then '?'.

Then, change your applet to:

action 4.2 set cmd "no add http://user:password@dynupdate.no-ip.com/nic/update"

action 4.3 append cmd "$q"

action 4.4 append cmd "hostname=domain1&myip=<a>"

action 4.5 cli command "$cmd"
action 4.6 set cmd "add http://user:password@dynupdate.no-ip.com/nic/update"

action 4.7 append cmd "$q"

action 4.8 append cmd "hostname=domain2&myip=x.y.z.f"

action 4.9 cli command "$cmd"

Hi Joe,

I have tested your respond however the track isn't working right.

the track is working, I am sure, but I think that I have any mistake when The router execute action 4.1 ...

I have this EEM script

action 4.1 cli command "HTTP"
action 4.2 set cmd "no add http://user:pass@dynupdate.no-ip.com/nic/update"
action 4.21 append cmd "$q"
action 4.22 append cmd "hostname=domain&myip=<a>"
action 4.23 cli command "$cmd"
action 4.24 set cmd "add http://user:domain@dynupdate.no-ip.com/nic/update"
action 4.25 append cmd "$q"
action 4.26 append cmd "hostname=domain&myip=ip2"
action 4.27 cli command "$cmd"
action 4.4 cli command "interval maximum 0 0 5 0"
action 4.5 cli command "interval minimum 0 0 5 0"
action 4.6 cli command "exit"
action 4.7 cli command "exit"
action 4.71 cli command "interface Cellular0"
action 4.72 cli command "no ip ddns update hostname domain"
action 4.73 cli command "no ip ddns update no-ip"
action 4.74 cli command "interface FastEthernet4"
action 4.75 cli command "ip ddns update hostname domain"
action 4.76 cli command "ip ddns update no-ip"
action 4.77 cli command "end"

have any wrong??

Thanks.

Regards.

Enable "debug event manager action cli", re-run the policy, and post the output.

*Jul 19 12:21:43.938: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-update-method)#
*Jul 19 12:21:43.938: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : IN : Router(DDNS-update-method)#HTTP
*Jul 19 12:21:43.950: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-HTTP)#
*Jul 19 12:21:43.950: %HA_EM-3-FMPD_UNKNOWN_ENV: fh_parse_var: could not find environment variable: q
*Jul 19 12:21:43.950: %HA_EM-3-FMPD_ERROR: Error executing applet TRACK1 statement 4.21
*Jul 19 12:21:43.950: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : CTL : cli_close called.
*Jul 19 12:21:43.954:
*Jul 19 12:21:43.954: tty is now going through its death sequence

You missed the part in my initial response when I said you need to configure:

event manager environment q ?

To put the '?' in the config, you'll need to do "Control+V" then '?'.

Hi,

yes, I forgot this sentece,

the problem is that the issue is the same, the sentence is the same.

i have checked to 

event manager environment q ?

and

event manager environment q "?"

*Jul 19 19:23:45.494: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-update-method)#
*Jul 19 19:23:45.494: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : IN : Router(DDNS-update-method)#HTTP
*Jul 19 19:23:45.506: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-HTTP)#
*Jul 19 19:23:45.506: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : IN :Router(DDNS-HTTP)#no add http://user:pass@dynupdate.no-ip.com/nic/update"?"hostname=domain&myip=<a>
*Jul 19 19:23:45.518: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : <cr>
*Jul 19 19:23:45.518: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT :
*Jul 19 19:23:45.518: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-HTTP)#
*Jul 19 19:23:45.518: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT :Router(DDNS-HTTP)#

Try:

event manager environment cv ^V

event manager environment q ?

Here, "^V" is Control+V, Control+V.  Then use the sequence "$cv$q" in your applet where you want a ? to appear.

Hi,

I have now the next code in the running config

add http://user:pass@dynupdate.no-ip.com/nic/update^Vhostname=domain&myip=<a>

and in the applet is 

event manager environment cv ^V
event manager environment q ?

event manager applet TRACK1
event track 1 state up

.

.

.

action 4.24 set cmd "add http://user:passs@dynupdate.no-ip.com/nic/update"
action 4.25 append cmd "$cv$q"
action 4.26 append cmd "hostname=domain&myip=<a>"

Thanks for your collaboration.

Regards.

Hi,

I  am looking for anything about this issue and I don´t find anything to insert ? in a EEM code.

I have 2 diferent ISPs in this router (one static ip and one dynamic ip). Then I want to change the ip of my DNS domain to static ip or dynamic ip when one track is trigered.

the sentence of DDNS is

add http://user:pass@dynupdate.no-ip.com/nic/update?hostname=<h>&myip=<a>

and sometimes I want to change to 

add http://user:pass@dynupdate.no-ip.com/nic/update?hostname=<h>&myip=staticip

I see that in the first sentence, the ip is pointng to object <a>,

If I can't insert ? in the EEM Script, Could I change the valor in the variable <a>???

I don´t know if this last question is more difficult that the first issue.

Thanks.

REgards.

Edit:

I have checked in the running_config that ^V is between "".

Also I saw this debug

:Router(DDNS-HTTP)#
*Jul 20 17:19:28.354: %HA_EM-6-LOG: TRACK1: http://user:password@dynupdate.no-ip.com/nic/update^V?hostname=domaint&myip=<a>
*Jul 20 17:19:28.354: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : IN : CabrelaRouter(DDNS-HTTP)#add http://user:pass@dynupdate.no-ip.com/nic/update^V?hostname=domaint&myip=<a>
*Jul 20 17:19:28.474: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : WORD
*Jul 20 17:19:28.474: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT :

I think that Crtl+V isn't inserted fine.

Could you help me with this issue??

Thanks.

This debug looks correct.  It's doing what you want.  The '?' is being inserted.

Hello.

Looks like the configuration should be like this:


event manager environment cv ^V
...
action 4.0 cli command "ip ddns update method no-ip"
action 4.1 cli command "HTTP"
action 4.2 cli command "no add http://user:password@dynupdate.no-ip.com/nic/update$cv?hostname=domain2&myi..."
action 4.3 cli command "add http://user:password@dynupdate.no-ip.com/nic/update$cv?hostname=domain1&myi..."
action 4.4 cli command "interval maximum 0 0 5 0"
action 4.5 cli command "interval minimum 0 0 5 0"

Hi Vasili,

I have insert your advice although it isn't working fine. ^V is not detected like Ctrl + V.

I have attached the log of the EEM.

Had Nobody the same problem anythime??

Regards.

*Jul 21 16:26:53.036: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-update-method)#
*Jul 21 16:26:53.036: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : IN : Router(DDNS-update-method)#HTTP
*Jul 21 16:26:53.048: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-HTTP)#
*Jul 21 16:26:53.048: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : IN : Router(DDNS-HTTP)#remove http://user:Pass@dynupdate.no-ip.com/nic/update^V?hostname=domain&myip=x.y.z.w
*Jul 21 16:26:53.060: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : WORD
*Jul 21 16:26:53.060: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT :
*Jul 21 16:26:53.060: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-HTTP)#
*Jul 21 16:26:53.060: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : Router(DDNS-HTTP)#
*Jul 21 16:26:53.060: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : IN : Router(DDNS-HTTP)#add http://user:Pass@dynupdate.no-ip.com/nic/update^V?hostname=<h>&myip=<a>
*Jul 21 16:26:53.072: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT : WORD
*Jul 21 16:26:53.072: %HA_EM-6-LOG: TRACK1 : DEBUG(cli_lib) : : OUT :

Hi JOE,

The ? was inserted but it is not detected like a character because you can see the OUT Word in the next setence. 

I don´t find any solution to insert one CTRL + V.

It works for me.  I can only imagine that you are not typing "Control+V" "Control+V" to insert the ^V character.  Note that this is ONE character, not two, when it's inserted into the config.

Review Cisco Networking for a $25 gift card