Jump to content

telnet scripting from ISY994i Network Resources


Tom73

Recommended Posts

Hi. I am rather new to the ISY. I upgraded to pro, added the ISY Portal, and I even have one of my spoken Amazon Tap commands sending to the MakerChannel which sends an API call to my Squeezebox server to play a song. It does feel a bit like the scene from The Big Bang Theory.  Having a lot of fun with it.

 

I'm trying to power on (and off) some Dell R710 servers.  The hardware predates Dell's use of their Redfish API.  I've enabled telnet access into my iDRAC6  (ethernet based control interface, telnet, ssh, 80 and 443 available).  If I telnet there, it takes just 4 responses to turn on..... user, password, racadm  (which enables the command set) and then the command "racadm serveraction powercycle"  and I'm in business.

 

In Network Resources, I've set my script for TCP 23, and I set the timeout to 5000 ms, just so I can see how it's pacing itself.  I've tried raw and C Escaped, and on new lines, as well as \r, \r\n and \n\r and even \n, and it's never very different.  The response window opens and for a very long time (5 seconds I'd say, smiling) there's nothing at all --- so I'm getting stuff BECAUSE of the timeout --- and I get some odd characters, some squares, like this >>  ??[]??[]??!??[]      and then, right away (with no spaces) is my username, new line, password, new line, racadm, new line, and then exit. (Gotta prove I can stand before I can walk.)  and THEN the banner and text from the iDRAC6 which I would expect "idrac-9MVZKM1 login: Password:"  << note that it shows login and password at the end! after the 5 seconds have elapsed.

 

Anyone have an idea for me?  I think if I could insert a delay in the string, I might be able to make it more healthy.... like....

/d/d/d/d  username /r/n  password /r/n  /d/d/d/d /r/n racadm /r/n /d/d racadm serveraction powercycle /r/n

(added spaces to make it more readable).... and where the /d gives a delay of like 1 or 2 seconds... or maybe make the delay units configurable like in the timeout parameter.

 

Anyway -- thanks for reading my long note.  I'm having a great time.  This telnet script is pretty close to working.  If I had a delay character, it might just work.

 

Thanks,

tom

 

Link to comment

Post your request for the time delay script character in the Feature Request section.

 

I had suggested that some time back to accommodate MiLight controlling  Network Resources needing a 100mSec delay. A special character sequence to accomplish that would have been perfect. 

Link to comment

Hi Michel,

Thanks for the reply.  I am traveling on business. I can post the screenshot on Friday.

When I telnet to the R710's iDRAC, like using Putty, I do get the "login:  " prompt right away -- like instantaneous.  But, when I run the script in Network Resources, there is quiet a long time (5 seconds, because I have the timeout set to 5000) where I receive nothing at all, and in one blink, I get all the echoed text.

In fact, I could run a wireshark on the connection if that would help.  It'll have to wait until Friday.  Thanks again for the reply.

Thanks,

tom

Link to comment

Hi Tom,

 

Network resource is not a conversational framework, so, you will not get anything on the screen upon connection. You will only get something after everything has been done.

 

As such, your network resource should be:

your-userid\r\nyour-password (if it's required)\r\nthe-command\r\n

 

For instance,

Michel\r\nHelloWorld\r\nTurnOnX\r\n

 

With kind regards,

Michel

Link to comment

I like the idea of having a way to do delays in Network Resources, but suspect this project goes beyond what can be expected of Network Resources.

 

If you have a rPi or some other always-on unix-like computer, you could have an "expect" script that runs on that computer and which can handle the prompt-and-response interactiveness of your startup needs.

 

Then you can use a Network Resource to make a call out to the rPi to cause it to run that program.

Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...