PDA

Bekijk Volledige Versie : Alle logs naar een SysLog Server



GlobalServe
09/06/05, 11:52
Het configen van een switch, router, enz... is allemaal te doen voor te loggen naar een externe syslog server, maar hoe is het mogelijk om alle logs die linux aanmaakt, ook httpd, sshd, auth, enz... te loggen naar een externe syslogserver

Moet het per daemon geconfigureerd worden of kan je ergens in een config iets aanpassen dat het voor alle logs gebeurt ?

OS is RedHat 9.0
En Sun Cobal RaQ 4

Thx

_arno_
09/06/05, 12:04
kun je geen symlink leggen naar de log server ?
dus /var/log naar /mnt/syslogserver/log ?
Dit kwam even in mij op , verder kan ik je niet helpen Succes!

fre0n
09/06/05, 12:10
Linux heeft ook een standaard remote logging mogelijkheid.



Customized logging
There are two services, or daemons, that control logging, klogd and syslogd. klogd only deals with kernel messages. syslogd deals with other system messages, such as applications. You can configure the behavior of both by editing the files /etc/syslog.conf and /etc/sysconfig/syslog. Full custom logging is beyond the scope of this article, but full details can be found in the Resources listed at the end of this article. You can also learn much by looking at the man page for /etc/sylogd.conf.

Essentially, each message generated by software provides some information to identify where the message came from and what message it is. The /etc/syslog.conf file allows you to specify what you want done with that kind of message. You can dump it to the messages file. You can dump it to a custom file. You can have it sent to a remote host where that host will process it according to its own syslogd configuration. Remote logging is an excellent security feature. By placing your logs on a remote system, you can prevent a security breach from easily covering its tracks by altering the log files.

Here is an example of customized logging taken from the man /etc/syslog.conf page:
Customized logging


# Kernel messages are first, stored in the kernel
# file, critical messages and higher ones also go
# to another host and to the console
#
kern.* /var/adm/kernel
kern.crit @finlandia
kern.crit /dev/console
kern.info;kern.!err /var/adm/kernel-info

The first rule directs any message that has the kernel facility to the file /var/adm/kernel.

The second statement directs all kernel messages of the priority crit and higher to the remote host finlandia. This is useful, because if the host crashes and the disks get irreparable errors, you might not be able to read the stored messages. If they're on a remote host, too, you still can try to find out the reason for the crash.

The third rule directs these messages to the actual console, so the person who works on the machine will get them, too.

The fourth line tells the syslogd to save all kernel messages that come with priorities from info up to warning in the file /var/adm/kernel- info. Everything from err and higher is excluded.

The ability to customize logging like this provides a great deal of flexibility and control over the Linux environment.

GlobalServe
09/06/05, 14:43
@fre0n:

Waar heb je dat artikel gehaald ?
Misschien dat er nog meer info staat op die website.


@_arno_

Met symlinks zie ik het niet echt zitten omdat er dan de hele tijd een mount open staat naar een ander machien en niet beveiligd is.

fre0n
10/06/05, 11:45
Het internet staat er vol mee. De tekst van hierboven komt van http://www-106.ibm.com/developerworks/linux/library/l-roadmap5/

(Dit was toevallig de eerste hit met google op remote, logging en linux dus wellicht niet d ebeste site om remote logging op uitgelegd te krijgen)


Overigens moet je de machine waarop de logs moeten komen wel voor remote logs enablen (logisch) met -r Zie oa
http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/security-messages.html#SECURITY-MESSAGES-SYSCONFIG en http://www.linuxhomenetworking.com/linux-hn/logging.htm

GlobalServe
14/06/05, 12:00
Origineel geplaatst door fre0n
http://www.linuxhomenetworking.com/linux-hn/logging.htm

Dit atrikel is heel goed, thx iedereen.