O nagios3 pode gerar automaticamente um mapa de rede?

5

Acabei de instalar o nagios3 no Ubuntu Server 10.04. Uma instalação limpa. Todos os plugins instalados.

O mapa de status nagios só tem localhost e gateway descobertos. Existe uma maneira de verificar a nossa rede, juntamente com todos os servidores Windows, roteadores, etc?

Não consigo encontrar nenhuma maneira automatizada de fazer isso.

Nossa rede é uma grande rede escolar, então a configuração manual é difícil.

    
por nLinked 24.06.2011 / 14:34

3 respostas

1

Já experimentou o plug-in check_find_new_hosts ? Você pode descobrir como ele funciona no arquivo aqui em anexo. p>

usage:
check_find_new_hosts [-v+] [-x] [-s] /dir ip netmask contact

where:
dir is the directory containing the .cfg files (and .skip files if you want to skip certain hosts)
ip is an ip in the range you want to scan
netmask is an integer standing for the netmask eg:24 = 255.255.255.0
contact is the contact group you want new hosts found to answer to.

example:
./check_find_new_hosts -v /etc/nagios/network 192.168.10.129 25 domain-admins


when troubleshooting how this is working use -vv or -vvv from a command line
for more information consult the very very verbose help (may want to | less on a small screen):
./check_find_new_hosts -vvvh

----------------------------------------------------------------------------------------------------------------------------------------
check_find_new_hosts requires the following (that I know of):

1)  fping is installed at /usr/sbin/fping
2)  traceroute is installed at /usr/sbin/traceroute
3)  Nagios must parse a directory of cfg files, rather than implicitly listing the files eg:

    cfg_dir=/etc/nagios/hosts_hostgroups_and_services
    rather than:
    #cfg_file=/etc/nagios/contactgroups.cfg
    #cfg_file=/etc/nagios/contacts.cfg
    #cfg_file=/etc/nagios/dependencies.cfg
    #cfg_file=/etc/nagios/escalations.cfg
    #cfg_file=/etc/nagios/hostgroups.cfg
    ...
4)  the service generic_service must be defined (the following is what I use):

define service{
    name                generic-service ; The 'name' of this service template, referenced in other service definitions
    active_checks_enabled       1   ; Active service checks are enabled
    passive_checks_enabled      1   ; Passive service checks are enabled/accepted
    parallelize_check       1   ; Active service checks should be parallelized (disabling this can lead to major performance problems)
    obsess_over_service     1   ; We should obsess over this service (if necessary)
    check_freshness         0   ; Default is to NOT check service 'freshness'
    notifications_enabled       1   ; Service notifications are enabled
    event_handler_enabled       1   ; Service event handler is enabled
    flap_detection_enabled      1   ; Flap detection 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

    register            0   ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
    }

5)  the 24x7 time period should be defined

define timeperiod{
    timeperiod_name 24x7
    alias       24 Hours A Day, 7 Days A Week
    sunday      00:00-24:00
    monday      00:00-24:00
    tuesday     00:00-24:00
    wednesday   00:00-24:00
    thursday    00:00-24:00
    friday      00:00-24:00
    saturday    00:00-24:00
    }

6) a contact group is defined
7) the network that is being looked at can be pinged

----------------------------------------------------------------------------------------------------------------------------------------

This check would be installed as multiple commands(one for every subnet) and can then be added as a check to whatever host makes the most sense to have it on(I have it as a check on the Nagios host machine)

For example, if you wanted to check the network 192.168.0.x (let's say your servers) and all you host and service definitions (at least all of them for this subnet) are in the directory /etc/nagios/network and the contact group you are using is "admins" you would need the following:

define command{
    command_name    check_find_new_hosts_servers
    command_line    /usr/lib/nagios/plugins/contrib/check_find_new_hosts -v /etc/nagios/network 192.168.0.0 24 admins
    }

if you also wanted to check 192.168.10.[129-255] (how about these are your domain controllers) with the contact group "domain-admins":

define command{
    command_name    check_find_new_hosts_domain
    command_line    /usr/lib/nagios/plugins/contrib/check_find_new_hosts -v /etc/nagios/network 192.168.10.129 25 domain-admins
    }


You would also need services defined to check these:

define service{
    use         generic-service
    host_name       main-server-router
    service_description FIND_NEW_HOSTS
    is_volatile     0
    check_period        24x7
    max_check_attempts  3
    normal_check_interval   5
    retry_check_interval    1
    contact_groups      admins
    notification_interval   120
    notification_period 24x7
    notification_options    c,r
    check_command       check_find_new_hosts_servers
    }

define service{
    use         generic-service
    host_name       main-domain-controller
    service_description FIND_NEW_HOSTS
    is_volatile     0
    check_period        24x7
    max_check_attempts  3
    normal_check_interval   5
    retry_check_interval    1
    contact_groups      domain-admins
    notification_interval   120
    notification_period 24x7
    notification_options    c,r
    check_command       check_find_new_hosts_domain
    }

----------------------------------------------------------------------------------------------------------------------------------------
once run it may generate the following files (so either run it and generate these files or steer away from them):
x.y.cfg where x.y is from the ip address of the host found: 192.168.15.32 would be put in 15.32.cfg
name.cfg where name is from the fdqn: freddy.mybuddy.com would be put in freddy.cfg
nagios_hostgroup_unknown.cfg (expects this file either to not exist or to contain 1 hostgroup):

define hostgroup {
    hostgroup_name      undefined
    alias           Non-Configured
    members         freddy,betsy,bob,...
    }


use "--nowrite --stdout" ( -xs ) as a command line option to write these to stdout instead of to files if you just want to test it or
use -vvx to show what it is doing but don't write any files and don't show the files on stdout
    
por Lucas Kauffman 03.03.2012 / 00:49
0

Não, se você precisar de descoberta automática, tente o Zenoss.

fonte: link

O Nagios não tem descoberta automática.

    
por cprofitt 02.03.2012 / 20:37
0

É um pouco fora do assunto ..... se for descoberta automática e / ou criar uma ação depois de descobrir isso, isso será mais adequado do que nagios:

link

Em vez de preencher nagios com plugins que funcionarão ou não: por que não usar algo que tenha em seu núcleo?

    
por Antoine Rodriguez 05.03.2012 / 21:47