Hi, I am trying to configure SNMP trap forwarding on a system but when I run the test trap it keeps giving my a warning. Here is the command and its usage:

root@LEVLNSCS001 nasadmin# /nas/sbin/nas_snmptrap /nas/site/trap.cfg -m /nays/emccelerra.mib -r 1 -f 64 -i 5 -s 7 -d "test SNMP traps"
Use of uninitialized value in string eq at /nas/sbin/nas_snmptrap line 120, <SNMP> line 6.
root@LEVLNSCS001 nasadmin# /nas/sbin/nas_snmptrap unable to read configuration file.
usage: snmptrap config_file_path -m mib_file_path -r reason code -f facility eventid -s severity -d description

line 120 in nas_snmptrap starts with $token3

# Parse trap configuration lines, and send traps. Bad formats silently + ignored. $error = 0; open(SNMP, $naspath); while (<SNMP>) { my @token = split; if ($token[0] eq 'snmpmanager' && $token[2] eq ';' && $token[3] eq 'communityname') { if(snmptrap($token[1], $token[4])) { print STDERR ("error in sending out snmp pdu\n +"); $error = 1; } } } close(SNMP);


I'm not sure what the <SNMP> is referring to.

Contents of /nas/site/trap.cfg

#snmp trap configuration file
#example:
#snmpmanager 128.154.11.20 ; communityname public
#snmpmanager host1 ; communityname public
snmpmanager 10.52.37.99 ; communityname public

So anyways, I'm stuck. Anyone have ideas? Thank you.


In reply to Need help with SNMP script by Xandrex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.