10-05-2014 11:08 PM
Solved! Go to Solution.
10-08-2014 11:00 AM
You can iterate:
action 2.1 foreach line $_cli_result "\n"
action 2.2 regexp "ip address ([0-9\.]+)" "$_cli_result" match ipadd
action 2.3 if $_regexp_result eq 1
action 2.4 puts $ipadd
action 2.5 end
action 2.6 end
10-05-2014 11:27 PM
Sorry Its stupid Cisco BUG !
Buenas deas Amigos!
I want to get from interface all IP addresses.
For example I have vlan xx
sh run int vlan xx
interface VlanXX
ip address 172.16.1.1 255.255.255.0 secondary
ip address 10.10.10.1 255.255.255.0 secondary
ip address 192.168.1.1 255.255.255.0
I have created EEM Applet
event manager applet getip
event none sync yes
action 1.0 cli command "enable"
action 2.0 cli command "sh run int vlan 11"
action 2.2 regexp "ip address ([0-9\.]+)" "$_cli_result" _match _ipadd
action 2.3 puts "$_ipadd"
So I have got ONLY FIRST IP address 172.16.1.1
Dear ALL help me PUTS all addresses from the script . PLEASEeeeee
10-08-2014 11:00 AM
You can iterate:
action 2.1 foreach line $_cli_result "\n"
action 2.2 regexp "ip address ([0-9\.]+)" "$_cli_result" match ipadd
action 2.3 if $_regexp_result eq 1
action 2.4 puts $ipadd
action 2.5 end
action 2.6 end
10-08-2014 09:18 PM
Thank you Joseph !!!
The key "\n" is wonderful :-)
I attempted to use "foreach" but without "\n"
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