OpenWrt Forum Archive

Topic: OpenWRT syslog to MySQL

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Howdy,

I have been searching for a solution how to get syslog data from OpenWRT to a remote MySQL server, and I was wondering if anyone had any experience with this? I found two IPK packages that seems to have related functionality ; msyslog and sysklogd-sql, but I was not able to get either of them to work under OpenWRT and I could not find documentation how to get them to work under OpenWRT. Any good ideas?

Regards,
Sebastian

(Last edited by ssjoholm on 1 May 2005, 22:21)

Hi,

I'm the package maintainer of msyslogd and sysklogd-sql. I did not tested them when they were ported so that you may encounter issues running them. What about this documentation ? :

http://sourceforge.net/docman/display_d … p_id=25741

I hope this helps. I'll try to find the time to make a documentation about this two softwares

Thanks.

I'm ready to document everything how set it up (create a how-to or similar), I just need some help to get past the errors. I'm not used to the unix enviroment, so any help is welcomed.

MSYSLOG :

Following was recieved when I tried to start msyslog;

root@OpenWrt:/# /usr/bin/syslogd
Error opening main library, [File not found] file [/usr/lib/alat/libmsyslog.so.1.08g]
root@OpenWrt:/#

But I guess I should create a link to the libmysqlclient

This is most likely related to the step 7 in the instructions (the link you gave me) ;

"Set Envirionment
msyslog is intended to be very modular. As such the requisite libraries need to be locatable by the dynamic library loader. As this varies from platform to platform it is best to read the linker documentation. e.g. on Solaris Be sure libmysqlclient.so.??? and libmsyslog.so.??? are in LD_LIBRARY_PATH "

I have the libmysqlclient installed and the related files are in : /usr/lib/libmysqlclient.so.12

How do I link this?

SYSKLOGD-SQL:

Following was received when I tried to start sysklogd-sql;

root@OpenWrt:/# /usr/sbin/syslogd -d
Allocated parts table for 1024 file descriptors.
Starting.
Called logerr, msg: network logging disabled (syslog/udp service unknown).
logmsg: err, flags 4, from OpenWrt, msg syslogd: network logging disabled (syslog/udp service unknown).
Called fprintlog, logging to CONSOLE /dev/console
Called logerr, msg: see syslogd(8) for details of whether and how to enable it.
logmsg: err, flags 4, from OpenWrt, msg syslogd: see syslogd(8) for details of whether and how to enable it.: No such fi
le or directory
Called fprintlog, logging to CONSOLE /dev/console
Debugging disabled, SIGUSR1 to turn on debugging.
root@OpenWrt:/#

On this one I don't have clue how to go forward.

Regards,
Sebastian

does this thing require mysql client libraries installed on the wrt? if so, do you have enough space for it? if i were you i would simply run syslogd by "syslogd -R ip:514 -L" so it would send the log packets via udp to the ip (seperate machine, you might even use the mysql-box) you specified. then just make a udp-listener-mysql-inserter script (you can even use "nc -ulp 514" i suppose) to pump the lines to mysql.

disq wrote:

does this thing require mysql client libraries installed on the wrt? if so, do you have enough space for it? if i were you i would simply run syslogd by "syslogd -R ip:514 -L" so it would send the log packets via udp to the ip (seperate machine, you might even use the mysql-box) you specified. then just make a udp-listener-mysql-inserter script (you can even use "nc -ulp 514" i suppose) to pump the lines to mysql.

The libmysqlclient_4.0.24-2_mipsel.ipk package is 60Kb so that should not be a problem. I have some limitations what to recieve from the internet, since I only have a web hosting server with mysql and no access to syslog (or shell scripts) at the server which would be needed, I guess this would otherwise be a good option. Thanks, for the idea.

regards,
Sebastian

The discussion might have continued from here.