<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Ingesting dummy SNMP traps  into Dynatrace in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/220573#M6201</link>
    <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/2080"&gt;@AK&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If you have Linux, most certainly python is preinstalled. If you have Windows, you would have to install it.&lt;/P&gt;&lt;P&gt;I tried this on an out of the box Linux machine, and it did not work immediately. So here's what you need to do:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Since you shouldn't have the pysnmp module, you have to install it:&lt;BR /&gt;pip3 install pysnmp&lt;/LI&gt;&lt;LI&gt;Copy the code below to traps.py. I have replaced the OID from a name to a straight OID, because you would have to install additional snmp libraries. You can use whatever OID you want.&lt;/LI&gt;&lt;LI&gt;Replace 192.168.1.232 in the code to&amp;nbsp; your AG's IP address&lt;/LI&gt;&lt;LI&gt;Execute it with&lt;BR /&gt;python3 traps.py&lt;/LI&gt;&lt;LI&gt;If you want to confirm that it's getting out, run the following command in another shell. It should show you the traps getting out.&lt;BR /&gt;tcpdump -n udp port 162&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;from pysnmp.hlapi import *

receiver_ip = '192.168.1.232'
trap_oid = '1.3.6.1.4.1.12345.1.0'

errorIndication, errorStatus, errorIndex, varBinds = next(
    sendNotification(
        SnmpEngine(),
        CommunityData('public', mpModel=0),
        UdpTransportTarget((receiver_ip, 162)),
        ContextData(),
        'trap',
        NotificationType(ObjectIdentity(trap_oid)),
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2023 09:15:53 GMT</pubDate>
    <dc:creator>AntonioSousa</dc:creator>
    <dc:date>2023-08-14T09:15:53Z</dc:date>
    <item>
      <title>Ingesting dummy SNMP traps  into Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/219873#M6198</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;
&lt;P&gt;We have recently added SNMP extension to the monitoring and during testing we received some traps.&lt;/P&gt;
&lt;P&gt;Now, we wanted to test it again however, it would be difficult for SNMP team to send the traps again just for testing.&lt;/P&gt;
&lt;P&gt;Hence I'm looking out a way to send to traps via Dynatrace API.&lt;/P&gt;
&lt;P&gt;Has anyone successfully ingested a SNMP traps to Dynatrace. Can someone please suggest.&lt;/P&gt;
&lt;P&gt;This is how trap looks when sent to Dynatrace,&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AK_0-1691162237211.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13387i41C14A8C6F21BF57/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AK_0-1691162237211.png" alt="AK_0-1691162237211.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;AK&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 10:45:42 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/219873#M6198</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2025-04-01T10:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Ingesting dummy SNMP traps  into Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/220075#M6199</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/2080"&gt;@AK&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have a client where we have managed to ingest more than 10K traps per minute. And it works pretty well.&lt;/P&gt;&lt;P&gt;If you want to inject traps into Dynatrace, I would suggest using pysnmp. Something like the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from pysnmp.hlapi import *

errorIndication, errorStatus, errorIndex, varBinds = next(
    sendNotification(
        SnmpEngine(),
        CommunityData('public', mpModel=1),
        UdpTransportTarget(('receiver_ip', 162)),
        ContextData(),
        'trap',
        NotificationType(ObjectIdentity('SNMPv2-MIB', 'linkDown')),
        ('1.3.6.1.2.1.2.2.1.2.1', OctetString('Interface eth0 is down')),
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Aug 2023 23:01:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/220075#M6199</guid>
      <dc:creator>AntonioSousa</dc:creator>
      <dc:date>2023-08-07T23:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ingesting dummy SNMP traps  into Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/220564#M6200</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/17213"&gt;@AntonioSousa&lt;/a&gt;, thank you for the response.&lt;/P&gt;&lt;P&gt;What prep work I need do to post it? like, anything I need to install on my local system (e.g.-python)?&lt;/P&gt;&lt;P&gt;I never did anything like this before.&lt;/P&gt;&lt;P&gt;I was successfully able to post dummy log via &lt;A href="https://www.dynatrace.com/support/help/shortlink/api-log-monitoring-v2-post-ingest#request-body-json-model" target="_self"&gt;log monitoring API&lt;/A&gt;&amp;nbsp;with the static content however, "Device Statistics" graphs are not populating, see the screengrab below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AK_1-1691998966775.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13564iE736C89941AADAAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AK_1-1691998966775.png" alt="AK_1-1691998966775.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I just wanted to post it one time for testing, this is my use case.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 07:44:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/220564#M6200</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2023-08-14T07:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Ingesting dummy SNMP traps  into Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/220573#M6201</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/2080"&gt;@AK&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If you have Linux, most certainly python is preinstalled. If you have Windows, you would have to install it.&lt;/P&gt;&lt;P&gt;I tried this on an out of the box Linux machine, and it did not work immediately. So here's what you need to do:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Since you shouldn't have the pysnmp module, you have to install it:&lt;BR /&gt;pip3 install pysnmp&lt;/LI&gt;&lt;LI&gt;Copy the code below to traps.py. I have replaced the OID from a name to a straight OID, because you would have to install additional snmp libraries. You can use whatever OID you want.&lt;/LI&gt;&lt;LI&gt;Replace 192.168.1.232 in the code to&amp;nbsp; your AG's IP address&lt;/LI&gt;&lt;LI&gt;Execute it with&lt;BR /&gt;python3 traps.py&lt;/LI&gt;&lt;LI&gt;If you want to confirm that it's getting out, run the following command in another shell. It should show you the traps getting out.&lt;BR /&gt;tcpdump -n udp port 162&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="markup"&gt;from pysnmp.hlapi import *

receiver_ip = '192.168.1.232'
trap_oid = '1.3.6.1.4.1.12345.1.0'

errorIndication, errorStatus, errorIndex, varBinds = next(
    sendNotification(
        SnmpEngine(),
        CommunityData('public', mpModel=0),
        UdpTransportTarget((receiver_ip, 162)),
        ContextData(),
        'trap',
        NotificationType(ObjectIdentity(trap_oid)),
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 09:15:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Ingesting-dummy-SNMP-traps-into-Dynatrace/m-p/220573#M6201</guid>
      <dc:creator>AntonioSousa</dc:creator>
      <dc:date>2023-08-14T09:15:53Z</dc:date>
    </item>
  </channel>
</rss>

