Definicja hosta w Nagios 3

Z Thomas-Krenn-Wiki
Przejdź do nawigacji Przejdź do wyszukiwania

Artykuł ten pokazuje definicję hosta w Nagios 3. W przykładowym środowisku pracuje Nagios 3.0.6 pod Debianem 5.0.

Definicja hosta

W definicji hosta muszą zostać koniecznie uwzględnionych kilka parametrów. W dokumentacji Nagios parametry te są zaznaczone na czerwono.[1] Podczas instalacji oprogramowania Nagios w Debianie 5.0 Lenny niektóre z tych parametrów są zdefiniowane w szablonie generic-host. Przez co nowa definicja hosta może być bardzo krótka:

define host {
        host_name   host-sr108
        alias       Host SR108
        address     10.10.20.122
        use         generic-host
        _ipmi_ip    10.10.20.121
        }

Zapisujemy te definicje po prostu w nowym pliku /etc/nagios3/conf.d/host-sr108. W katalogu conf.d jest automatycznie wyszukiwana konfiguracja.

Poszczególne parametry mają następujące znaczenie:

  • host_name: nazwa hosta w konfiguracji
  • alias: alias hosta, jest wyświetlany w szczegółach hosta w interfejsie webowym Nagios
  • address: adres IP hosta
  • use: nazwa wykorzystywanego szablonu
  • _ipmi_ip: chodzi tu o Custom Object Variable.[2] Wykorzystywany przez nas dla adresu IP interfejsu IPMI.

Szablon generic-host

W /etc/nagios3/conf.d/generic-host_nagios2.cfg jest zdefiniowany szablon generic-host:

# Generic host definition template - This is NOT a real host, just a template!

define host{
        name                            generic-host    ; The name of this host template
        notifications_enabled           1       ; Host notifications are enabled
        event_handler_enabled           1       ; Host event handler is enabled
        flap_detection_enabled          1       ; Flap detection is enabled
        failure_prediction_enabled      1       ; Failure prediction is enabled
        process_perf_data               1       ; Process performance data
        retain_status_information       1       ; Retain status information across program restarts
        retain_nonstatus_information    1       ; Retain non-status information across program restarts
                check_command                   check-host-alive
                max_check_attempts              10
                notification_interval           0
                notification_period             24x7
                notification_options            d,u,r
                contact_groups                  admins
        register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
        }

Odnośniki

Powiązane artykuły

Modem CEP CT63
Plugin Icinga NRPE
Pluginy monitorujące dla serwera Thomas-Krenn