LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-20-2015, 12:32 PM   #1
niteen
Member
 
Registered: Mar 2013
Location: India
Distribution: Fedora
Posts: 66

Rep: Reputation: Disabled
send mysql log to remote central server


Hi,
i have configured rsyslog as follows
Quote:
server :

/etc/rsyslog.conf
=================
$ModLoad imudp
$UDPServerRun 514

$ModLoad imtcp
$InputTCPServerRun 514
Quote:
client :

/etc/rsyslog.conf
=================
#UDP
*.* @server's_ip:514
#TCP
*.* @@server's:514

/etc/my.cnf
===========
[mysqld_safe]
syslog
in server "tail -f /var/log/messages"
i am not getting any client's log.

Please share me correct configuration, if i am wrong anywhere.

Thanks in advance
 
Old 11-20-2015, 12:38 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Usually I would also put this on the client side

Code:
$WorkDirectory /var/lib/rsyslog # where to place spool files
$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
$ActionQueueType LinkedList   # run asynchronously
$ActionResumeRetryCount -1    # infinite retries if host is down
On my set up I only have the following entry once
Code:
*.* @@loghost.example.net:514
Also did you open up ports 514 tcp/udp?

Last edited by custangro; 11-20-2015 at 12:40 PM.
 
1 members found this post helpful.
Old 11-20-2015, 12:43 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by niteen View Post
Hi,
i have configured rsyslog as follows

in server "tail -f /var/log/messages" i am not getting any client's log. Please share me correct configuration, if i am wrong anywhere.
..and the first two hits in Google for "send mysql log to remote syslog", are:
http://dba.stackexchange.com/questio...logs-to-syslog
http://help.papertrailapp.com/kb/con...ql-query-logs/

...which contain at least four different methods of doing this. Please try to do research on your own.
 
Old 11-21-2015, 03:58 AM   #4
niteen
Member
 
Registered: Mar 2013
Location: India
Distribution: Fedora
Posts: 66

Original Poster
Rep: Reputation: Disabled
Hi custangro,

I edited my configuration as per your suggestion. have a look!!

server
======
Quote:
/etc/rsyslog.conf

$ModLoad imudp
$UDPServerRun 514

$ModLoad imtcp
$InputTCPServerRun 514

##netstat -pant | grep 514 result is

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:514 0.0.0.0:* LISTEN -
tcp 0 0 :::514 :::* LISTEN -
Also
Client
======
Quote:
/etc/rsyslog.conf

$WorkDirectory /var/lib/rsyslog # where to place spool files
$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinite retries if host is down
# Remote rsyslog server's IP address.
#UDP
#*.* @server-IP
#TCP
*.* @server-IP:514
unable to receive client's log.

Last edited by niteen; 11-22-2015 at 11:35 AM.
 
Old 11-23-2015, 05:37 AM   #5
niteen
Member
 
Registered: Mar 2013
Location: India
Distribution: Fedora
Posts: 66

Original Poster
Rep: Reputation: Disabled
while googling i found this link :
http://linuxsysconfig.com/2013/04/ho...rhel6-centos6/

But no success yet!!! :-(
 
Old 11-24-2015, 09:48 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by niteen View Post
while googling i found this link :
http://linuxsysconfig.com/2013/04/ho...rhel6-centos6/

But no success yet!!! :-(
Again, just saying "no success yet", doesn't give us much to go on.

And since you ignored my previous post with TWO LINKS that gave you four different ways to do this, there's not much point in restating that. Good luck.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syslog-ng3.2 central log server JonDoe Linux - Server 8 09-21-2011 04:56 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
Central Log Server using syslog-ng sakthi.s Linux - Security 3 12-26-2007 05:04 PM
central server log / databased . . syslog-ng maybe? sir-lancealot Linux - Server 2 08-28-2007 11:55 AM
Configure SLES9 Server as a central log host gcw123 Linux - Software 4 12-29-2004 06:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 03:59 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