SNMPSET doesn't work what is wrong

I like to use snmp set to set power outlets of een CDU

on the command line, it's simple and looks like this

snmpset -v 2c -c private 192.168.178.28 1.3.6.1.4.1.1718.3.2.3.1.11.1.1.3 integer 3

when the integer is 1 it's on and 2 off and 3 reboot

below the code what is wrong, Any hints or Tips

Thanks in advance

[{"id":"af2e61d9.1fc688","type":"ui_switch","z":"f044f5fa.7a402","name":"CDU outlet 3","label":"switch","tooltip":"","group":"a7cfab0d.5f836","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":180,"y":120,"wires":[["bdbc8651.2f4e48","7c7551ee.1e28c"]]},{"id":"d2e7ef59.88cef","type":"snmp set","z":"f044f5fa.7a402","host":"192.168.178.28","community":"private","version":"2c","varbinds":"msg.varbinds = [\n        {\n            \"oid\": \"1.3.6.1.4.1.1718.3.2.3.1.11.1.1.3\",\n            \"type\": \"integer\",\n            \"value\": \"2\"\n        }\n];","timeout":5,"name":"outlet on","x":540,"y":80,"wires":[]},{"id":"df3c5059.761198","type":"snmp set","z":"f044f5fa.7a402","host":"192.168.178.28","community":"public","version":"2c","varbinds":"msg.varbinds = [\n        {\n            \"oid\": \"1.3.6.1.4.1.1718.3.2.3.1.11.1.1.3\",\n            \"type\": \"integer\",\n            \"value\": \"1\"\n        }\n];","timeout":5,"name":"Outlet Off","x":740,"y":140,"wires":[]},{"id":"bdbc8651.2f4e48","type":"switch","z":"f044f5fa.7a402","name":"If 1","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":80,"wires":[["d2e7ef59.88cef"]]},{"id":"7c7551ee.1e28c","type":"switch","z":"f044f5fa.7a402","name":"if 0","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":140,"wires":[["c80f1301.cfaba"]]},{"id":"c80f1301.cfaba","type":"change","z":"f044f5fa.7a402","name":"set to 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":140,"wires":[["df3c5059.761198"]]},{"id":"a7cfab0d.5f836","type":"ui_group","z":"","name":"Default","tab":"f4f3f5b4.649508","disp":true,"width":"6","collapse":false},{"id":"f4f3f5b4.649508","type":"ui_tab","z":"","name":"DeSterrenWacht","icon":"dashboard","disabled":false,"hidden":false}]

I did manage to get it working, below the code

[{"id":"af2e61d9.1fc688","type":"ui_switch","z":"f044f5fa.7a402","name":"CDU outlet 3","label":"switch","tooltip":"","group":"a7cfab0d.5f836","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":180,"y":120,"wires":[["bdbc8651.2f4e48","7c7551ee.1e28c"]]},{"id":"d2e7ef59.88cef","type":"snmp set","z":"f044f5fa.7a402","host":"192.168.178.28","community":"private","version":"2c","varbinds":"[{\"oid\": \"1.3.6.1.4.1.1718.3.2.3.1.11.1.1.1\",\n  \"type\": \"Integer\",\n   \"value\": 2}]\n","timeout":5,"name":"outlet on","x":540,"y":80,"wires":[]},{"id":"df3c5059.761198","type":"snmp set","z":"f044f5fa.7a402","host":"192.168.178.28","community":"private","version":"2c","varbinds":"[{\"oid\": \"1.3.6.1.4.1.1718.3.2.3.1.11.1.1.1\",\n  \"type\": \"Integer\",\n   \"value\": 1}]\n","timeout":5,"name":"Outlet Off","x":700,"y":140,"wires":[]},{"id":"bdbc8651.2f4e48","type":"switch","z":"f044f5fa.7a402","name":"If 1","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":80,"wires":[["d2e7ef59.88cef"]]},{"id":"7c7551ee.1e28c","type":"switch","z":"f044f5fa.7a402","name":"if 0","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":140,"wires":[["c80f1301.cfaba"]]},{"id":"c80f1301.cfaba","type":"change","z":"f044f5fa.7a402","name":"set to 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":140,"wires":[["df3c5059.761198"]]},{"id":"a7cfab0d.5f836","type":"ui_group","z":"","name":"Default","tab":"f4f3f5b4.649508","disp":true,"width":"6","collapse":false},{"id":"f4f3f5b4.649508","type":"ui_tab","z":"","name":"DeSterrenWacht","icon":"dashboard","disabled":false,"hidden":false}]

Thanks for the update. Was this about some contrib node or running the command using a exec node?

P.S. If you mark your own post as the solution, then other forum members can skip reading as they know the problem is already solved.

Hoi

its about the snmpset node and it was al how to definne the msg.variable with in this node

Good idea how can my post as soloution i don't know that, to new here :wink: There for i change the subject with (solved)

Chris

To be honest, neither do I. I've only created 3 topics and they're all locked now. It might as well be the moderators who do that. Someone please clarify. :slightly_smiling_face:

Edit: now I see this as solved, did you figure it out or did someone else do it? :joy:

Topics now self-lock after a period. You can see the period at the bottom of the topic. Some topics do get manually closed. Usually because someone has added to a topic long after the last post or has posted something that should be a new topic. Moderators can also extend the closure.

image

That I know, I was asking about the "solved" feature as I never remember seeing such a button.

The person who starts a thread can mark any post in the thread as the solution. If you click on the wrench icon, you will see that option. Checking it starts the 14 day lock timer

1 Like

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