Galaxynik
Posts: 43
Joined: Mon Jan 02, 2012 2:55 pm

Pi telnetting into router to get stats

Fri Aug 09, 2013 3:30 pm

Hi Folks - my summer project :-)

I have a pi which happily runs an early version of Squeezeplugrpi (based on debian squeeze i think) currently its working wel as a nas and dlna server, its also collecting data from my currentcost electricity monitor and storing the data in RR database (perl), I have scripts executing regularly to create graphs (bash) and a webserver which allows me to view the data across the web ... phew.

What I want to do now is telnet every couple of mins into my router (technicolour 582n), login and run the following commands
'telnet 192.186.3.253'
'Administrator'
'Password'
'xdsl info expand=enabled'

get the output into a variable then ..

'exit'


then parse the data in the variable I want, store it in another RR database - I can then sort out graphing and making available to the webserver
what I am struggling with is the bold section above

any ideas - basically trying to have a routerstats like output without running a energy guzzling windows machine running :D Oh and the Pi is running headless so I need to set it all up using putty and ssh'ing to the pi :)

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Pi telnetting into router to get stats

Fri Aug 09, 2013 3:36 pm

How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Galaxynik
Posts: 43
Joined: Mon Jan 02, 2012 2:55 pm

Re: Pi telnetting into router to get stats

Sun Aug 11, 2013 5:16 pm

Thanks I had a look at 'EXPECT' but while looking at it I found a telnet module for perl and since I was going to use perl for the rest of it I thought I'd give that a go amd managed to make some progress. Just now need to get better at PERL :D :D

Return to “Networking and servers”