<?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 Splunk sendsnmp.cmd not working properly in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-sendsnmp-cmd-not-working-properly/m-p/41070#M96705</link>
    <description>&lt;P&gt;I am using the following script in /bin/scripts on splunk to send snmp traps from my windows server to my NMS and it is not working with no errors. I am troublshooting by running it from the command prompt and what I am noticing is that it is running each set and command as a separate command in windows vice as one unified script. Below is the script from the windows wiki this is exactly what I am using except I put in correct IP's etc...&lt;/P&gt;

&lt;P&gt;setlocal&lt;/P&gt;

&lt;P&gt;set SNMPAGENTHOST=127.0.0.1&lt;BR /&gt;
set SNMPAGENTPORT=162&lt;BR /&gt;
set TRAPOID=1.3.6.1.4.1.27389.1.2&lt;BR /&gt;
set OID=1.3.6.1.4.1.27389.1.1&lt;BR /&gt;
set SNMPCOMMUNITY=public&lt;BR /&gt;
set SNMPTRAPCMD=C:\usr\bin\snmptrap.exe&lt;BR /&gt;
for /f "usebackq" %%h in (&lt;CODE&gt;hostname&lt;/CODE&gt;) do @set myhost=%%h&lt;BR /&gt;
set num=%~1&lt;BR /&gt;
set num=%num:'=%&lt;BR /&gt;
set terms=%2&lt;BR /&gt;
set query=%3&lt;BR /&gt;
set sname=%4&lt;BR /&gt;
set reason=%5&lt;BR /&gt;
set permalink=%6&lt;BR /&gt;
if "%8" == "" (&lt;BR /&gt;
    set resultspath=%7&lt;BR /&gt;
) else (&lt;BR /&gt;
    set tags=%7&lt;BR /&gt;
    set resultspath=%8&lt;BR /&gt;
)&lt;/P&gt;

&lt;P&gt;if "%8" == "" (&lt;BR /&gt;
    "%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%.8 s %resultspath%&lt;BR /&gt;
) ELSE (&lt;BR /&gt;
    "%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%.8 s %resultspath% %OID%.7 s %tags%&lt;BR /&gt;
)&lt;/P&gt;

&lt;P&gt;endlocal &lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2013 21:51:17 GMT</pubDate>
    <dc:creator>mship</dc:creator>
    <dc:date>2013-02-22T21:51:17Z</dc:date>
    <item>
      <title>Splunk sendsnmp.cmd not working properly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-sendsnmp-cmd-not-working-properly/m-p/41070#M96705</link>
      <description>&lt;P&gt;I am using the following script in /bin/scripts on splunk to send snmp traps from my windows server to my NMS and it is not working with no errors. I am troublshooting by running it from the command prompt and what I am noticing is that it is running each set and command as a separate command in windows vice as one unified script. Below is the script from the windows wiki this is exactly what I am using except I put in correct IP's etc...&lt;/P&gt;

&lt;P&gt;setlocal&lt;/P&gt;

&lt;P&gt;set SNMPAGENTHOST=127.0.0.1&lt;BR /&gt;
set SNMPAGENTPORT=162&lt;BR /&gt;
set TRAPOID=1.3.6.1.4.1.27389.1.2&lt;BR /&gt;
set OID=1.3.6.1.4.1.27389.1.1&lt;BR /&gt;
set SNMPCOMMUNITY=public&lt;BR /&gt;
set SNMPTRAPCMD=C:\usr\bin\snmptrap.exe&lt;BR /&gt;
for /f "usebackq" %%h in (&lt;CODE&gt;hostname&lt;/CODE&gt;) do @set myhost=%%h&lt;BR /&gt;
set num=%~1&lt;BR /&gt;
set num=%num:'=%&lt;BR /&gt;
set terms=%2&lt;BR /&gt;
set query=%3&lt;BR /&gt;
set sname=%4&lt;BR /&gt;
set reason=%5&lt;BR /&gt;
set permalink=%6&lt;BR /&gt;
if "%8" == "" (&lt;BR /&gt;
    set resultspath=%7&lt;BR /&gt;
) else (&lt;BR /&gt;
    set tags=%7&lt;BR /&gt;
    set resultspath=%8&lt;BR /&gt;
)&lt;/P&gt;

&lt;P&gt;if "%8" == "" (&lt;BR /&gt;
    "%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%.8 s %resultspath%&lt;BR /&gt;
) ELSE (&lt;BR /&gt;
    "%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%.8 s %resultspath% %OID%.7 s %tags%&lt;BR /&gt;
)&lt;/P&gt;

&lt;P&gt;endlocal &lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2013 21:51:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-sendsnmp-cmd-not-working-properly/m-p/41070#M96705</guid>
      <dc:creator>mship</dc:creator>
      <dc:date>2013-02-22T21:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk sendsnmp.cmd not working properly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-sendsnmp-cmd-not-working-properly/m-p/41071#M96706</link>
      <description>&lt;P&gt;Well seems you have to use NET-SNMP. I was trying to get it to work using C:\Windows\System32\snmptrap.exe Installed and configured NET-SNMP and now traps are going out.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Mar 2013 20:51:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-sendsnmp-cmd-not-working-properly/m-p/41071#M96706</guid>
      <dc:creator>mship</dc:creator>
      <dc:date>2013-03-03T20:51:34Z</dc:date>
    </item>
  </channel>
</rss>

