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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |