PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : wieder ein syslog-ng -Thema :)



mysticado
04.09.08, 15:28
Hallo Leute,
ich bin neu hier und wollte gleich selber mal eine Frage stellen. Und zwar ist mir syslog leider noch nicht so klar.
es geht darum - ich habe ein kleines Netzwerk, dass nach aussen einen Hauptrouter hat (der auch als Gateway dient) welcher mit AliceDSL kommuniziert. Innerhalb des Netzes habe ich jedoch noch ein paar WLAN-Router die als Accesspoints dienen.
Nun wollte ich alle Nachrichten der Accesspoints auf meinem Gateway sammeln, bzw loggen. Keine Sorge, Platz habe ich genug, da eine 2 GB SD-Karte draufgelötet wurde. Mein syslog-Skript scheint aber nicht so richtig zu wollen:



options {
chain_hostnames(off);
sync(0);
ts_format(iso);
stats(43200);
};

source src { unix-stream("/dev/log"); internal(); };
source src1 { tcp(ip(192.168.5.221) port(1999)); };
source src2 { tcp(ip(192.168.5.222) port(1999)); };
source src3 { tcp(ip(192.168.5.223) port(1999)); };
source src4 { tcp(ip(192.168.5.226) port(1999)); };

destination messages { file("/opt/syslog-ng/messages"); };
destination log1 { file("/opt/syslog-ng/ap221.log"); };
destination log2 { file("/opt/syslog-ng/ap222.log"); };
destination log3 { file("/opt/syslog-ng/ap223.log"); };
destination log4 { file("/opt/syslog-ng/ap226.log"); };
destination ppp { file("/opt/syslog-ng/ppp.log"); };

log {source(src4); destination(log4); };
log {source(src3); destination(log3); };
log {source(src2); destination(log2); };
log {source(src1); destination(log1); };
log { source(src); destination(messages); };



So sieht es aus und obwohls so trivial gehalten ist, hat sich trotzdem ein Fehler eingeschlichen :(
Ich war schon am Überlegen ob ich es nicht so machen müsste, dass jeder dieser AP's auch bei sich Syslog-ng am Laufen haben muss und alles was es loggt,dann als destination an meinen Gateway auf Port 1999 schickt? Nur hab ich da ein Problem - syslog-ng ist auf den anderen APs nicht drauf und Platz zum draufspielen habe ich auch nicht ! Also, was nun?

Achja, ausserdem wollte ich, dass das Gateway auch das pppoe mitloggt, d.h. allen Verkehr von aussen nach drinnen. Geht das irgendwie?
Danke schonmal für die Antworten :)
Gruß

marce
04.09.08, 16:57
ohne es genauer angeschaut zu haben - aber es wäre evtl. hilfreich, zu wissen, worin der Fehler denn nun genau besteht?

mysticado
04.09.08, 17:00
ohne es genauer angeschaut zu haben - aber es wäre evtl. hilfreich, zu wissen, worin der Fehler denn nun genau besteht?

Der Fehler sieht so aus, dass gar nichts geloggt wird, d.h. die Files werden nichtmal erzeugt. Es müsste aber 4 Files mit den namen ap221.log, usw. erzeugen.
Meine Schätzungen gingen dahin, dass (wie oben schon beschrieben) mein Gateway eigentlich gar keine Logs von den anderen AP's empfängt. Wahrscheinlich muss auch bei den AP's syslog-ng installiert sein, damit die das dann überhaupt an den Gateway schicken können?

marce
04.09.08, 17:06
was läuft denn als LogDaemon auf den AP?

Kannst Du von einem bel. PC einen Logeintrag auf dem AP erzeugen?

mysticado
04.09.08, 17:25
nein nichts läuft...ausser eben dieser syslog-ng....daher krieg ich auch nichts hin mit Logeinträgen

CRAZyBUg
04.09.08, 23:41
*BAMM* hats gemacht, da stand das topic.

Teil uns doch mal mit um was für Router es sich handelt, wie der dein Gateway Syslog konfiguriert ist und was du als Linux distri benutzt. Ich mein selbst im router bereich gibt es viele verschiedene. Hast du die konfiguration nach einem tutorial gemacht oder frei schnauze nach manual?

Grüße

BedriddenTech
05.09.08, 22:53
Ich glaube eher, daß es sich hier schlicht um ein syslog-ng-Konfigurationsproblem handelt.

Ich habe die Erfahrung gemacht, daß man mit einem Regulären Ausdruck den Gerätenamen beikommen muß. Bei mir sieht eine (ähnliche) Lösung folgendermaßen aus:

(Ich habe absichtlich die GANZE Konfigurationsdatei angehängt, obwohl es eigentlich nur um einen Teil geht -- zum Verständnis ists ab und an ganz gut, das ganze im Kontext zu sehen.)


# syslog-ng configuration file.
#
# This should behave pretty much like the original syslog on RedHat. But
# it could be configured a lot smarter.
#
# See syslog-ng(8) and syslog-ng.conf(5) for more information.
#
# 20000925 gb@sysfive.com
#
# Updated by Frank Crawford (<Frank.Crawford@ac3.com.au>) - 10 Aug 2002
# - for Red Hat 7.3
# - totally do away with klogd
# - add message "kernel:" as is done with klogd.
#
# Updated by Frank Crawford (<Frank.Crawford@ac3.com.au>) - 22 Aug 2002
# - use the log_prefix option as per Balazs Scheidler's email
#


