LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   snmptrapd log file (https://www.linuxquestions.org/questions/linux-software-2/snmptrapd-log-file-115854/)

aherrys 11-14-2003 01:50 AM

snmptrapd log file
 
Hi,

I am trying to run the snmptrapd to capture and log any traps sent to my machine.
When I run it using this command:
snmptrapd -o /home/herry/test.log

Everytime I sent the trap to my machine I get the following lline on the test.log file:
2003-11-13 14:53:21 ECServer [127.0.0.1] (via 127.0.0.1) TRAP, SNMP v1, community public UCD-SNMP-MIB::ucdExperimental.990 Enterprise Specific Trap (17) Uptime: 1:44:44.99

So the snmptrapd logs it fine, however when I try to format the log messages to something simpler and run the snmptrapd with the following command:
snmptrapd -o /home/herry/test.log -F "%02.2h:%02.2j"

I don't get nothing at all on my test.log file.

I know that the formatting was correct since if I run the snmptrapd using only the following command:
snmptrapd -P -F "%02.2h:%02.2j"

which makes the snmptrapd printing out the formatted message to stderr (which is the terminal), I get the correct format (which happen only to print out the time the trap was received).

What I don't understand is why it doesn't seem to be able to send the formatted log to the file. Am I missing something here ?

Any one can help ?

I am using RH 9 based linux and snmp software from RPM version 5.0.6-17. ( I installed both the net-snmp and net-snmp-utils rpm)

Thanks a bunch

rstory 03-19-2004 10:45 PM

Re: snmptrapd log file
 
Quote:

Originally posted by aherrys
So the snmptrapd logs it fine, however when I try to format the log messages to something simpler and run the snmptrapd with the following command:
snmptrapd -o /home/herry/test.log -F "%02.2h:%02.2j"


Try a more recent version (5.1.1). If it still doesn't work, report a bug at
http://www.net-snmp.org/bugs/

ranafaisal 05-28-2018 05:00 AM

Can you please share the snmptrapd.conf file here with me?

jsbjsb001 05-28-2018 05:31 AM

Quote:

Originally Posted by ranafaisal (Post 5860306)
Can you please share the snmptrapd.conf file here with me?

You need to start you're own thread for you're own question.

ranafaisal 05-28-2018 05:43 AM

Quote:

Originally Posted by jsbjsb001 (Post 5860317)
You need to start you're own thread for you're own question.

I did that but I have not got any replies ye at that thread

jsbjsb001 05-28-2018 05:45 AM

Quote:

Originally Posted by ranafaisal (Post 5860324)
I did that but I have not got any replies ye at that thread

You need to give members time to respond and not hijack someone else's thread.

ranafaisal 05-28-2018 06:14 AM

Quote:

Originally Posted by jsbjsb001 (Post 5860326)
You need to give members time to respond and not hijack someone else's thread.

oh ok its called hijacking didn't know that

chinmay_dotslashorange 12-24-2019 05:59 AM

You can use -t option with snmptrapd
 
snmptrapd -tLf /your-log-location/yourlogfile.log

Restarted snmptrapd.

This worked on RHEL 6.8
net-snmp-5.5-57.el6


All times are GMT -5. The time now is 11:05 PM.