I'm trying to automate a task for energy meter data collection. It is available in the LAN with an IP address, and I can use TELNET for this unit. Following the "best girl's friend" suggestion, I'm trying to make the following work:
Code: Select all
/system script add name="telnet-script" source={
:local ip "192.XXX.X.XXX"
:local port "23"
:local fileName "IPM1.txt"
# Open Telnet session
/system telnet $ip port=$port
# Send login and commands
:delay 2
:put "ACC"
:delay 2
:put "Password"
:delay 2
:put "met e"
# Save the output to a file in the "sel735" directory
/tool fetch url="telnet://$ip/command-output" dst-path="sel735/$fileName"
}
Any chance I can make something like that work without Containers?