By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,479 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,479 IT Pros & Developers. It's quick & easy.

I get error message „WARNING: terminal is not fully functional” when I use telnetlib

P: 1
Hi Everybody,

I am a radio engineer who try making own working life easier by Python codes. In last time I used telnetlib to communicate to special shell of radio equipments. Everything is sunny until I apply any shell command which generates answer of more lines.

For example:

The next part of code gives back the correct part number of equipment


Expand|Select|Wrap|Line Numbers
  1.  tn.write("get part-number\n")
  2. pn = tn.read_until("inventory>", 15)
  3. print pn 
output on display: XC-123S

but, the next creates an error message: „WARNING: terminal is not fully functional”

Expand|Select|Wrap|Line Numbers
  1.  tn.write("show mrmc\n")
  2. response=tn.read_until("inventory>",15)
  3. print response
  4. tn.write("cd /radio/rfu\n")
output on display: WARNING: terminal is not fully functional

output on display should be:

IP-10:/interfaces/pdh/trails> show-all-trails
================================================== ========================
Legend: s/i/n/- 's'=slot-id 'i'=if-type 'n'=if-num '-'=Empty
s(0..6) i(l=line/r=radio/m=stm-1/c=chain/s=sync_ethernet) n(1..180)
================================================== ========================
Source Dest1 Dest2 Dest3 Dest4 Dest5 Dest6 Dest7 Dest8 Dest9
------------------------------------------------------------------------------
IndexInDb = 1, ID = TRAIL1, Desc = DefaultTrail1, Prio = high
Act = reserved, TS = (0)
0/l/ 1 0/r/ 1 - - - - - - - -
------------------------------------------------------------------------------
IndexInDb = 2, ID = TRAIL2, Desc = DefaultTrail2, Prio = high
Act = reserved, TS = (1)
0/l/ 2 0/r/ 2 - - - - - - - -
------------------------------------------------------------------------------
IndexInDb = 3, ID = TRAIL3, Desc = DefaultTrail3, Prio = high
Act = reserved, TS = (2)
0/l/ 3 0/r/ 3 - - - - - - - -
------------------------------------------------------------------------------
IndexInDb = 4, ID = TRAIL4, Desc = DefaultTrail4, Prio = high
Act = reserved, TS = (3)
0/l/ 4 0/r/ 4 - - - - - - - -
------------------------------------------------------------------------------

If I switch on debugging I see the correct answer of equipment but telnetlib could not give over multi-line answer to variable ’response’.

Telnet(10.128.90.209,23): send 'show mrmc\n'
Telnet(10.128.90.209,23): recv 'show mrmc\r\n'
Telnet(10.128.90.209,23): recv 'WARNING: terminal is not fully functional\r\n\r\x00- (p'
Telnet(10.128.90.209,23): recv 'ress RETURN)'
' show-all-trails\r\nWARNING: terminal is not fully functional\r\n\r- (press RETURN)'
Telnet(10.128.90.209,23): send '\r\n'
Telnet(10.128.90.209,23): send 'cd /radio/rfu\n'
Telnet(10.128.90.209,23): recv '\r\x00\r\x00'
Telnet(10.128.90.209,23): recv '================================================= ='
Telnet(10.128.90.209,23): recv "========================\r\nLegend: s/i/n/- 's'=slot"
Telnet(10.128.90.209,23): recv "-id 'i'=if-type 'n'=if-num '-'=Empty\r\n s(0."
Telnet(10.128.90.209,23): recv '.6) i(l=line/r=radio/m=stm-1/c=chain/s=sync_ethern'
Telnet(10.128.90.209,23): recv 'et) n(1..180)\r\n==================================='
Telnet(10.128.90.209,23): recv '=======================================\r\nSource D'
Telnet(10.128.90.209,23): recv 'est1 Dest2 Dest3 Dest4 Dest5 Dest6 De'
Telnet(10.128.90.209,23): recv 'st7 Dest8 Dest9\r\n-----------------------------'
Telnet(10.128.90.209,23): recv '-------------------------------------------------\r'
Telnet(10.128.90.209,23): recv '\nIndexInDb = 1, ID = TRAIL1, Desc = DefaultTrail1,'
Telnet(10.128.90.209,23): recv ' Prio = high\r\nAct = reserved, TS = (0) \r\n0/l/ 1 0'
Telnet(10.128.90.209,23): recv '/r/ 1 - - - - - -'
Telnet(10.128.90.209,23): recv ' - - \r\n-----------------------------'
Telnet(10.128.90.209,23): recv '-------------------------------------------------\r'
Telnet(10.128.90.209,23): recv '\nIndexInDb = 2, ID = TRAIL2, Desc = DefaultTrail2,'
Telnet(10.128.90.209,23): recv ' Prio = high\r\nAct = reserved, TS = (1) \r\n0/l/ 2 0'
Telnet(10.128.90.209,23): recv '/r/ 2 - - - - - -'
Telnet(10.128.90.209,23): recv ' - - \r\n-----------------------------'
Telnet(10.128.90.209,23): recv '-------------------------------------------------\r'
Telnet(10.128.90.209,23): recv '\nIndexInDb = 3, ID = TRAIL3, Desc = DefaultTrail3,'
Telnet(10.128.90.209,23): recv ' Prio = high\r\nAct = reserved, TS = (2) \r\n0/l/ 3 0'
Telnet(10.128.90.209,23): recv '/r/ 3 - - - - - -'
Telnet(10.128.90.209,23): recv ' - - \r\n-----------------------------'
Telnet(10.128.90.209,23): recv '-------------------------------------------------\r'
Telnet(10.128.90.209,23): recv '\nIndexInDb = 4, ID = TRAIL4, Desc = DefaultTrail4,'
Telnet(10.128.90.209,23): recv ' Prio = high\r\nAct = reserved, TS = (3) \r\n0/l/ 4 0'
Telnet(10.128.90.209,23): recv '/r/ 4 - - - - - -'
Telnet(10.128.90.209,23): recv ' - - \r\n-----------------------------'
Telnet(10.128.90.209,23): recv '-------------------------------------------------\r'
Telnet(10.128.90.209,23): recv '\n\r\x00IP-10:/interfaces/pdh/trails> cd /radio/rfu\r\nIP'
Telnet(10.128.90.209,23): recv '-10:/radio/rfu> '
Telnet(10.128.90.209,23): send 'get rx-level\n'
T

I have been googling and reading documentation a lot of to eliminate my issue without any success.

I work on SunOS with python 2.4.4

Any help would be very useful. Thanks, Gyorgy
Nov 10 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.