node-red exec node not dumping output

85 views
Skip to first unread message

Vijay Anand

unread,
Aug 28, 2016, 1:42:02 PM8/28/16
to Node-RED

Hi,

 i have an inject node (with string payload selected but no content ) + exec node (netstat -a command) + debug node.

i am using the node 'exec' to execute commands on the shell (like netstat -a etc) and am not seeing any output in the debug node . msg.payload shows as string[0].

Any suggestions

regards

vijay

Julian Knight

unread,
Aug 28, 2016, 5:01:35 PM8/28/16
to Node-RED
Can you post the flow?

Dave C-J

unread,
Aug 28, 2016, 5:55:39 PM8/28/16
to node...@googlegroups.com
should just work

[{"id":"d506635e.7f1da","type":"inject","z":"896b28a8.437658","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":115,"y":1463,"wires":[["c637418c.0073d"]]},{"id":"c637418c.0073d","type":"exec","z":"896b28a8.437658","command":"netstat -a","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":285.5,"y":1471.5,"wires":[["80cb8ee4.94848"],[],[]]},{"id":"80cb8ee4.94848","type":"debug","z":"896b28a8.437658","name":"","active":true,"console":"false","complete":"payload","x":487,"y":1458,"wires":[]}]

Vijay Anand

unread,
Aug 29, 2016, 12:02:36 AM8/29/16
to Node-RED
Here it is. Thx

[{"id":"622bd4ab.14a00c","type":"inject","z":"a84295c9.47446","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":88.5,"y":98,"wires":[["6dc992d1.61e0ac"]]},{"id":"6dc992d1.61e0ac","type":"exec","z":"a84295c9.47446","command":"netstat -a","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":308.5,"y":108.5,"wires":[[],["a11dcb12.77ce28"],[]]},{"id":"a11dcb12.77ce28","type":"debug","z":"a84295c9.47446","name":"","active":true,"console":"false","complete":"payload","x":536.5,"y":122,"wires":[]}]


regards
vijay

Vijay Anand

unread,
Aug 29, 2016, 12:06:07 AM8/29/16
to Node-RED
Dave,
 Thanks . Your spec worked.
but i am not able to understand why my node specification doesn't work. Apart from the Ids, all other parameters look same. 

My original spec:
[{"id":"622bd4ab.14a00c","type":"inject","z":"a84295c9.47446","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":88.5,"y":98,"wires":[["6dc992d1.61e0ac"]]},{"id":"6dc992d1.61e0ac","type":"exec","z":"a84295c9.47446","command":"netstat -a","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":308.5,"y":108.5,"wires":[[],["a11dcb12.77ce28"],[]]},{"id":"a11dcb12.77ce28","type":"debug","z":"a84295c9.47446","name":"","active":true,"console":"false","complete":"payload","x":536.5,"y":122,"wires":[]}]

regards
vijay

Vijay Anand

unread,
Aug 29, 2016, 12:21:39 AM8/29/16
to Node-RED
found out the mistake i made. i was not connecting the std0 of the exec node to the debug node ( was using the second wire from exec node's output).

Thanks Everyone.

regards
vijay
Reply all
Reply to author
Forward
0 new messages