0

Hello Guys,

I apologized if I may have misplaced this post as I cannot see CURL on any category.

Here is my situation. I am trying to create a batch file which will pull up information from a fleet of devices via its web interface. I am using CURL to do that. The output will be 1 file for each device. I created a text file that lists all the IP address of the devices.

Below is the command I usedd for just one device:

curl http://<IP>/cgi-bin/history > <nameOFfile.txt>

Any help will be much appreciated.

Thanks.

3
Contributors
3
Replies
24
Views
2 Years
Discussion Span
Last Post by BobMCT
0

Hi, few questions:

  1. which operative system?
  2. can you use PHP or another scripting language?
  3. you have the IP list, nameOFfile.txt is an arbitrary value or defined in the list?
0

Hello Cereal,

This is for a Windows OS. I am not familiar with PHP. Hence, I only use CURL. I have provided an example of IPs below. You can just simply save this as a text file.

192.168.1.5
192.168.1.6
192.168.1.7

So, what is going to happen is I will create a batch file that would call something like this:

curl http://192.168.1.5/cgi-bin/history > printer1.txt

Printer1.txt will be the output. The output contains the values generated from the web interface of 192.168.1.5.

Thanks for the help.

1

You might do better is create the output file(s) using the -o operand of curl.
-o printer1.txt
And, you might want to load the IP's into an array and use a loop within the cmd script to access and write all the device info.

Research windows cmd array and also the for commands.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.