Skip to content

Instantly share code, notes, and snippets.

@MHMDhub
Created March 19, 2018 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MHMDhub/56bf4a2e929d490c8abe1c9ca9488b0c to your computer and use it in GitHub Desktop.
Save MHMDhub/56bf4a2e929d490c8abe1c9ca9488b0c to your computer and use it in GitHub Desktop.
Centralized log management on Centos7:
Two Linux servers ( server @ ip 192.168.0.105 and client @ ip 192.168.0.104).
Server setup (Assuming rsyslog package is installed):
[root@server ~]# vi /etc/rsyslog.conf # Provides UDP syslog reception$ModLoad imudp$UDPServerRun 514 # Provides TCP syslog reception$ModLoad imtcp$InputTCPServerRun 514 [root@server ~]# service rsyslog restart Verify the syslog server listening.
[root@server ~]# netstat -antup | grep 514 tcp        0      0 0.0.0.0:514                 0.0.0.0:*                   LISTEN      8081/rsyslogdtcp        0      0 :::514                      :::*                        LISTEN      8081/rsyslogdudp        0      0 0.0.0.0:514                 0.0.0.0:*                               8081/rsyslogdudp        0      0 :::514                      :::*                                    8081/rsyslogd 
Client setup:
[root@client ~]# vi /etc/rsyslog.conf At the end of file place the following line to point the client message log to the server
*.info;mail.none;authpriv.none;cron.none   @192.168.0.105
You can either mention hostname or ip address.
Restart the syslog service
[root@client ~]# service rsyslog restart Now all the message logs are sent to the central server and also it keeps the copy locally.
Firewall Port opening (Optional):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment