# SNMPSET doesn't work what is wrong

**URL:** <https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017>\
**Category:** General\
**Created:** [18 September 2020 06:25 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017 "2020-09-18T06:25:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![calberts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calberts/32/34312_2.png) [@calberts](https://discourse.nodered.org/u/calberts)\
**Post date:** [18 September 2020 06:25 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/1 "2020-09-18T06:25:13Z")

</div>

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

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![calberts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calberts/32/34312_2.png) [@calberts](https://discourse.nodered.org/u/calberts)\
**Post date:** [18 September 2020 07:11 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/2 "2020-09-18T07:11:09Z")

</div>

I did manage to get it working, below the code

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [18 September 2020 07:27 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/3 "2020-09-18T07:27:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![calberts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/calberts/32/34312_2.png) [@calberts](https://discourse.nodered.org/u/calberts)\
**Post date:** [18 September 2020 08:14 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/4 "2020-09-18T08:14:14Z")

</div>

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 😉 There for i change the subject with (solved)

Chris

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [18 September 2020 08:44 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/5 "2020-09-18T08:44:08Z")

</div>

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. 🙂

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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 September 2020 09:08 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/6 "2020-09-18T09:08:34Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1e24dc84ba88201d7837e61f46993e3210e9d84a.png)

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [18 September 2020 12:16 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/7 "2020-09-18T12:16:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [18 September 2020 13:37 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/8 "2020-09-18T13:37:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 October 2020 13:37 UTC](https://discourse.nodered.org/t/snmpset-doesnt-work-what-is-wrong/33017/9 "2020-10-02T13:37:53Z")

</div>

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