[syslog-ng] connecting to mongodb
Gergely Nagy
algernon at balabit.hu
Wed Feb 2 16:55:07 CET 2011
> When I try to use mongodb, I receive the following error message:
>
> Feb 2 15:33:54 linux-8k4b syslog-ng[9403]: syslog-ng starting up;
> version='3.3.0alpha0'
> Feb 2 15:33:54 linux-8k4b syslog-ng[9403]: Error connecting to MongoDB;
> Feb 2 15:33:54 linux-8k4b syslog-ng[9403]: Error connecting to MongoDB;
> Feb 2 15:33:54 linux-8k4b syslog-ng[9403]: Network error while
> inserting into MongoDB; time_reopen='60'
>
> The relevant part of my syslog-ng.conf is (taken from an earlier e-mail
> on the list):
>
> destination d_mongodb {
> mongodb(
> host("localhost")
> port(27017)
> database("syslog-ng")
> collection("logs")
> keys("date", "facility", "level", "host", "program", "pid", "message")
> values("${R_YEAR}-${R_MONTH}-${R_DAY}
> ${R_HOUR}:${R_MIN}:${R_SEC}", "$FACILITY", "$LEVEL", "$HOST","$PROGRAM",
> "$PID", "$MSGONLY")
> );
> };
That seems correct. Could it be caused by apparmor or some other similar
thing? If not, I'd appreciate if you could send me a strace of syslog-ng
(privately, the list would probably reject it anyway).
Connection can only fail if:
* socket() fails, but that is highly unlikely.
* connect() fails, but then you'd see something on tcpdump, I believe.
* setsockopt() or fcntl fails (unlikely, imo)
* malloc fails (again, very unlikely)
My vague guess would be something external preventing syslog-ng to
connect to mongodb.
Then again, I should tweak the libmongo-client API a bit, so we could
provide better error messages.
--
|8]
More information about the syslog-ng
mailing list