OSCam/it/CentralLogging: Unterschied zwischen den Versionen

Aus Streamboard Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „Kategorie:OSCam {{OSCamHomeLinks}} == Central Logging == One thing I found very useful when debugging issues with OSCam (and not only this) is to have all th…“)
 
 
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt)
Zeile 2: Zeile 2:
{{OSCamHomeLinks}}
{{OSCamHomeLinks}}


== Central Logging ==
[[Datei:WarningS.png|text-bottom]] '''Attenzione:''' Il contenuto della traduzione in italiano e parzialmente in tedesco. Registrati e aiutaci a complementare e tradurre!
One thing I found very useful when debugging issues with OSCam (and not only this) is to have all the logs at my disposal. To do that, I have setup all my boxes to send their logs to my server which is always on and has sufficient disk space. The preferred protocol, supported by all devices and programs, is '''syslog'''.


=== Client Configuration ===
== Logging Centralizzato ==
First, I make sure syslog is running on my boxes.
Un importante passo per eseguire il debugging di OSCam (e non solo) è sicuramente quello di avere tutti i log in un unico posto per poterli analizzare in maniera più semplice. Per fare questo, si devono configurare tutti i decoders (ricevitori o apparecchi da analizzare) in modo che inviino i loro logs su un server con sufficiente spazio disco per mantenere tutti questi logs. Il protocollo preferito per eseguire questa attività è '''syslog'''.


For DM500 running Gemini, the configuration is in <tt>/var/script/syslogd_script.sh</tt>:
=== Configurazione del Client ===
Controllare che syslog sia funzionante su tutte le periferiche.
 
Per DM500 con Gemini, la configurazione si trova in <tt>/var/script/syslogd_script.sh</tt>:
  REMOTE=1
  REMOTE=1
  REMOTE_HOST=<serverIP>
  REMOTE_HOST=<serverIP>
  REMOTE_PORT=514
  REMOTE_PORT=514


On my TM800HD, the configuration is in <tt>/etc/syslog.conf</tt>
Per TM800HD, la configurazione si trova in <tt>/etc/syslog.conf</tt>
  DESTINATION="remote"
  DESTINATION="remote"
  REMOTE=<serverIP>:514
  REMOTE=<serverIP>:514


Then, '''oscam''' can be configured to write to syslog daemon instead of a file. Just change <tt>logfile</tt> value in <tt>oscam.conf</tt> like this:
Poi, '''oscam''' può essere configurata per scrivere il proprio log sul demone di syslog invece che in un semplice file. Basta cambiare il valore di <tt>logfile</tt> in <tt>oscam.conf</tt> in questo modo:
  [global]
  [global]
  logfile                      = syslog
  logfile                      = syslog


