hi thanks for reply

my net-snmp virsion is 5.4.3. i start it as a sudo service snmpd start (restart 
or stop). when service snmpd status command execute show that 

* snmpd is running 

* snmptrapd is running
i am not manually starting snmptrapd, when snmpd started snmptrapd also start.
on execute Mytrapefile.pl from commandline following output:
-bash: /usr/local/bin/Mytrapfile.pl: Permission denied
Mytrapfile code:
#!/usr/bin/perl
# A simple trap handler
my $TRAP_FILE = "/var/log/snmptrapd.log";    

my $host = <STDIN>;    # Read the Hostname - First line of input from STDIN
 chomp($host);
my $ip = <STDIN>;    # Read the IP - Second line of input
 chomp($ip);

while(<STDIN>) {
        chomp($_);
        push(@vars,$_);
}

open(TRAPFILE, ">> $TRAP_FILE");
$date = `date`;
chomp($date);
print(TRAPFILE "New trap received: $date for $OID\n\nHOST: $host\nIP: $ip\n");
foreach(@vars) {
        print(TRAPFILE "TRAP: $_\n");
}
print(TRAPFILE "\n----------\n");
close(TRAPFILE);#!/usr/bin/perl
# A simple trap handler
my $TRAP_FILE = "/var/log/snmptrapd.log";    

my $host = <STDIN>;    # Read the Hostname - First line of input from STDIN
 chomp($host);
my $ip = <STDIN>;    # Read the IP - Second line of input
 chomp($ip);

while(<STDIN>) {
        chomp($_);
        push(@vars,$_);
}

open(TRAPFILE, ">> $TRAP_FILE");
$date = `date`;
chomp($date);
print(TRAPFILE "New trap received: $date for $OID\n\nHOST: $host\nIP: $ip\n");
foreach(@vars) {
        print(TRAPFILE "TRAP: $_\n");
}
print(TRAPFILE "\n----------\n");
close(TRAPFILE);

read-write permission for this file is jbpandit as a user and not as a root 
user.
on restart snmpd got 2 err related to snmptrapd.conf file
Unknown logging option passed to -L: ".

Unknown output option passed to -O: -
*snmpd is running.
*snmptrapd is not running.

what wrong here?  help please.....jbpandit

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to