<?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: Configure NET-SNMP (Windows) for Splunk to send traps to NMS in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51711#M9924</link>
    <description>&lt;P&gt;Ok, I found a useful debugging link -&amp;gt; &lt;A href="http://wiki.splunk.com/Community:TroubleshootingAlertScripts"&gt;http://wiki.splunk.com/Community:TroubleshootingAlertScripts&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Which helped me create a batch (Windows) script that really worked. &lt;/P&gt;

&lt;P&gt;Here it is.  Maybe it will help the next person. &lt;BR /&gt;
Change content to meet your specific needs.&lt;BR /&gt;
Uncomment the echo lines for debug. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@echo off

:echo ---------------------------------------- &amp;gt;&amp;gt; "n:\temp\test_output.txt"
:echo %0, %1, %2, %3, %4, %5, %6, %7, %8 &amp;gt;&amp;gt; "n:\temp\test_output.txt" 
:date /T &amp;gt;&amp;gt; "n:\temp\test_output.txt"
:time /t &amp;gt;&amp;gt; "n:\temp\test_output.txt"

set SNMPAGENTHOST=10.2.192.32
set SNMPAGENTPORT=162
set TRAPOID=1.3.6.1.4.1.27389.1.2
set OID=1.3.6.1.4.1.27389.1.1
set SNMPCOMMUNITY=public
set SNMPTRAPCMD=C:\Net-SNMP\bin\snmptrap.exe
for /f "usebackq" %%h in (`hostname`) do @set myhost=%%h
set num=%~1
set num=%num:'=%
set terms=%2
set query=%3
set sname=%4
set reason=%5
set permalink=%6
set tags=%7
set resultspath=%8

:echo %SNMPTRAPCMD% -v 2c -c %SNMPCOMMUNITY% %SNMPAGENTHOST%:%SNMPAGENTPORT% '' %TRAPOID% %OID%.1 i %num%  %OID%.2 s %terms%  %OID%.3 s %query%  %OID%.4 s %sname%  %OID%.5 s %reason% %OID%.6 s %permalink% %OID%.7 s %tags% %OID%.8 s %resultspath% &amp;gt;&amp;gt; "n:\temp\test_output.txt"

%SNMPTRAPCMD% -v 2c -c %SNMPCOMMUNITY% %SNMPAGENTHOST%:%SNMPAGENTPORT% '' %TRAPOID% %OID%.1 i %num%  %OID%.2 s %terms%  %OID%.3 s %query%  %OID%.4 s %sname%  %OID%.5 s %reason% %OID%.6 s %permalink% %OID%.7 s %tags% %OID%.8 s %resultspath%

:echo error level returned from command is %errorlevel% &amp;gt;&amp;gt; "n:\temp\test_output.txt"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 05 Apr 2013 14:10:02 GMT</pubDate>
    <dc:creator>wsnyder2</dc:creator>
    <dc:date>2013-04-05T14:10:02Z</dc:date>
    <item>
      <title>Configure NET-SNMP (Windows) for Splunk to send traps to NMS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51709#M9922</link>
      <description>&lt;P&gt;I am having a heck of a time understanding NET-SNMP configuration and am hoping that has successful done this for windows can assist me. Please do not post links to NET-SNMP tutorials etc as I have been through ALL of them and I am still having issues.&lt;/P&gt;

&lt;P&gt;Really all I need to figure out is how change the port on the NET-SNMP and NET-SNMPtrap service to use ports 1161 and 1162. I have tried snmpconf -i and did not have much luck.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 15:14:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51709#M9922</guid>
      <dc:creator>mship</dc:creator>
      <dc:date>2013-03-05T15:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Configure NET-SNMP (Windows) for Splunk to send traps to NMS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51710#M9923</link>
      <description>&lt;P&gt;I do not have the answer but a similar problem.  &lt;/P&gt;

