Node-red-node-snmp dynamic host?

I'm trying to find documentation on how to dynamically set the 'Host' parameter of the SNMP node.

Use case:
Http://server:1880/ip? >>> SNMP host <>

Screen Shot 2020-04-10 at 4.11.22 PM

I think if you leave it blank in the node then can be used to set it.

Leaving the SNMP node's host parameter empty returns:
"TypeError: Cannot read property 'indexOf' of undefined"

Using Set msg.payload to has also been unsuccessful.

Ok - will have a look over the weekend

If it helps..., I have the node-red-node-snmp (0.0.24) installed.

Also as a test I've tied Injecting {"host":""} directly into the SNMP node with no luck.

it needs to be node

The SNMP Node does not seem to be unwrapping the variable in the host field BEFORE triggering the SNMP call.

I have also tried {{}} as outlined here without any luck...

The Template and HTTP out page load as expected...

I have also been looking at using a sub-flow with an environmental variable.... so far without luck.

The top screenshot still shows it must be - you need a change node after the inject to move it.


When I had initially worked with the change node, it failed. I now see that it was because the default 'Set' was not changing the payload as expected. Swapping 'Set' to 'Move' resolved the issue. With additional tinkering I found hat 'Set' could be made to work, however the fields have to be flipped when using 'Set'.

Change > Move: To:
Change > Set: To:


Screen Shot 2020-04-14 at 11.05.46 AM

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.