Help for reader for NETGEAR DG834GT

E

Enzo Crasi

Hi.

I don't find the error
this script should read the SNR margin of my adsl line from router and
write it on txt file...
like this but without window
http://img159.imageshack.us/my.php?image=yoda6.png


but there is an error in the script
Can you help me?

require 'open-uri'

log = File.new("stats.log", "a+")
data = []

while true do
i = 0
open(
"http://192.168.0.1/stattbl.html",:http_basic_authentication=>["username",
"password"] ).each do |page|
page.each do |html|
case html
when /<span.*>.*kbps<\/span>/
html.each { |line|
line.sub(/<span.*>(.*)kbps/) { data = $1.strip }
}
i+=1
end
end
end
log.write "SNR: down(#{data[0]}) up(#{data[1]}) -- #{Time.now.to_s}\n"
sleep 3
end
log.close


the error is

c:/ruby/lib/ruby/1.8/net/http.rb:2003:in `each_response_header': wrong
header line format (Net::HTTP
BadResponse)
from c:/ruby/lib/ruby/1.8/net/http.rb:1977:in `read_new'
from c:/ruby/lib/ruby/1.8/net/http.rb:1044:in `request'
from c:/ruby/lib/ruby/1.8/open-uri.rb:261:in `open_http'
from c:/ruby/lib/ruby/1.8/net/http.rb:543:in `start'
from c:/ruby/lib/ruby/1.8/open-uri.rb:245:in `open_http'
from c:/ruby/lib/ruby/1.8/open-uri.rb:629:in `buffer_open'
from c:/ruby/lib/ruby/1.8/open-uri.rb:167:in `open_loop'
from c:/ruby/lib/ruby/1.8/open-uri.rb:165:in `open_loop'
from c:/ruby/lib/ruby/1.8/open-uri.rb:135:in `open_uri'
from c:/ruby/lib/ruby/1.8/open-uri.rb:531:in `open'
from c:/ruby/lib/ruby/1.8/open-uri.rb:86:in `open'
from reader.rb:8


thnks
 
C

Chris Gehlker

can anybody give an hand?

We don't know what you want. Almost everything can be configured by
simply pointing your browser to routerlogin.net and working from there.

---
Neither a man nor a crowd nor a nation can be trusted to act humanely
or to think sanely under the influence of a great fear.

-Bertrand Russell, philosopher, mathematician, author, Nobel laureate
(1872-1970)
 
E

Enzo Crasi

Chris said:
We don't know what you want. Almost everything can be configured by
simply pointing your browser to routerlogin.net and working from there.

---
Neither a man nor a crowd nor a nation can be trusted to act humanely
or to think sanely under the influence of a great fear.

-Bertrand Russell, philosopher, mathematician, author, Nobel laureate
(1872-1970)

first of all thanks for the answer

then
We don't know what you want.

sorry, maybe it's my fault
I want that script run on windows by ruby and made a file with this
line (like example) on it:

SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:53:51 CEST 2006
SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:53:57 CEST 2006
SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:54:02 CEST 2006
SNR: down(23.6 db), up(8.0 db) -- sab ago 5 15:54:08 CEST 2006
SNR: down(23.4 db), up(7.5 db) -- sab ago 5 15:54:13 CEST 2006

but it gave me an error.I don't find it! :cry:
Almost everything can be configured by
simply pointing your browser to routerlogin.net and working from there.

sorry but don't understand
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top