Kitz Forum

Broadband Related => Router Monitoring Software => Topic started by: Silverback on July 26, 2020, 08:23:46 PM

Title: DSLStats - logging the telnet connection text
Post by: Silverback on July 26, 2020, 08:23:46 PM
Is there a way to log or view the actual text 'conversation' between DSLStats and the router / device when using the Special Login option to fault diagnose a connection failure?
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 26, 2020, 11:56:47 PM
Or has anybody connected to a Cisco device via telnet with DSLStats that can offer any advice?
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 27, 2020, 02:07:16 PM
I'm over the that bump, I think.  Added local login to router and used the normal login page in DSLStats.

I'm now experiencing an error when I try to pass a Custom CLI Command Prefix (Win64 version)

< "-" is an invalid float >

Is anybody using the the custom prefix option successfully?

Perhaps it compiled differently in the Linux version?

Any suggestions welcomed :)



Title: Re: DSLStats - logging the telnet connection text
Post by: roseway on July 27, 2020, 03:20:46 PM
What did you enter for the custom command prefix?
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 28, 2020, 10:54:23 PM
I put 'test vdsl 0 modem exec xdslctl' in as a prefix.

When I hit the start > button I get the error ("-" is an invalid float'). It happens on Win64 and Ubuntu with both 6.5 and 6.5.9.

In a standard telnet session to the box 'test vdsl 0 modem exec xdslctl info --stats' returns what I expect.

Title: Re: DSLStats - logging the telnet connection text
Post by: roseway on July 29, 2020, 06:38:31 AM
Sorry, but I don't think that would be expected to work. It was never designed to do any more than specify a single word which wasn't already in the list. That would be a new feature, which unfortunately I'm unable to do now.
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 29, 2020, 01:08:41 PM
Cool.  I understand :)

Thanks for letting me know.

Could you give a pointer to the relevent code in the source... a variable name perhaps?

Title: Re: DSLStats - logging the telnet connection text
Post by: roseway on July 29, 2020, 04:56:18 PM
It won't be easy to follow this through.

In the source file main.pas lines 5381 - 5411 are where the prefix is read and converted into the various telnet commands to be sent to the modem.

In the source file telnetunit1.pas lines 381-400 the various commands are sent to the modem. This is done by  a library called lNet (that's a lower case L). At this point your custom command will still be as you specified (it's just a string) but somewhere in the library functions it becomes mangled and returns an error. I'm afraid I don't know how to follow this through without a deep knowledge of lNet.
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 30, 2020, 01:42:17 PM
Thanks.

I'm only looking at the source files in Notepad++ so no debug. I see the string array and see the LTelnetClient.SendMessage but I'm screwed by the innards of that library too. Not that my Pascal is anything but weak...

Playing with the app I think the string is passed ok and the command executed on the router, maybe the error is on the returned data...  There are a couple of commands that don't work on the 887 (--bits and --vectoring)

Oh well it was a nice thought :)
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 31, 2020, 12:07:46 AM
Error is on returned data.

I've turned off monitoring of bits, modem uptime and vectoring status and the app connects and collects data :)

QLN, HLOG and SNR per tone don't get a correct data set but the rest looks ok a first glance.

That gives logging of the important stuff (for me at least).

Nice.
Title: Re: DSLStats - logging the telnet connection text
Post by: roseway on July 31, 2020, 06:19:02 AM
That's very smart work. :)
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 31, 2020, 10:01:32 AM
Guided solution. I would not have got there without your assistance. Thank you.

Just for info.  For some reason (at least for this firmware version)  --Bits --QLN and --Hlog all return truncated data a few hundred tones in.  Although the data returned looks good.  The command has a sub parameter LINE but I've failed at guessing what it might be.

The Linux cat command for uptime surprisingly returns data when sent via telnet session to the 887 but with xdslctl prefixed the router will rightly poop out an error.

Any chance of SSH support? <joke>

M :)
Title: Re: DSLStats - logging the telnet connection text
Post by: roseway on July 31, 2020, 10:44:14 AM
As it happens, I did work on SSH a few years ago, and got it working well, BUT after several minutes operation the modem/router overheated and crashed. I tried a different modem, with the same result. I concluded that the extra processing required for handling the SSH interface with frequently repeated commands was just too much for these low powered devices.
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on July 31, 2020, 11:41:25 PM
Although the 887 is the lower end of the Cisco range and an older device I would not necessarily call it a low powered unit compared to consumer grade stuff.  Also I just have it set up as a bridge and it's spec'ed for routing and most of what it's doing is at the hardware level.  I will have a second 887 available next week so if you fancy throwing an exe my way I'm up for testing SSH just for shits and giggle's...?
Title: Re: DSLStats - logging the telnet connection text
Post by: Alex Atkin UK on August 01, 2020, 05:57:39 PM
You can proxy telnet on a Linux box and log the traffic:
Code: [Select]
nc -l -p 23 -c "nc ModemIP 23 -o telnet.log"
That may work on Windows too actually if you download Netcat for Windows, although you might need to change the first port depending on if Windows lets you open a privileged port.
Title: Re: DSLStats - logging the telnet connection text
Post by: Silverback on August 01, 2020, 08:39:58 PM
Ha!  Logging a proxy connection. Nice. Thank you :)