progetti:cloud-areapd:swift_monitoring
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| progetti:cloud-areapd:swift_monitoring [2014/10/15 08:50] – bertocco@infn.it | progetti:cloud-areapd:swift_monitoring [2014/10/17 11:27] (current) – bertocco@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Nagios plugins for swift monitoring ====== | ||
| + | Sono stati implementati due tipi di verifica: | ||
| + | * **Verifiche dei processi**, cioe` verifiche che i processi necessari siano up. | ||
| + | * **Verifiche funzionali**, | ||
| + | |||
| + | Nel primo caso si e` utilizzato un il plugin check_procs installato con nagios-plugins-procs. | ||
| + | Nel secondo caso ho preso dei plugin distribuiti in [[http:// | ||
| + | In tutti i casi i comandi remoti sono lanciati usando il plugin check_nrpe. | ||
| + | |||
| + | Per completezza inserisco qui il codice e descrivo le modifiche. | ||
| + | |||
| + | ==== check_swift ==== | ||
| + | **Description: | ||
| + | |||
| + | * Codice originale {{: | ||
| + | |||
| + | * Codice modificato per ottenere la funzionalita` {{: | ||
| + | |||
| + | * Codice modificato per leggere i parametri da file di configurazione anziche` da linea di comando {{: | ||
| + | |||
| + | Questa soluzione evita di spargere qua e la le credenziali di accesso che in certi casi di errore venivano anche stampate (come parte del comando) nell' | ||
| + | |||
| + | | ||
| + | ==== check_swift_dispersion ==== | ||
| + | **Description: | ||
| + | |||
| + | * Codice originale {{: | ||
| + | | ||
| + | * Codice modificato {{: | ||
| + | |||
| + | Lo script originale usa lo script swift_dispersion il cui output in icehouse e` cambiato (altri se ne sono lamentati [[https:// | ||
| + | < | ||
| + | {" | ||
| + | " | ||
| + | </ | ||
| + | invece nella realta` e`: | ||
| + | < | ||
| + | {" | ||
| + | " | ||
| + | </ | ||
| + | cioe` mancano i missing_one _two _all che il plugin si aspetta. | ||
| + | |||
| + | Ho modificato il plugin in modo da fare il check solo su ' | ||
| + | |||
| + | ==== check_swift_object_servers ==== | ||
| + | |||
| + | **Description: | ||
| + | |||
| + | * Codice originale {{: | ||
| + | |||
| + | * Codice modificato per ottenere la funzionalita` {{: | ||
| + | * Vecchio comando: | ||
| + | < | ||
| + | swift-recon --objmd5 | ||
| + | </ | ||
| + | * Nuovo comando: | ||
| + | < | ||
| + | swift-recon --md5 | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ====== Configurazione del Nagios server host ====== | ||
| + | |||
| + | ==== Configurazione dei comandi ==== | ||
| + | **commands.cfg** [SL: / | ||
| + | |||
| + | * Configurazione del comando check_nrpe plugin. | ||
| + | Ho configurato molti parametri perche` nel caso di check_swift in versione parametrica, | ||
| + | |||
| + | < | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | * comandi per monitorare i processi swift con check_procs lanciato sull' | ||
| + | |||
| + | < | ||
| + | ### Check swift processes | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | * comandi per monitorare le funzionalita` di swift con check_procs lanciato sull' | ||
| + | |||
| + | < | ||
| + | ### Check swift functionalities | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Configurazione dei servizi per monitorare swift ==== | ||
| + | **swift_nodes.cfg** [SL: / | ||
| + | < | ||
| + | # ============ Define service base template ============= | ||
| + | define service{ | ||
| + | name swift-service | ||
| + | use | ||
| + | hostgroup_name | ||
| + | register | ||
| + | } | ||
| + | |||
| + | # ============ Define Swift Clusters ============ | ||
| + | |||
| + | # A list of nodes in a cluster | ||
| + | define hostgroup { | ||
| + | hostgroup_name | ||
| + | alias | ||
| + | members | ||
| + | } | ||
| + | |||
| + | define hostgroup { | ||
| + | hostgroup_name | ||
| + | alias | ||
| + | members | ||
| + | } | ||
| + | |||
| + | # ============ Define Swift Services ============== | ||
| + | |||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | define service { | ||
| + | service_description | ||
| + | check_command | ||
| + | use | ||
| + | notification_interval | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Configurazione del server nagios ==== | ||
| + | **nagios.cfg** [SL: / | ||
| + | |||
| + | * Se ci sono problemi di timeout aggiustare: | ||
| + | < | ||
| + | # TIMEOUT VALUES | ||
| + | # These options control how much time Nagios will allow various | ||
| + | # types of commands to execute before killing them off. Options | ||
| + | # are available for controlling maximum time allotted for | ||
| + | # service checks, host checks, event handlers, notifications, | ||
| + | # ocsp command, and performance data commands. | ||
| + | # seconds. | ||
| + | |||
| + | service_check_timeout=480 | ||
| + | host_check_timeout=300 | ||
| + | event_handler_timeout=300 | ||
| + | notification_timeout=300 | ||
| + | ocsp_timeout=150 | ||
| + | perfdata_timeout=150 | ||
| + | </ | ||
| + | |||
| + | * Per debuggare aiuta debug_level=2048 che nel file / | ||
| + | < | ||
| + | # DEBUG LEVEL | ||
| + | # This option determines how much (if any) debugging information will | ||
| + | # be written to the debug file. OR values together to log multiple | ||
| + | # types of information. | ||
| + | # Values: | ||
| + | # -1 = Everything | ||
| + | # 0 = Nothing | ||
| + | # 1 = Functions | ||
| + | # 2 = Configuration | ||
| + | # 4 = Process information | ||
| + | # 8 = Scheduled events | ||
| + | # 16 = Host/ | ||
| + | # 32 = Notifications | ||
| + | # 64 = Event broker | ||
| + | # 128 = External commands | ||
| + | # 256 = Commands | ||
| + | # 512 = Scheduled downtime | ||
| + | # 1024 = Comments | ||
| + | # 2048 = Macros | ||
| + | |||
| + | debug_level=2048 | ||
| + | </ | ||
| + | |||
| + | Alla fine non dimenticare che per attivare le modifiche di configurazione devi restartare l'nrpe server, in SL: | ||
| + | < | ||
| + | service nagios restart | ||
| + | </ | ||
| + | ====== Installazione e configurazione del plugin nagios nrpe sull' | ||
| + | == Installazione == | ||
| + | * Su SL: | ||
| + | < | ||
| + | yum install nagios-plugins-nrpe | ||
| + | </ | ||
| + | * Su Ubuntu: | ||
| + | < | ||
| + | sudo apt-get install nagios-nrpe-server nagios-plugins | ||
| + | </ | ||
| + | |||
| + | == Configurazione == | ||
| + | **/ | ||
| + | |||
| + | * Definizione dei comandi | ||
| + | < | ||
| + | ######### | ||
| + | # Swift # | ||
| + | ######### | ||
| + | # Swift processes checks | ||
| + | command[check_swift-proxy-server]=/ | ||
| + | command[check_swift-object-server]=/ | ||
| + | command[check_swift-object-auditor]=/ | ||
| + | command[check_swift-object-replicator]=/ | ||
| + | command[check_swift-object-updater]=/ | ||
| + | command[check_swift-account-server]=/ | ||
| + | command[check_swift-account-auditor]=/ | ||
| + | command[check_swift-account-replicator]=/ | ||
| + | command[check_swift-account-reaper]=/ | ||
| + | command[check_swift-container-server]=/ | ||
| + | command[check_swift-container-auditor]=/ | ||
| + | command[check_swift-container-replicator]=/ | ||
| + | command[check_swift-container-updater]=/ | ||
| + | command[check_swift-container-sync]=/ | ||
| + | command[check_rsync]=/ | ||
| + | # Swift functionalities checks | ||
| + | # | ||
| + | command[check_swift]=/ | ||
| + | command[check_swift_1]=/ | ||
| + | command[check_swift_dispersion]=/ | ||
| + | command[check_swift_object_servers]=/ | ||
| + | </ | ||
| + | * Per fare in modo che check_nrpe accetti piu` argomenti | ||
| + | < | ||
| + | # COMMAND ARGUMENT PROCESSING | ||
| + | # This option determines whether or not the NRPE daemon will allow clients | ||
| + | # to specify arguments to commands that are executed. | ||
| + | # if the daemon was configured with the --enable-command-args configure script | ||
| + | # option. | ||
| + | # | ||
| + | # *** ENABLING THIS OPTION IS A SECURITY RISK! *** | ||
| + | # Read the SECURITY file for information on some of the security implications | ||
| + | # of enabling this variable. | ||
| + | # | ||
| + | # Values: 0=do not allow arguments, 1=allow command arguments | ||
| + | |||
| + | dont_blame_nrpe=1 | ||
| + | </ | ||
| + | * Per operazioni di debug (output nel syslog) | ||
| + | < | ||
| + | # DEBUGGING OPTION | ||
| + | # This option determines whether or not debugging messages are logged to the | ||
| + | # syslog facility. | ||
| + | # Values: 0=debugging off, 1=debugging on | ||
| + | |||
| + | debug=1 | ||
| + | </ | ||
| + | * Se il plugin va in timeout, correggere | ||
| + | < | ||
| + | # COMMAND TIMEOUT | ||
| + | # This specifies the maximum number of seconds that the NRPE daemon will | ||
| + | # allow plugins to finish executing before killing them off. | ||
| + | |||
| + | command_timeout=300 | ||
| + | </ | ||
| + | |||
| + | Alla fine non dimenticare che per attivare le modifiche di configurazione devi restartare l'nrpe server: | ||
| + | < | ||
| + | / | ||
| + | </ | ||
