Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting 'website' from command line 2

Status
Not open for further replies.

BIS

Technical User
Joined
Jun 1, 2001
Messages
1,897
Location
NL
Hello,

Looking for some input here. I have a sensor in a server room, and the only way to read it is by pointing a browser at it like:


The result looks like this:

EN1T;1TC: 24.0HU:39.2%IL 0.4


I am trying to find a way to graph this to get an idea of how the humidity fluctuates. If I could get the result string from a command line, I could redirect it to a file, awk for the 'HU:39.2%' part and append that to a file. From this I would have a historical collection of data I could then graph in excel for example.

But, how do I get the result from a command line? I tried with lynx, but that seems to be interactive, and I would need this to run from a cronjob for example.

Any idea?
 
Hi

You can use a downloader ( Wget, curl ), a text-mode browser ( Lynx, Links, ELinks, w3m ) or a networking tool ( Netcat ) :
Code:
curl '[URL unfurl="true"]http://192.168.10.20/index.html?em'[/URL] | sed -n 's/.*HU:\([0-9.]*\)%.*/\1/p' >> /log/file

Feherke.
feherke.github.io
 
Thanks! That works a charm :-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top