ROS 7.x - Get address not working

Hi,

can any tell me if this scipt is working on ROS 7.x

global ddnsip [ /ip address get [/ip address find interface="ether1" ] address ]

Error: invalid internal item number

It was working perfectly on 6.x ..

If I put in a corresponding number of the interface it works.. Something must’ve changed..
What is the new way in 7.x .. I could not find it in wiki or forum..

https://help.mikrotik.com/docs/display/ROS/Scripting+examples
The Check IP is not working on any of my ROS 7x

Works fine here: :put [ /ip address get [/ip address find interface=“ether2” ] address ]

Using: MikroTik RouterOS 7.12beta1

Just a guess… Possibly you have several ip addresses on that interface now?

Try that for the first address:

:global ddnsip [ /ip/address/get ([ /ip/address/find where interface="ether1" ]->0) address ];

… or add more properties to your filter.

Yes.. exactly I have more addresses! If I remove them it works the old fashioned way. Disable additional addresses does not help!
But your solution works with multiple addresses!.. Odd thing to change it like this..

Thank you very much for help! Much appriciated!

If you want to handle active addresses only add “disabled=no” to your filter:

:global ddnsip [ /ip/address/get ([ /ip/address/find where interface="ether1" disabled=no ]->0) address ];

It is all about your code! :winking_face_with_tongue: