0
I have a large list of IP addresses from a database that I need to sanitize and determine which type of host (it'll be one of 2 device types) each IP address relates to.
Is there a way of using a batch file and/or Putty to telnet to (but not necessarily log in to) each host, check the initial message from the host, log it to a file and then disconnect and test the next one and so on?
What operating system? What shell? Note: Welcome to Super User. Unfortunately, we are not a code-writing service. Instead of simply asking for code to perform a particular task, please show us what you've tried so far (including any code you currently have) and where you're stuck so that we can help you with your specific problem. Questions that only ask for code are too broad and are likely to be put on hold or closed. Please read How do I ask a good question?.
– DavidPostill – 2015-06-23T12:19:27.723Apologies if you've misinterpreted the question. I'm not sure where I asked anyone for code? I want to know if it's possible before I start exploring how. I'm asking about capabilities of batch files, not requesting code. – Faldinio – 2015-06-23T13:04:32.703
I you do know how-to achieve your task for a particular (hard-coded) IP address, then yes, it's possible using modified loop:
FOR /F "delims=" %%G IN (list_of_IP_addresses.txt) DO ECHO %%G
– JosefZ – 2015-06-23T22:24:37.913