# Trap receiver to digital output

**URL:** <https://discourse.nodered.org/t/trap-receiver-to-digital-output/70506>\
**Category:** General\
**Created:** [12 November 2022 18:54 UTC](https://discourse.nodered.org/t/trap-receiver-to-digital-output/70506 "2022-11-12T18:54:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabi](https://avatars.discourse-cdn.com/v4/letter/g/f07891/32.png) [@Gabi](https://discourse.nodered.org/u/Gabi)\
**Post date:** [12 November 2022 18:54 UTC](https://discourse.nodered.org/t/trap-receiver-to-digital-output/70506/1 "2022-11-12T18:54:10Z")

</div>

Hi everyone,

I need to trigger 2 digital outputs by SNMP traps, so seems like node-red is the best solution  
The main issue is that I cannot handle what oid to send, so I need to use function or switch in order to select conditions of oid values

I see a lot of examples but nothing regarding node-red-contrib-snmp-trap-listener.....  
any hint is welcome

- "1.3.6.1.4.1.5528.100.11.12" with integer X = initially is always 0 and after, \>0 and represent time when alarm ended
- "1.3.6.1.4.1.5528.100.11.13" with integer 1 or 3 = 1 for warning / 3 for critical

> Digital output 1  
> ON  
> -If message contain oid: "1.3.6.1.4.1.5528.100.11.12" with integer 0 and oid:"1.3.6.1.4.1.5528.100.11.13" with integer 1 then Digital output 1 on

OFF

- If message contain oid: "1.3.6.1.4.1.5528.100.11.12" with integer \>0 and oid: 1.3.6.1.4.1.5528.100.11.13" with integer 1 then Digital output 1 off

> Digital output 2  
> ON  
> -If message contain oid: "1.3.6.1.4.1.5528.100.11.12" with integer 0 and oid: "1.3.6.1.4.1.5528.100.11.13" with integer 3 then Digital output 2 on

OFF  
-If message contain oid: "1.3.6.1.4.1.5528.100.11.12" with integer \>0 and oid: "1.3.6.1.4.1.5528.100.11.13" with integer 3

also optional if DO 2 is on then DO 1 must remain off even the conditions match to switch on

thanks

---

<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:** [11 January 2023 18:54 UTC](https://discourse.nodered.org/t/trap-receiver-to-digital-output/70506/2 "2023-01-11T18:54:42Z")

</div>

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