Help with configuring Nagios - server not appearing

Discussion in 'Server Operation' started by zetnsh, Nov 30, 2011.

  1. zetnsh

    zetnsh New Member

    Hi there,

    I'm an experienced server admin, but somehow managed to avoid Nagios... until now!

    The situation is that I have installed Nagios on an Ubuntu 10.04 LTS box to monitor 2 remote machines. I'm pretty sure all the firewalling there is OK to connect to NRPE on the remote machines, but I'm failing at a far more basic level - actually writing the config files!

    Here's what I have (IPs masked to protect the innocent...) - and obviously this is a subset of the config files, because that would be really boring...

    In
    Code:
    /etc/nagios3/nagios.cfg
    we have loads of stuff which includes some other files and directories, and in particular this:

    Code:
    # Debian uses by default a configuration directory where nagios3-common,
    # other packages and the local admin can dump or link configuration
    # files into.
    cfg_dir=/etc/nagios3/conf.d
    
    So in that directory I placed a file called (for the sake of argument)
    Code:
    my_server.cfg
    .

    The problem is nothing I do seems to make any new hosts appear in the web interface, and I don't know where to start. Help?

    For ref, here is the config file for my_server:

    Code:
    # A simple configuration file for monitoring the local host
    # This can serve as an example for configuring other servers;
    # Custom services specific to this host are added here, but services
    # defined in nagios2-common_services.cfg may also apply.
    #
    
    define host{
            use                     generic-host            ; Name of host template to use
            host_name               my_server
            alias                   my_server
            address                 10.11.12.13 ; Not the real IP obviously!
            }
    
    # 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                             generic-service         ; Name of service template to use
            host_name                       my_server
            service_description             Disk Space
            check_command                   check_all_disks!20%!10%
            }
    
    
    
    # Define a service to check the number of currently logged in
    # users on the local machine.  Warning if > 20 users, critical
    # if > 50 users.
    
    define service{
            use                             generic-service         ; Name of service template to use
            host_name                       my_server
            service_description             Current Users
            check_command                   check_users!20!50
            }
    
    
    # Define a service to check the number of currently running procs
    # on the local machine.  Warning if > 250 processes, critical if
    # > 400 processes.
    
    define service{
            use                             generic-service         ; Name of service template to use
            host_name                       my_server
            service_description             Total Processes
                    check_command                   check_procs!250!400
            }
    
    
    
    # Define a service to check the load on the local machine.
    
    define service{
            use                             generic-service         ; Name of service template to use
            host_name                       my_server
            service_description             Current Load
                    check_command                   check_load!5.0!4.0!3.0!10.0!6.0!4.0
            }
    
    Thanks in advance,

    Neil
     

Share This Page