&lt;P&gt;We are trying to get alerts from Splunk to generate snmp traps which we want to set to another vendor's snmp server.   We have tried both batch and perl scripts at &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.2/Admin/SendSNMPtrapstoothersystems"&gt;link text&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But no luck.  We have been able to get splunk alerts to run echo.bat but not script that send snmp traps.   Very frustrating. &lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 20:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51710#M9923</guid>
      <dc:creator>wsnyder2</dc:creator>
      <dc:date>2013-04-03T20:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Configure NET-SNMP (Windows) for Splunk to send traps to NMS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51711#M9924</link>
      <description>&lt;P&gt;Ok, I found a useful debugging link -&amp;gt; &lt;A href="http://wiki.splunk.com/Community:TroubleshootingAlertScripts"&gt;http://wiki.splunk.com/Community:TroubleshootingAlertScripts&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Which helped me create a batch (Windows) script that really worked. &lt;/P&gt;

&lt;P&gt;Here it is.  Maybe it will help the next person. &lt;BR /&gt;
Change content to meet your specific needs.&lt;BR /&gt;
Uncomment the echo lines for debug. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@echo off

:echo ---------------------------------------- &amp;gt;&amp;gt; "n:\temp\test_output.txt"
:echo %0, %1, %2, %3, %4, %5, %6, %7, %8 &amp;gt;&amp;gt; "n:\temp\test_output.txt" 
:date /T &amp;gt;&amp;gt; "n:\temp\test_output.txt"
:time /t &amp;gt;&amp;gt; "n:\temp\test_output.txt"

set SNMPAGENTHOST=10.2.192.32
set SNMPAGENTPORT=162
set TRAPOID=1.3.6.1.4.1.27389.1.2
set OID=1.3.6.1.4.1.27389.1.1
set SNMPCOMMUNITY=public
set SNMPTRAPCMD=C:\Net-SNMP\bin\snmptrap.exe
for /f "usebackq" %%h in (`hostname`) do @set myhost=%%h
set num=%~1
set num=%num:'=%
set terms=%2
set query=%3
set sname=%4
set reason=%5
set permalink=%6
set tags=%7
set resultspath=%8

:echo %SNMPTRAPCMD% -v 2c -c %SNMPCOMMUNITY% %SNMPAGENTHOST%:%SNMPAGENTPORT% '' %TRAPOID% %OID%.1 i %num%  %OID%.2 s %terms%  %OID%.3 s %query%  %OID%.4 s %sname%  %OID%.5 s %reason% %OID%.6 s %permalink% %OID%.7 s %tags% %OID%.8 s %resultspath% &amp;gt;&amp;gt; "n:\temp\test_output.txt"

%SNMPTRAPCMD% -v 2c -c %SNMPCOMMUNITY% %SNMPAGENTHOST%:%SNMPAGENTPORT% '' %TRAPOID% %OID%.1 i %num%  %OID%.2 s %terms%  %OID%.3 s %query%  %OID%.4 s %sname%  %OID%.5 s %reason% %OID%.6 s %permalink% %OID%.7 s %tags% %OID%.8 s %resultspath%

:echo error level returned from command is %errorlevel% &amp;gt;&amp;gt; "n:\temp\test_output.txt"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Apr 2013 14:10:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51711#M9924</guid>
      <dc:creator>wsnyder2</dc:creator>
      <dc:date>2013-04-05T14:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Configure NET-SNMP (Windows) for Splunk to send traps to NMS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51712#M9925</link>
      <description>&lt;P&gt;Dear wsnyder.&lt;/P&gt;

&lt;P&gt;I see that the backslashes are missing. In some cases I could figure out which ones but could you send me a pm with the original script? Would be nice, &lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2013 14:27:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51712#M9925</guid>
      <dc:creator>jan_wohlers</dc:creator>
      <dc:date>2013-04-08T14:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Configure NET-SNMP (Windows) for Splunk to send traps to NMS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51713#M9926</link>
      <description>&lt;P&gt;Jan could you forward the original on to me once you receive it...Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2013 18:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Configure-NET-SNMP-Windows-for-Splunk-to-send-traps-to-NMS/m-p/51713#M9926</guid>
      <dc:creator>mship</dc:creator>
      <dc:date>2013-04-10T18:41:51Z</dc:date>
    </item>
  </channel>
</rss>

