User Tools

Site Tools


doc:appunti:linux:sa:nagios_passivo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:appunti:linux:sa:nagios_passivo [2010/08/19 06:58] niccolodoc:appunti:linux:sa:nagios_passivo [2014/01/31 16:36] – [Configurazione del server (Nagios)] niccolo
Line 11: Line 11:
 ===== Configurazione del server (Nagios) ===== ===== Configurazione del server (Nagios) =====
  
-In Debian troviamo un singolo pacchetto da installare, che contiene il client **''send_nsca''** e il server **''nsca''**. Altre distribuzioni possono fornire pacchetti separati.+In Debian Squeeze troviamo il singolo pacchetto **nsca**, che contiene il client **''send_nsca''** e il server **''nsca''**. In Debian Wheezy invece si hanno i due pacchetti **nsca** e **nsca-client**, openSUSE fornisce **nagios-nsca-client** e **nagios-nsca**.
  
 La comunicazione tra client e server avviene in chiaro e senza password, se si vuole qualcosa di meglio editare il file ''/etc/nsca.cfg'' sul server e ''/etc/send_nsca.cfg'' sul client. Purtroppo l'eventuale password deve essere condivisa tra tutti i client. La comunicazione tra client e server avviene in chiaro e senza password, se si vuole qualcosa di meglio editare il file ''/etc/nsca.cfg'' sul server e ''/etc/send_nsca.cfg'' sul client. Purtroppo l'eventuale password deve essere condivisa tra tutti i client.
Line 22: Line 22:
     name            passive-service     ; The 'name' of this service template,     name            passive-service     ; The 'name' of this service template,
                                         ; referenced in other service definitions                                         ; referenced in other service definitions
-    active_checks_enabled             ; Active service checks are enabled+    active_checks_enabled             ; Active service checks are disabled
     passive_checks_enabled        1     ; Passive service checks are enabled/accepted     passive_checks_enabled        1     ; Passive service checks are enabled/accepted
     parallelize_check                 ; Active service checks should be parallelized     parallelize_check                 ; Active service checks should be parallelized
-                                        ; (disabling this can lead to major performance+                                        ; (disabling this can lead to major performance problems)
     obsess_over_service               ; We should obsess over this service (if necessary)     obsess_over_service               ; We should obsess over this service (if necessary)
     check_freshness                   ; Default is to NOT check service 'freshness'     check_freshness                   ; Default is to NOT check service 'freshness'
-    freshness_threshold           4800 +    freshness_threshold           4800 Threshold for fresh/stale data (seconds)
     notifications_enabled             ; Service notifications are enabled     notifications_enabled             ; Service notifications are enabled
     event_handler_enabled             ; Service event handler is enabled     event_handler_enabled             ; Service event handler is enabled
Line 35: Line 35:
     retain_status_information         ; Retain status information across program restarts     retain_status_information         ; Retain status information across program restarts
     retain_nonstatus_information  1     ; Retain non-status information across program restarts     retain_nonstatus_information  1     ; Retain non-status information across program restarts
 +    notification_interval             ; Only send notifications on status change by default.
 +    is_volatile                   0
 +    check_period                  24x7
     normal_check_interval         5     normal_check_interval         5
     retry_check_interval          1     retry_check_interval          1
     max_check_attempts            4     max_check_attempts            4
 +    notification_period           24x7
 +    notification_options          w,u,c,r
 +    contact_groups                admins
     register                      0     ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE,     register                      0     ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE,
                                         ; JUST A TEMPLATE!                                         ; JUST A TEMPLATE!
Line 54: Line 60:
         name                            bacula-service         name                            bacula-service
         use                             passive-service         use                             passive-service
-        freshness_threshold             100800+        freshness_threshold             93600   ; 26 hours 
 +        max_check_attempts              1
         check_command                   return-critical         check_command                   return-critical
 +        notification_interval           1440
         register                        0         register                        0
 } }
 </file> </file>
 +
 +Due parametri i fondamentali da configurare. Il primo è **freshness_threshold**: aspettiamo fino a 26 ore di ricevere un check passivo, altrimenti si esegue un check attivo che ritorna uno stato CRITICAL. Il secondo parametro importante è **max_check_attempts** da impostarsi ad un valore molto basso, possibilmente 1; in questo modo lo //status type// diviene HARD al primo check fallito. Se si lasciasse il valore predefinito di max_check_attempts pari a 4 si avrebbe che per 26 * 4 = 104 ore il servizio risulta SOFT CRITICAL, e quindi mostrato in verde nel grafico del trend.
  
 Poi si aggiunge un finto host, che serve solo per raggruppare tutti i backup monitorati. Si può creare il file **''/etc/nagios3/conf.d/bacula_backups.cfg''**: Poi si aggiunge un finto host, che serve solo per raggruppare tutti i backup monitorati. Si può creare il file **''/etc/nagios3/conf.d/bacula_backups.cfg''**:
Line 101: Line 111:
 Se la pipe non esiste i comandi vengono accodati al file **''/var/run/nagios/nsca.dump''** e processati in seguito (Davvero? Non pare proprio! Come dovrebbe funzionare?). Se la pipe non esiste i comandi vengono accodati al file **''/var/run/nagios/nsca.dump''** e processati in seguito (Davvero? Non pare proprio! Come dovrebbe funzionare?).
  
 +===== Problema di versione =====
 +
 +Attenzione alla **versione del client e del server nsca**! Debian Squeeze (nsca 2.7.2) e Debian Wheezy (nsca 2.9.1) non sono compatibili, ma il messaggio di errore del server non è chiaro, con la crittografia attiva l'errore è:
 +
 +<code>
 +Dropping packet with invalid CRC32 - possibly due to client using wrong password or crypto algorithm?
 +</code>
 +
 +più comprensibile se la crittografia è disabilitata:
 +
 +<code>
 +Received invalid packet type/version from client - possibly due to client using wrong password or crypto algorithm?
 +</code>
 +
 +Per fortuna si trova il backport del pacchetto per Debian Squeeze.
 ===== Configurazione del client (Bacula) ===== ===== Configurazione del client (Bacula) =====
  
Line 125: Line 150:
  
 send_nsca -H 172.16.237.211 -c /etc/send_nsca.cfg <<END send_nsca -H 172.16.237.211 -c /etc/send_nsca.cfg <<END
-BACKUPS $1      $status $3+Bacula_backups    $1    $status    $3
 END END
 </code> </code>
doc/appunti/linux/sa/nagios_passivo.txt · Last modified: 2014/01/31 16:39 by niccolo