# Global options follow here.

options {
# Number of lines buffered before the log file is written:
sync (10);
# Time to wait before a died connection is re-opened:
time_reopen (10);
# The number of lines fitting to the output queue:
log_fifo_size (1000);
# Enable/disable chaining of host names:
chain_hostnames (no);
# Use DNS:
use_dns (no);
# Use FQDN instead of just the machine name:
use_fqdn (no);
# Enable or disable automatic creation of destination dirs:
create_dirs (yes);
# Set trust/distrust hostnames in log messages:
keep_hostname (yes);
};

#
# At around 1999 some distributions have changed from using SOCK_STREAM
# to SOCK_DGRAM sockets, see these posts about the issue:
#
# http://www.security-express.com/archives/bugtraq/1999-q4/0071.html
# http://marc.theaimsgroup.com/?l=sysklogd&m=96989685607952&w=2
#
# libc and syslog clients generally automatically detect the socket type,
# so you are free to decide which of unix-stream or unix-dgram you want to use.
#

# This is the system source as the traditional syslogd/klogd would use it.

source s_sys {
file ("/proc/kmsg" log_prefix("kernel: "));
unix-stream ("/dev/log");
internal();
};

source s_remote {
# This is for remote logging. Hosts in the allowed subnets may
# transmit their log messages to this host
udp(ip("192.168.1.1"), port(514));
};

# Various destination files follow.

# Console
destination d_cons { file("/dev/console"); };

# Standard "messages" file
destination d_mesg { file("/var/log/messages"); };

# Debug messages file
destination d_debug { file("/var/log/debug"); };

# Authentication log messages
destination d_auth { file("/var/log/secure"); };

# Messages from the MTA daemon
destination d_mail { file("/var/log/maillog"); };

# Spooler logs
destination d_spol { file("/var/log/spooler"); };

# Messages created at system boot
destination d_boot { file("/var/log/boot.log"); };

# Cron/cronjob logs
destination d_cron { file("/var/log/cron"); };

# Critical messages go directly to the attached tty
destination d_mlal { usertty("*"); };

# Here we store messages produced by iptables
destination d_netfilter { file("/var/log/netfilter"); };

# For remote hosts generally exist two destinations:
# - a named for a know host; and
# - a "general" for other, non-known
destination d_wrt-wifi {
# This destination is for all wifi services, i.e. access points
file("/var/log/remote/wrt-wifi");
};


# Filter are needed to classify messages to direct them to the right
# destination file.

# Kernel logs
filter f_filter1 { facility(kern); };

# Filtered by logging level
filter f_filter2 {
level(info)
and not (facility(mail) or facility(authpriv)
or facility(cron) or facility(auth));
};

# Authentication
filter f_filter3 {
facility(authpriv) or facility(auth);
};

# Messages from mailing stuff
filter f_filter4 { facility(mail); };

# Emergency messages
filter f_filter5 { level(emerg); };

# UUCP or critical news messages
filter f_filter6 {
facility(uucp)
or (facility(news)
and level(crit));
};

# The "local" target from traditional syslog
filter f_filter7 { facility(local7); };

# Triggered by cron
filter f_filter8 { facility(cron); };

# Debug filter to avoid flooding /var/log/mesages
filter f_debug {
level(debug) and facility(kern);
};

filter f_wrt-wifi {
# Catch messages from WIFI/W-LAN machines
host("wrt-wifi.*") or netmask("192.168.1.4/255.255.255.255");
};

# Netfilter debug messages are a little harder to catch
filter f_netfilter {
level(debug) and match("vrmr:.*IN=.*OUT=");
};



#
# Logging connectors
#

# The "log" keyword connects filters to destinations

# First catch netfilter stuff, this normally has alot of data
# We also make sure that the messages don't get stored elsewhere
log {
source(s_sys);
filter(f_netfilter);
destination(d_netfilter);
flags(final);
};

# debugging log
log { source(s_sys); filter(f_debug); destination(d_debug); };

# messages
log { source(s_sys); filter(f_filter2); destination(d_mesg); };

# secure
log { source(s_sys); filter(f_filter3); destination(d_auth); };

# maillog
log { source(s_sys); filter(f_filter4); destination(d_mail); };

# tty
log { source(s_sys); filter(f_filter5); destination(d_mlal); };

# spooler
log { source(s_sys); filter(f_filter6); destination(d_spol); };

# boot
log { source(s_sys); filter(f_filter7); destination(d_boot); };

# cron
log { source(s_sys); filter(f_filter8); destination(d_cron); };

# Remote logs:
log {
# Logs messages from WIFI/W-LAN services and machines
source(s_remote);
filter(f_wrt-wifi);
destination(d_wrt-wifi);
};

Bitte nutz nächstes Mal einen Thematitel, der dein Problem besser beschreibt. :)