Hi all,

 

My name is Irving Barría, a panamanian student of electronics engineering, in charge of a project regarding net-snmp. I have installed net-SNMP 5.1.4 on a RHEL AS 3 system with kernel version 2.4.24 and I can generate traps and also receive them in the same machine through the loopback interface. As you can see, I’m just testing but there is a plan to use net-snmp in a production system. First of all, I would like to know how to log the traps that my machine receives. In my test I open a terminal and type the following:

 

      # snmptrapd -f –Lo

 

After this, I open another terminal and type:

 

            # snmptrap -v 1 -c public localhost "" "" 0 0  ""

 

As long as I understand, the first command starts the trap receiver while the later generates a ColdStart trap. In the terminal where snmptrapd is running I can see the receipt of the trap but I can’t figure out how to log them in some file of my preference.

 

=============================== One more question =======================================

 

Previously, I successfully tested traptoemail in a Windows machine. I just had to install ActiveState’s ActivePERL and everything worked fine. Now that I’m testing on Linux I’ve found some problems. What I would like to know is how to install Perl correctly. Here is what I typed during the installation:

 

# ./configure --with-perl-modules --enable-embedded-perl --enable-shared

# make

# make install

# cd perl

# perl Makefile.PL

# make

# make install

 

I don’t know why traptoemail (neither any other Perl script) does not work!  For testing, I wrote a very simple Perl program like this:

 

#!/usr/local/bin/perl

print "This is a test";

 

And modified my snmptrapd.conf (located at /usr/local/etc/snmp) as follows:

 

traphandle default usr/bin/perl /usr/local/bin/Hello

 

And ran my test again (forcing snmptrapd to use the recently created configuration file):

 

# snmptrapd -f –Lo –c /usr/local/etc/snmp/snmptrad.conf

 

And I can see the trap in the Terminal but no output from my Perl script.

I have to mention that I after a long time testing I ended up installing ActivePERL for Linux but nothing got better.

Could somebody help?

 

Thanks in advance for your time and attention.

 

Regards,

IB

Reply via email to