I made a script in bash in a Linux box that will ssh the mikrotik and get the "/ip dhcp-server leases"
Right now i am using this in the script to get the list:
Code: Select all
ssh user@mikroti.ip.address "/ip dhcp-server lease print terse" > /home/user/dhcp-list.txt
And when i get all data, i process it with awk and sed to get only IP address and Host name leased.. but in some lines its different and where the columnt where the Host-name is, i get the active server or the mac address and i dont need it.
Bottom line, its there a command that only shows what i need when i print? ie.
/ip dhcp-server lease print [host-name, ip-address] or something.?
thanks in advance.
JB