Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Hi,
I am using snmptrapd program in solaris environment. I was able to successfully log the data in a simple file. I am trying to log the same data into a FIFO.
My aim to read the FIFO in real time and filter the data and send alarm to administrators accordingly.
I have configured the snmptrapd to log the data into a FIFO
using the command
snmptrapd -c conf -p logs/pid -Lf logs/current
where current is a FIFO in logs directory created using mknod command. I dont see any data coming through the FIFO.
One perspective my program cannot read the FIFO in real time. but i have tested by cat ing similar data into the FIFO. my program responded very well.
cat data > current
my programs structure is, it reads from the FIFO and sends the data into a filter script which continues with further action.
my question, is snmptrapd capable of logging stuff into the FIFO to be further read.
Distribution: FC1, Gentoo, Mdk 8.1, RH7-8-9, Knoppix, Zuarus rom 3.13
Posts: 98
Thanked: 0
I'm no expert on named pipes so this may not be of any assistance. The one thing I know is that if a named pipe is opened for write only before it has been opened for read then the operation will fail.
Could it be your order of accessing the pipe? Perhaps try accessing the named pipe for read with your monitor program/script before you start the snmptrapd.
I notice you used mknod p. You could have used mkfifo instead. But I don't believe that matters.
Thanks for your reply,
The order of operation does matter. Since the data coming through the pipe was at very less frequency, it looked as though the program does not work. I switched to a snmptrap with heavy information flow, now it works fine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.