LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-14-2003, 01:50 AM   #1
aherrys
Member
 
Registered: Jul 2003
Posts: 85

Rep: Reputation: 15
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
 
Old 03-19-2004, 10:45 PM   #2
rstory
LQ Newbie
 
Registered: Mar 2004
Posts: 21

Rep: Reputation: 15
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/
 
Old 05-28-2018, 05:00 AM   #3
ranafaisal
LQ Newbie
 
Registered: May 2018
Posts: 13

Rep: Reputation: Disabled
Can you please share the snmptrapd.conf file here with me?
 
Old 05-28-2018, 05:31 AM   #4
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ranafaisal View Post
Can you please share the snmptrapd.conf file here with me?
You need to start you're own thread for you're own question.
 
Old 05-28-2018, 05:43 AM   #5
ranafaisal
LQ Newbie
 
Registered: May 2018
Posts: 13

Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
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
 
Old 05-28-2018, 05:45 AM   #6
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ranafaisal View Post
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.
 
Old 05-28-2018, 06:14 AM   #7
ranafaisal
LQ Newbie
 
Registered: May 2018
Posts: 13

Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
You need to give members time to respond and not hijack someone else's thread.
oh ok its called hijacking didn't know that
 
Old 12-24-2019, 05:59 AM   #8
chinmay_dotslashorange
LQ Newbie
 
Registered: Dec 2019
Posts: 1

Rep: Reputation: Disabled
Wink 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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
snmptrapd FIFO eccsamba Linux - Networking 2 11-24-2004 08:52 AM
I don't have an snmptrapd.conf jon3k Linux - Software 0 09-10-2004 04:53 PM
How to control log file size in /var/log? yan Linux - General 2 10-13-2003 05:00 PM
what log file generator that support squid log? heero82 Linux - Software 2 07-11-2003 08:52 PM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration