Kann nagios3 automatisch eine Netzwerkkarte erstellen?

Habe gerade nagios3 auf Ubuntu Server 10.04 installiert. Eine saubere Installation. Alle Plugins installiert.

In der Nagios-Statuskarte wurden nur localhost und gateway erkannt. Gibt es eine Möglichkeit, unser Netzwerk zusammen mit allen Windows-Servern, Routern usw. zu scannen?

Ich kann keinen automatisierten Weg finden, dies zu tun.

Unser Netzwerk ist ein großes Schulnetzwerk, daher ist die manuelle Konfiguration schwierig.


Haben Sie versucht check_find_new_hosts Plugin? Die Funktionsweise finden Sie in der beigefügten Readme hier .

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

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 =
contact is the contact group you want new hosts found to answer to.

./check_find_new_hosts -v /etc/nagios/network 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:

    rather than:
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


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 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 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: would be put in 15.32.cfg
name.cfg where name is from the fdqn: 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
Lucas Kauffman

Nein, wenn Sie eine automatische Erkennung benötigen, sollten Sie Zenoss ausprobieren.


Nagios hat keine automatische Erkennung.


Es ist ein wenig aus dem Thema ..... Wenn es sich um eine automatische Erkennung handelt und/oder eine Aktion nach der Erkennung erstellt wird, ist dies geeigneter als Nagios:

Anstatt Nagios mit Plugins zu füllen, die funktionieren oder nicht funktionieren: Warum nicht etwas verwenden, das es im Kern hat?