<?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: Splunk Alerts / SNMP in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48488#M9198</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;did you find the problem? I have the same problem on my machine &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Can't fix the Bad value Name error.&lt;/P&gt;

&lt;P&gt;Br Jan&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2013 14:22:31 GMT</pubDate>
    <dc:creator>jan_wohlers</dc:creator>
    <dc:date>2013-03-28T14:22:31Z</dc:date>
    <item>
      <title>Splunk Alerts / SNMP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48485#M9195</link>
      <description>&lt;P&gt;I've setup a search, and configured Splunk to run a Perl script generating an SNMP message to another system when the script is run.  The code for the Perl script follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/usr/bin/perl
#
$hostPortSNMP = "10.176.156.206:162"; 
# Host:Port of snmpd or other SNMP trap handler
$snmpTrapCmd = "/usr/bin/snmptrap"; 
# Path to snmptrap, from &lt;A href="http://www.net-snmp.org" target="test_blank"&gt;http://www.net-snmp.org&lt;/A&gt;
$TRAPOID = "1.3.6.1.4.1.27389.1.2"; 
# Object IDentifier for traps/notifications 
$OID = "1.3.6.1.4.1.27389.1.1";
# Object IDentifier for objects, Splunk Enterprise OID is 27389

$searchCount = $ARGV[0]; # $1 - Number of events returned
$searchTerms = $ARGV[1]; # $2 - Search terms
$searchQuery = $ARGV[2]; # $3 - Fully qualified query string

$searchName = $ARGV[3]; # $4 - Name of saved search
$searchReason = $ARGV[4]; # $5 - Reason saved search triggered
$searchURL = $ARGV[5]; # $6 - URL/Permalink of saved search

$searchTags = $ARGV[6]; # $7 - Always empty as of 4.1
$searchPath = $ARGV[7]; # $8 - Path to raw saved results in Splunk instance (advanced)
$cmd = qq/$snmpTrapCmd -v 2c -c public $hostPortSNMP '' $TRAPOID 

$OID.1 i $searchCount $OID.2 s "$searchTerms" $OID.3 s "$searchQuery" $OID.4 s 
"$searchName" $OID.5 s "$searchReason" $OID.6 s "$searchURL" $OID.7 s 
"$searchTags" $OID.8 s "$searchPath"/;
 system($cmd);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I run the script at the command line I get the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@splunk scripts]# ./sendsnmptrap-a.pl
sh: line 1: 1.3.6.1.4.1.27389.1.1.1: command not found
sh: line 2: : command not found
sh: line 3: : command not found
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I doubt this is the accurate result.  What is wrong with the script?  Does it require parameters that I'm missing?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 14:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48485#M9195</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-01-11T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alerts / SNMP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48486#M9196</link>
      <description>&lt;P&gt;While you might get some perly type people pop on and be able to offer some help this is a very specific perl related problem.&lt;/P&gt;

&lt;P&gt;You will likely get a very quick answer if you post this on &lt;A href="http://stackoverflow.com/"&gt;http://stackoverflow.com/&lt;/A&gt; as they are a site designed for questions just like this.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 14:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48486#M9196</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2012-01-11T14:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alerts / SNMP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48487#M9197</link>
      <description>&lt;P&gt;The three lines at the bottom needed to be combined.  The semi colon gave it away.  Perl ends every line with a ; character.  Now the Perl part is fixed, however I don't believe it is generating the expected SNMP output.&lt;/P&gt;

&lt;P&gt;[root@splunk scripts]# ./sendsnmptrap.pl&lt;/P&gt;

&lt;P&gt;10.176.156.206:1621.3.6.1.4.1.27389.1.1.1: Bad value name (1.3.6.1.4.1.27389.1.1.2)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2012 14:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48487#M9197</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-01-11T14:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alerts / SNMP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48488#M9198</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;did you find the problem? I have the same problem on my machine &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Can't fix the Bad value Name error.&lt;/P&gt;

&lt;P&gt;Br Jan&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 14:22:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48488#M9198</guid>
      <dc:creator>jan_wohlers</dc:creator>
      <dc:date>2013-03-28T14:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alerts / SNMP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48489#M9199</link>
      <description>&lt;P&gt;You may want to ensure that there are no embedded double quotes in the passed arguments from the splunk alert.  The searchQuery for instance may include an exact phrase to search which needs to be quoted.&lt;BR /&gt;
A little loop before the variables are set works for double quotes:&lt;BR /&gt;
&lt;EM&gt;foreach $entry ( @ARGV ) {&lt;BR /&gt;
  $entry =~ s/\"/\\"/g;&lt;BR /&gt;
}&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I started sending traps after this update.,&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2014 15:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48489#M9199</guid>
      <dc:creator>g2ugzm</dc:creator>
      <dc:date>2014-09-29T15:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alerts / SNMP</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48490#M9200</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Will this script let us see which version of SNMP is running?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 17:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Alerts-SNMP/m-p/48490#M9200</guid>
      <dc:creator>jrprez1804</dc:creator>
      <dc:date>2015-02-24T17:32:58Z</dc:date>
    </item>
  </channel>
</rss>

