Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)
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"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.