nagios_http_nrpe_event_handler
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 | ||
| nagios_http_nrpe_event_handler [2014/06/22 22:30] – silenx | nagios_http_nrpe_event_handler [Data sconosciuta] (versione attuale) – eliminata - modifica esterna (Data sconosciuta) 127.0.0.1 | ||
|---|---|---|---|
| Linea 1: | Linea 1: | ||
| - | **Nagios NRPE Event Handler** \\ | ||
| - | |||
| - | Appunti per Event Handler\\ | ||
| - | in questo esempio prendiamo: | ||
| - | 1) **server nagios che monitora servizio http su macchina remota**\\ | ||
| - | 2) **ubuntu server remoto con apache2 ( 2.4.7 ) con nrpe server**\\ | ||
| - | Impostare quanto segue su ubuntu server http, nrpe ( il server DA monitorare ):\\ | ||
| - | creare un semplice script del tipo:\\ | ||
| - | <WRAP round box> | ||
| - | #!/bin/sh\\ | ||
| - | service apache2 stop\\ | ||
| - | service apache2 start\\ | ||
| - | salvarlo come / | ||
| - | </ | ||
| - | impostare il comando:\\ | ||
| - | <WRAP round box> | ||
| - | ##On Event- HTTP CRASH - Restart - nrpe event handler\\ | ||
| - | command[restart_httpd]=sh / | ||
| - | </ | ||
| - | Dare i permessi all' | ||
| - | <WRAP round box> | ||
| - | nagios | ||
| - | nagios | ||
| - | </ | ||
| - | **Nagios Server:**\\ | ||
| - | Impostare il servizio come segue:\\ | ||
| - | < | ||
| - | |||
| - | define service{ | ||
| - | |||
| - | host_name | ||
| - | service_description | ||
| - | check_command | ||
| - | max_check_attempts 4 | ||
| - | event_handler restart-httpd!$SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$ | ||
| - | use | ||
| - | notification_interval | ||
| - | } | ||
| - | </ | ||
| - | Impostare il comando:\\ | ||
| - | < | ||
| - | define command{ | ||
| - | command_name | ||
| - | command_line | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | Ed ora lo script, da rendere poi eseguibile con chmod +x restart-http.sh \\ | ||
| - | < | ||
| - | case " | ||
| - | OK) | ||
| - | ;; | ||
| - | WARNING) | ||
| - | ;; | ||
| - | |||
| - | UNKNOWN) | ||
| - | ;; | ||
| - | |||
| - | CRITICAL) | ||
| - | case " | ||
| - | SOFT) | ||
| - | case " | ||
| - | 3) | ||
| - | echo -n " | ||
| - | / | ||
| - | ;; | ||
| - | esac | ||
| - | ;; | ||
| - | |||
| - | HARD) | ||
| - | case " | ||
| - | 4) | ||
| - | echo -n " | ||
| - | / | ||
| - | ;; | ||
| - | esac | ||
| - | ;; | ||
| - | esac | ||
| - | ;; | ||
| - | esac | ||
| - | exit 0 | ||
| - | </ | ||
| - | \\ | ||
| - | FINE | ||
nagios_http_nrpe_event_handler.1403469058.txt.gz · Ultima modifica: (modifica esterna)