=== Server Configuration ===
=== Configurazione Server ===
The best part is on the server side. This is where I wasn't happy with the default '''syslogd''' server that comes with Debian, and I installed the smarter '''syslog-ng'''. One thing I loved about syslog-ng is that I was able to configure it so that each box has its own directory on the server, making it very easy to find the log data I was looking for. This is the configuration I use in <tt>syslog-ng.conf</tt>:
La parte migliore si trova lato server. Per i possessori di Debian è consigliato sostituire '''syslogd''' con '''syslog-ng'''. syslog-ng presenta dei vantaggi notevoli rispetto a syslogd (o rsyslogd), uno dei quali è ad esempio che ogni periferica può avere a disposizione la propria directory dedicata dove inviare i propri logs, rendendo molto più semplice la ricerca e l'analisi degli stessi.
 
Configurazione di esempio in <tt>syslog-ng.conf</tt>:


  # source: all logs sent from the network
  # sorgente: Tutti i log provenienti dalla rete
  source s_net {
  source s_net {
     udp();
     udp();
Zeile 30: Zeile 34:
     syslog();
     syslog();
  };<br/>
  };<br/>
  # destination: each facility has its own log for each host
  # destinazione: ogni decoder ha la propria directory
  destination d_hosts {
  destination d_hosts {
     file("/var/log/hosts/$HOST/$FACILITY.log"
     file("/var/log/hosts/$HOST/$FACILITY.log"
Zeile 40: Zeile 44:
     );
     );
  };<br/>
  };<br/>
  # everything from the network is sent to the disk, under /var/log/hosts
  # tutto ciò che proviene dalla rete viene inviato al disco in /var/log/hosts
  log {
  log {
     source(s_net);
     source(s_net);
Zeile 46: Zeile 50:
  };
  };


=== Results ===
=== Risultati ===
The result is that I have log files on the server for all my stuff:
I risultati ottenuti sono elencati di seguito:
  server:/var/log/hosts# find
  server:/var/log/hosts# find
  ./phone
  ./phone
Zeile 73: Zeile 77:
  ./dm500be/user.log  
  ./dm500be/user.log  


Here's my son watching Cartoons:
Mio figlio che si guarda i cartoni animati:
  server:/var/log/hosts/dm500fe# tail -2 daemon.log  
  server:/var/log/hosts/dm500fe# tail -2 daemon.log  
  Mar 17 12:53:15 dm500fe oscam: 32025B50 c anonymous (0500&022F00/003D/34:EF9E): found (143 ms) by server (of 1 avail 1)
  Mar 17 12:53:15 dm500fe oscam: 32025B50 c anonymous (0500&022F00/003D/34:EF9E): found (143 ms) by server (of 1 avail 1)
  Mar 17 12:53:25 dm500fe oscam: 32025B50 c anonymous (0500&022F00/003D/34:E49B): found (147 ms) by server (of 1 avail 1)
  Mar 17 12:53:25 dm500fe oscam: 32025B50 c anonymous (0500&022F00/003D/34:E49B): found (147 ms) by server (of 1 avail 1)


I'm watching cricket on Sky Sports HD1:
Io che guardo Sky Sports HD1:
  server:/var/log/hosts/tm800# tail -2 daemon.log  
  server:/var/log/hosts/tm800# tail -2 daemon.log  
  Mar 17 12:54:23 tm800 oscam: 2CDE74D0 c anonymous (0963&000000/0EDA/76:11B0): found (135 ms) by server (of 1 avail 1)
  Mar 17 12:54:23 tm800 oscam: 2CDE74D0 c anonymous (0963&000000/0EDA/76:11B0): found (135 ms) by server (of 1 avail 1)
  Mar 17 12:54:30 tm800 oscam: 2CDE74D0 c anonymous (0963&000000/0EDA/76:FB59): found (117 ms) by server (of 1 avail 1)
  Mar 17 12:54:30 tm800 oscam: 2CDE74D0 c anonymous (0963&000000/0EDA/76:FB59): found (117 ms) by server (of 1 avail 1)


Even the server logs are in this directory structure:
Ci sono anche i logs del server:
  server:/var/log/hosts/server# tail -2 daemon.log  
  server:/var/log/hosts/server# tail -2 daemon.log  
  Mar 17 12:55:44 server oscam: B6419280 c tm800 (0963&000000/0EDA/76:85F5): found (111 ms) by smargo (of 1 avail 1)
  Mar 17 12:55:44 server oscam: B6419280 c tm800 (0963&000000/0EDA/76:85F5): found (111 ms) by smargo (of 1 avail 1)
  Mar 17 12:55:45 server oscam: B6421280 c dm500fe (0500&022F00/003D/34:8660): found (142 ms) by omnikey (of 1 avail 1)
  Mar 17 12:55:45 server oscam: B6421280 c dm500fe (0500&022F00/003D/34:8660): found (142 ms) by omnikey (of 1 avail 1)


'''NOTE:''' In case you are wondering, phone is a VOIP adapter. Yes, it supports the '''syslog''' protocol, so I collect its logs on my server!
'''NOTA:''' Nel caso in cui vi stiate chiedendo, phone è una periferica VOIP. SI, supporta il protocollo '''syslog''', quindi colleziono i suoi logs sul server!


{{OSCamTranslatedLinks}}
{{OSCamTranslatedLinks}}

Aktuelle Version vom 18. Juni 2011, 11:43 Uhr

OSCam Übersicht OSCam Home OSCam Accueil OSCam Home

Attenzione: Il contenuto della traduzione in italiano e parzialmente in tedesco. Registrati e aiutaci a complementare e tradurre!

Logging Centralizzato

Un importante passo per eseguire il debugging di OSCam (e non solo) è sicuramente quello di avere tutti i log in un unico posto per poterli analizzare in maniera più semplice. Per fare questo, si devono configurare tutti i decoders (ricevitori o apparecchi da analizzare) in modo che inviino i loro logs su un server con sufficiente spazio disco per mantenere tutti questi logs. Il protocollo preferito per eseguire questa attività è syslog.

Configurazione del Client

Controllare che syslog sia funzionante su tutte le periferiche.

Per DM500 con Gemini, la configurazione si trova in /var/script/syslogd_script.sh:

REMOTE=1
REMOTE_HOST=<serverIP>
REMOTE_PORT=514

Per TM800HD, la configurazione si trova in /etc/syslog.conf

DESTINATION="remote"
REMOTE=<serverIP>:514

Poi, oscam può essere configurata per scrivere il proprio log sul demone di syslog invece che in un semplice file. Basta cambiare il valore di logfile in oscam.conf in questo modo:

[global]
logfile                       = syslog

Configurazione Server

La parte migliore si trova lato server. Per i possessori di Debian è consigliato sostituire syslogd con syslog-ng. syslog-ng presenta dei vantaggi notevoli rispetto a syslogd (o rsyslogd), uno dei quali è ad esempio che ogni periferica può avere a disposizione la propria directory dedicata dove inviare i propri logs, rendendo molto più semplice la ricerca e l'analisi degli stessi.

Configurazione di esempio in syslog-ng.conf:

# sorgente: Tutti i log provenienti dalla rete
source s_net {
    udp();
    tcp();
    syslog();
};
# destinazione: ogni decoder ha la propria directory destination d_hosts { file("/var/log/hosts/$HOST/$FACILITY.log" owner(root) group(root) perm(0600) dir_perm(0755) create_dirs(yes) ); };
# tutto ciò che proviene dalla rete viene inviato al disco in /var/log/hosts log { source(s_net); destination(d_hosts); };

Risultati

I risultati ottenuti sono elencati di seguito:

server:/var/log/hosts# find
./phone
./phone/user.log
./dm500fe
./dm500fe/daemon.log
./dm500fe/syslog.log
./dm500fe/user.log
./server
./server/daemon.log
./server/syslog.log
./server/user.log
./tm800
./tm800/daemon.log
./tm800/authpriv.log
./tm800/cron.log
./tm800/user.log
./dm7000
./dm7000/daemon.log
./dm7000/syslog.log
./dm7000/user.log
./dm500be
./dm500be/daemon.log
./dm500be/syslog.log
./dm500be/user.log 

Mio figlio che si guarda i cartoni animati:

server:/var/log/hosts/dm500fe# tail -2 daemon.log 
Mar 17 12:53:15 dm500fe oscam: 32025B50 c anonymous (0500&022F00/003D/34:EF9E): found (143 ms) by server (of 1 avail 1)
Mar 17 12:53:25 dm500fe oscam: 32025B50 c anonymous (0500&022F00/003D/34:E49B): found (147 ms) by server (of 1 avail 1)

Io che guardo Sky Sports HD1:

server:/var/log/hosts/tm800# tail -2 daemon.log 
Mar 17 12:54:23 tm800 oscam: 2CDE74D0 c anonymous (0963&000000/0EDA/76:11B0): found (135 ms) by server (of 1 avail 1)
Mar 17 12:54:30 tm800 oscam: 2CDE74D0 c anonymous (0963&000000/0EDA/76:FB59): found (117 ms) by server (of 1 avail 1)

Ci sono anche i logs del server:

server:/var/log/hosts/server# tail -2 daemon.log 
Mar 17 12:55:44 server oscam: B6419280 c tm800 (0963&000000/0EDA/76:85F5): found (111 ms) by smargo (of 1 avail 1)
Mar 17 12:55:45 server oscam: B6421280 c dm500fe (0500&022F00/003D/34:8660): found (142 ms) by omnikey (of 1 avail 1)

NOTA: Nel caso in cui vi stiate chiedendo, phone è una periferica VOIP. SI, supporta il protocollo syslog, quindi colleziono i suoi logs sul server!

Diese Seite in anderen Sprachen - This page in other languages - Cette page dans d'autres langues - Queste pagine in altre Lingue

[[OSCam/de/{{#titleparts:OSCam/it/CentralLogging|3|3}}|Deutsch]] [[OSCam/en/{{#titleparts:OSCam/it/CentralLogging|3|3}}|English]] [[OSCam/fr/{{#titleparts:OSCam/it/CentralLogging|3|3}}|Français]] [[OSCam/it/{{#titleparts:OSCam/it/CentralLogging|3|3}}|Italiano]]