Strumenti Utente

Strumenti Sito


nagios_http_nrpe_event_handler

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
nagios_http_nrpe_event_handler [2014/06/23 10:26] silenxnagios_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:\\ 
-<code> 
-#!/bin/sh 
-service apache2 stop 
-service apache2 start 
-</code> 
-//salvarlo come /etc/nagios/restart-http.sh// \\ 
- 
-impostare il comando:\\ 
-<code> 
-##On Event- HTTP CRASH - Restart - nrpe event handler 
-command[restart_httpd]=sh /etc/nagios/restart-http.sh 
-</code> 
-Dare i permessi all'utente "nagios" in sudoers: \\ 
-<code> 
-nagios  ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/  
-nagios  ALL=(ALL) NOPASSWD: /usr/bin/service  
-</code> 
-**Nagios Server:**\\ 
-Impostare il servizio come segue:\\ 
-<code> 
- 
-define service{  
- 
-        host_name                  UbuntuFront  
-        service_description             HTTPD  
-        check_command                   check_http  
- max_check_attempts 4  
- event_handler restart-httpd!$SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$  
-        use                             generic-service,nagiosgraph  
-        notification_interval           0 ; set > 0 if you want to be renotified  
- 
-</code> 
-Impostare il comando:\\ 
-<code> 
-define command{  
-        command_name    restart-httpd  
-        command_line    sh /etc/nagios3/conf.d/event-command/restart-http.sh $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $HOSTADDRESS$  
-        }   
-        </code> 
-        
-Ed ora lo script, da rendere poi eseguibile con chmod +x restart-http.sh \\ 
-<code> 
-case "$1" in 
-OK) 
- ;; 
-WARNING) 
- ;; 
- 
-UNKNOWN) 
- ;; 
- 
-CRITICAL)  
- case "$2" in 
- SOFT)  
- case "$3" in 
- 3) 
- echo -n "Restarting HTTP service (3rd soft critical state)..." 
- /usr/lib/nagios/plugins/check_nrpe -H $4 -c restart_httpd 
- ;; 
- esac 
- ;; 
- 
- HARD) 
- case "$3" in 
- 4) 
- echo -n "Restarting HTTP service..."  
- /usr/lib/nagios/plugins/check_nrpe -H $4 -c restart_httpd  
- ;;  
- esac 
- ;;  
-esac 
-;; 
-esac 
-exit 0 
-</code> 
-\\ 
-FINE 
  
nagios_http_nrpe_event_handler.1403512007.txt.gz · Ultima modifica: (modifica esterna)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki