documentazione_3di_riservata:manuali_sysadmin:graylog
                Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| documentazione_3di_riservata:manuali_sysadmin:graylog [2020/06/24 16:59] – [Errori di visualizzazione] epapakroni | documentazione_3di_riservata:manuali_sysadmin:graylog [Data sconosciuta] (versione attuale) – eliminata - modifica esterna (Data sconosciuta) 127.0.0.1 | ||
|---|---|---|---|
| Linea 1: | Linea 1: | ||
| - | ====== Servizi ====== | ||
| - | |||
| - | I servizi presenti sul server sono i seguenti: | ||
| - | |||
| - | - MongoDb | ||
| - | - Elastisearch | ||
| - | - Graylog-Server | ||
| - | |||
| - | <code xml> | ||
| - | systemctl status elasticsearch.service | ||
| - | systemctl status graylog-server | ||
| - | </ | ||
| - | |||
| - | Web manager è http:// | ||
| - | |||
| - | ====== Configurazioni ====== | ||
| - | |||
| - | Il file di configurazione per il GrayLog è | ||
| - | |||
| - | ''/ | ||
| - | |||
| - | ====Choose a rotation strategy==== | ||
| - | |||
| - | Graylog offers 3 retention strategies: | ||
| - | |||
| - | "Index time" is the maximum message time we will keep per index (e.g. 14 days per index). | ||
| - | "Index message count" is the maximum number of messages we will keep per index (e.g. 20 millions messages per index). | ||
| - | "Index size" is the maximum size we will keep per index (e.g. 40 GB per index). | ||
| - | |||
| - | You have to choose one of these strategies. Our recommendation is to choose the "Index time" to be sure to keep the logs from the last X days. | ||
| - | |||
| - | Be careful to estimate well your disk storage needs. | ||
| - | As an example, if you store 1 GB logs per day and decide to keep the last 365 days, you will need 365 GB of disk space. | ||
| - | |||
| - | ====Define your retention parameters==== | ||
| - | |||
| - | Per default, Graylog limit indices to a maximum of 20 but this value can be changed. | ||
| - | |||
| - | Imagine we want to keep the last 365 days messages, we have to tell to Graylog to store 365 days / 20 indices, which is around 19 days per index. | ||
| - | |||
| - | You can do the same math for "Index message count" and "Index size" strategy: | ||
| - | |||
| - | We have 20 indices maximum and want to keep 50 millions message: 200 millions messages / 20 indices = 10 millions messages per index. | ||
| - | We have 10 indices maximum and want to keep 400 GB of messages: 400 GB messages / 10 indices = 40 GB per index. | ||
| - | |||
| - | |||
| - | ===== Monitorare Server Linux ===== | ||
| - | |||
| - | Installare sul server che si desidera mandare i log, RSYSLOG. Creare un file rsyslog.conf in / | ||
| - | |||
| - | <code xml> | ||
| - | *.* @10.17.61.115; | ||
| - | *.* @@10.17.61.115: | ||
| - | </ | ||
| - | |||
| - | Servono per il traffico tcp e udp. Richiesta nella porta 1024 del server. | ||
| - | |||
| - | Modificare il file / | ||
| - | |||
| - | <code xml> | ||
| - | # provides UDP syslog reception | ||
| - | module(load=" | ||
| - | input(type=" | ||
| - | |||
| - | # provides TCP syslog reception | ||
| - | module(load=" | ||
| - | input(type=" | ||
| - | |||
| - | ############### | ||
| - | #### RULES #### | ||
| - | ############### | ||
| - | |||
| - | # | ||
| - | # First some standard log files.  | ||
| - | # | ||
| - | auth, | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | |||
| - | # | ||
| - | # Logging for the mail system.  | ||
| - | # it is easy to write scripts to parse these files. | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | # | ||
| - | |||
| - | # | ||
| - | # Some " | ||
| - | # | ||
| - | *.=debug;\ | ||
| - |         auth, | ||
| - | #        | ||
| - | *.=info; | ||
| - |         auth, | ||
| - | #        | ||
| - | #        | ||
| - | </ | ||
| - | |||
| - | Riavviare il servizio rsyslog. '' | ||
| - | |||
| - | |||
| - | Sul web di Graylog, aggiungere un input per la seguente richiesta. Se esiste già. Non c'è bisogno di fare nulla. Altrimenti andare su : | ||
| - | |||
| - | System/ | ||
| - | |||
| - | ==Retention== | ||
| - | Andare su System/ | ||
| - | |||
| - | ==SSH== | ||
| - | Per avere delle informazioni più leggibili in ssh auth configurare come segue. | ||
| - | |||
| - | Aggiungere in .ssh/ | ||
| - | < | ||
| - | environment=" | ||
| - | </ | ||
| - | |||
| - | Creare lo script sshrc / | ||
| - | < | ||
| - | if [ -n " | ||
| - | ip=`echo $SSH_CONNECTION | cut -d " " -f 1` | ||
| - | logger -t ssh-wrapper $SSH_USER is logged as $USER from $ip | ||
| - | fi | ||
| - | |||
| - | </ | ||
| - | |||
| - | Modificare / | ||
| - | |||
| - | ===== Monitorare Server Windows ===== | ||
| - | |||
| - | Installare nxlog dal sito https:// | ||
| - | Modificare il seguente file C:\Program Files (x86)\nxlog\conf\nxlog.conf | ||
| - | |||
| - | <code xml> | ||
| - | < | ||
| - |      | ||
| - | Module xm_gelf | ||
| - | </ | ||
| - | |||
| - | <Input In> | ||
| - | 	Module	im_msvistalog  | ||
| - | ReadFromLast FALSE | ||
| - |         SavePos  | ||
| - | 	Query < | ||
| - |         <Query Id=" | ||
| - | 	<Select Path=" | ||
| - |     </ | ||
| - |     </ | ||
| - | </ | ||
| - | |||
| - | <Output out> | ||
| - | Module om_tcp | ||
| - | Host 10.17.61.115 | ||
| - | Port 12201 | ||
| - | OutputType GELF_TCP | ||
| - | </ | ||
| - | |||
| - | <Route 1> | ||
| - | Path In => out | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | La porta 12201 è casuale. Stare attenti che a volte l' | ||
| - | Dal web andare su System=> | ||
| - | |||
| - | ====== Errori di visualizzazione ====== | ||
| - | |||
| - | In caso di molti log, se si passa la soglia di max_result_window, | ||
| - | |||
| - | <code xml>curl -XPUT " | ||
| - | |||
| - | ====== Update Version ====== | ||
| - | |||
| - | <code xml> | ||
| - | $ wget https:// | ||
| - | $ dpkg -i graylog-3.0-repository_latest.deb | ||
| - | $ apt-get update | ||
| - | $ apt-get install graylog-server | ||
| - | $ service graylog-server restart | ||
| - | </ | ||
/data/attic/documentazione_3di_riservata/manuali_sysadmin/graylog.1593010742.txt.gz · Ultima modifica:  da epapakroni