Simple SSH Client

Questions and comments specific to a particular plugin should go here.
User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: Simple SSH Client

Post by Luca Brasi » Tue Jun 20, 2017 6:38 am

Thank you very much sem;colon!
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi

User avatar
zian
Site Admin
Posts: 576
Joined: Wed Jun 24, 2009 3:54 pm

Re: Simple SSH Client

Post by zian » Wed Apr 08, 2020 3:40 pm

I LOVE this plugin!!!
And I have a question. This might be more related to EG & Python scripting but how do I get "results" returned from the SSH commands sent and perhaps use them elsewhere in EventGhost? Like to show the results on screen or maybe do a whole other action task with it?

Attached is a screen shot of what comes back. I am interested in showing (and acting on) the region/location info seen in image. I did drag the one dragable event/result to my EG tree but it gets very truncated only showing "SSH.Data.Vyp" as the result. But I want more. ;)

Thanks for any help,hints,links,answers.
Screenshot_20200408-111410.jpg
eventghost.net
Be there or be square.

User avatar
Sem;colon
Plugin Developer
Posts: 788
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Simple SSH Client

Post by Sem;colon » Wed Apr 08, 2020 6:57 pm

Hi zian,
thanks mate, I'm happy you like it! :)

Yep, that's more a general thing; what you're looking for is the command

Code: Select all

eg.event.payload
If you put this in an execute python script action that is triggered by this data event you get as response you'll be able to work with the data that is returned.

In this case the data type is an array that holds the lines of the response.
The data you're interested in has the index 4 and 5.
So

Code: Select all

eg.event.payload[4]
and

Code: Select all

eg.event.payload[5]
.
You can use the print command to see what you have, for example:

Code: Select all

print eg.event.payload[4]
You'll see it's still a little more than you want, but I guess with some string operations you'll be able to figure out how to extract the information you want from here ;)
To get something as result of the script action, simply use return

Code: Select all

return eg.event.payload[4]
If you like my work, Image me a drink :wink:

User avatar
zian
Site Admin
Posts: 576
Joined: Wed Jun 24, 2009 3:54 pm

Re: Simple SSH Client

Post by zian » Thu Apr 09, 2020 12:54 am

Thanks for all that Sem,
Unfortunately I have zero clue what to do with those tags or that information. Gonna search the forums more now. Do some python script learnin' too maybe.
eventghost.net
Be there or be square.

Post Reply