Jacques44 / node-red-contrib-bigssh

remote command using ssh big node
Apache License 2.0
8 stars 12 forks source link

Feature Request (Follow on from #28) #29

Closed My-Random-Thoughts closed 2 years ago

My-Random-Thoughts commented 3 years ago

Can you supply the host name used in the output please.

I am wanting to loop though a list of host names to run a command and split on the output for each host. Thanks

Jacques44 commented 2 years ago

Hello, if I understand well, you've got an array of host you will loop on and call bigssh for each one? bigssh will give you its configuration on the control output, the 3rd one. You can try by connecting a debug node and display "msg.control.config.host"

My-Random-Thoughts commented 2 years ago

That is correct, I want to try and simplify the flow. I did connect separate debugs to all nodes and I am getting zero output from the third output. 1 and 2 are working OK, but not 3. I do have "complete msg object" selected.

I have v1.2.8 installed on NRv1.3.5

Jacques44 commented 2 years ago

sorry, control is the second Screen Shot 2021-07-18 at 22 45 46

My-Random-Thoughts commented 2 years ago

I am not getting the msg.control.config.host value:

{"_msgid":"51fc4976f26b0436","payload":1626641097461,"topic":"","control":{"config":{"id":"33d019367cc91ca9","type":"bigssh","name":"","commandLine":"uname -a","commandArgs":"","minError":1,"minWarning":1,"noStdin":true,"format":"utf8","payloadIsArg":false,"myssh":"e491f93d.13b1a8","checkpoint":100,"status_rate":1000,"control_rate":1000,"start_point_type":"filename"},"size":0,"records":0,"start":"2021-07-18T20:44:57.462Z","speed":0,"control":{"state":"standalone"},"state":"start","message":"running..."}}

Jacques44 commented 2 years ago

I set the host on its input Screen Shot 2021-07-18 at 22 47 55

My-Random-Thoughts commented 2 years ago

Maybe that is where I was going wrong, I have it pre-populated for testing! Sorry, it's working now. Thank you

Jacques44 commented 2 years ago

No problem. Maybe the node should send the whole embedded configuration on its output. By the way, tell me if this is not ok for you