Strona 1 z 1

nagios i dodanie serwera www

: 24 października 2009, 17:30
autor: pracochlik
Witam.
Mam pewien problem z dodanie serwera www do nagiosa,

Dodałem wstępną konfigurację do nagiosa:
- utworzyłem plik web.cfg i dodałem go do nagios.cfg.

Podczas restartu nagiosa pojawia mi się taki błąd:

Kod: Zaznacz cały

Starting nagios:CONFIG ERROR!  Start aborted.  Check your Nagios configuration.
W logach nic nie ma.

Mój plik web.cfg:

Kod: Zaznacz cały

#####################################################
# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
#
# Last Modified: 05-31-2007
#
# NOTE: This config file is intended to serve as an *extremely* simple
#       example of how you can create configuration entries to monitor
#       the local (Linux) machine.
#
#####################################################




#####################################################
#####################################################
# HOST DEFINITION
#
#####################################################
#####################################################

# Define a host for the local machine

define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               WWW
        alias                   web
        address                 10.10.100.2
        }

#####################################################
#####################################################
#
# HOST GROUP DEFINITION
#
#####################################################
#####################################################

# Define an optional hostgroup for Linux machines

define hostgroup{
        hostgroup_name  linux-servers ; The name of the hostgroup
        alias           Linux Servers ; Long name of the group
 members         web     ; Comma separated list of hosts that belong to this group
        }



#####################################################
#####################################################
#
# SERVICE DEFINITIONS
#
#####################################################
#####################################################


# Define a service to "ping" the local machine

define service{
        use                             local-service         ; Name of service template to use
        host_name                       WWW
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        }


# Define a service to check the disk space of the root partition
# on the local machine.  Warning if < 20% free, critical if
# < 10% free space on partition.

define service{
        use                             local-service         ; Name of service template to use
        host_name                       WWW
        service_description             Root Partition
        check_command                   check_local_disk!20%!10%!/
# Define a service to check the number of currently running procs
# on the local machine.  Warning if > 250 processes, critical if
# > 400 users.

define service{
        use                             local-service         ; Name of service template to use
        host_name                       localhost
        service_description             Total Processes
        check_command                   check_local_procs!250!400!RSZDT
        }



# Define a service to check the load on the local machine.

define service{
        use                             local-service         ; Name of service template to use
        host_name                       WWW
        service_description             Current Load
        check_command                   check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
        }



# Define a service to check the swap usage the local machine.
# Critical if less than 10% of swap is free, warning if less than 20% is free

define service{
        use                             local-service         ; Name of service template to use
        host_name                       WWW
        service_description             Swap Usage
        check_command                   check_local_swap!20!10
# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.

define service{
        use                             local-service         ; Name of service template to use
        host_name                       WWW
        service_description             SSH
        check_command                   check_ssh
        notifications_enabled           0
        }



# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.

define service{
        use                             local-service         ; Name of service template to use
        host_name                       WWW
        service_description             HTTP
        check_command                   check_http
        notifications_enabled           0
        }
Jest to plik localhost.cfg tylko zmienione dane na mój serwer, chciałem pokombinować i sobie go dostosować do swoich potrzeb ale poległem bardzo szybko. Czy ktoś mógłby pokazać swój plik cfg chciałbym zobaczyć jak macie to skonfigurowane.

Od razu zapytam do komunikacji między serwerem a klientem używacie ssh czy nrpe?

[ Dodano: 2009-10-27, 11:45 ]
czy ktoś może mi pomóc lub naprowadzić na rozwiązanie mojego problemu

[ Dodano: |1 Lis 2009|, 2009 17:22 ]
A czy może ktoś zna fajnego how-to jak dodać nową maszynę do nagiosa

: 01 listopada 2009, 19:30
autor: czarownik

: 01 listopada 2009, 19:36
autor: Redhead
Robiłem ostatnio Nagiosa na Debianie Lenny amd64 i wszystko używałem z repozytoriów.
Nie ma sensu się bawić z kompilowanie. Wszystko działa od ręki, tylko trzeba wiedzieć za co się brać.
Polecam stronę domową i trochę poczytać.

: 01 listopada 2009, 20:56
autor: czarownik
Tez korzystałem z repozytorium, ale ten artykuł pomógł mi sobie wszystko w głowie poukładać.

: 17 sierpnia 2010, 23:34
autor: linux_001
Witam.
Ja mam takie może mniej typowe pytanie, a raczej prośbę, czy ktoś byłby tak uprzejmy i zrobił kilka zrzutów ekranów Nagiosa i przesłał mi na maila linux_001@wp.pl. Z góry wielkie podziękowania.

: 18 sierpnia 2010, 15:54
autor: Unit
2 style, które wyglądają dość przyzwoicie: Do testowania konfiguracji przed restartem nagios-a:

Kod: Zaznacz cały

nagios -v nagios.cfg
Można troche poszperać po sieci i np. znaleźć przykładowe demo:
http://nagios.demo.netways.de/ ( dane dostępowe - guest/guest)

Co do samego zarządzania nagiosem można użyć gotowych narzędzi takich jak nagiosql, nagiosadmin.