Unable to see second host in Nagios server

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jim
Posts: 37
Joined: Wed Jun 08, 2016 11:18 am

Unable to see second host in Nagios server

Post by jim »

Hi Al,

Followed same set of instructions on another host (Xubuntu 16.04) but it seems that is not visible in Nagios Server.

Here is a quick snapshot of nagios server hosts.cfg and services.cfg file.

Code: Select all

   [root@agent2 etc]# cat hosts.cfg
    ## Default Linux Host Template ##
    define host{
    name                            linux-box               ; Name of this template
    use                             generic-host            ; Inherit default values
    check_period                    24x7        
    check_interval                  5       
    retry_interval                  1       
    max_check_attempts              10      
    check_command                   check-host-alive
    notification_period             24x7    
    notification_interval           30      
    notification_options            d,r     
    contact_groups                  admins  
    register                        0                       ; DONT REGISTER THIS - ITS A TEMPLATE
    }
    
    ## Default
    define host{
    use                             linux-box               ; Inherit default values from a template
    host_name                       jim-Ubuntu1504                  ; The name we're giving to this server
    alias                           Ubuntu 16.04               ; A longer name for the server
    address                         192.168.1.2          ; IP address of Remote Linux host
    }
    
    ## Default
    define host{
    use                             linux-box               ; Inherit default values from a template
    host_name                       jim-VirtualBox          ; The name we're giving to this server
    alias                           Xubuntu 16.04               ; A longer name for the server
    address                         192.168.1.11          ; IP address of Remote Linux host
    [root@agent2 etc]# 
services.cfg

Code: Select all

    [root@agent2 etc]# cat services.cfg 
    define service{
            use                     generic-service
            host_name               jim-Ubuntu1504
            service_description     CPU Load
            check_command           check_nrpe!check_load
            }
    define service{
            use                     generic-service
            host_name               jim-Ubuntu1504
            service_description     Total Processes
            check_command           check_nrpe!check_total_procs
            }
    define service{
            use                     generic-service
            host_name               jim-Ubuntu1504
            service_description     Current Users
            check_command           check_nrpe!check_users
            }
    define service{
            use                     generic-service
            host_name               jim-Ubuntu1504
            service_description     SSH Monitoring
            check_command           check_nrpe!check_ssh
            }
    define service{
            use                     generic-service
            host_name               jim-Ubuntu1504
            service_description     FTP Monitoring
            check_command           check_nrpe!check_ftp
            }
    
    define service{
            use                     generic-service
            host_name                jim-VirtualBox
            service_description     CPU Load
            check_command           check_nrpe!check_load
            }
    define service{
            use                     generic-service
            host_name                jim-VirtualBox
            service_description     Total Processes
            check_command           check_nrpe!check_total_procs
            }
    define service{
            use                     generic-service
            host_name                jim-VirtualBox
            service_description     Current Users
            check_command           check_nrpe!check_users
            }
    define service{
            use                     generic-service
            host_name                jim-VirtualBox
            service_description     SSH Monitoring
            check_command           check_nrpe!check_ssh
            }
    define service{
            use                     generic-service
            host_name                jim-VirtualBox
            service_description     FTP Monitoring
            check_command           check_nrpe!check_ftp
            }
    [root@agent2 etc]# 
Not sure what is happening because of which Xubuntu(jim-Virtualbox) is not be able to be seen in Nagios server.

Any help would be very much appreciated.

P.S: NRPE is running on agent.

Code: Select all

    root@jim-VirtualBox:/tmp/nagios-plugins-2.1.1/nrpe-2.15# netstat -nap|grep nrpe
    tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN      11019/nrpe      
    tcp6       0      0 :::5666                 :::*                    LISTEN      11019/nrpe      
    unix  2      [ ]         DGRAM                    46618    11019/nrpe          
    root@jim-VirtualBox:/tmp/nagios-plugins-2.1.1/nrpe-2.15# 
    root@jim-VirtualBox:/tmp/nagios-plugins-2.1.1/nrpe-2.15#
jim
Posts: 37
Joined: Wed Jun 08, 2016 11:18 am

Re: Unable to see second host in Nagios server

Post by jim »

Well, it seems nagios server is not collection information from agent as there is no information about second agent in status.dat. What could be the reason for that ?
jim
Posts: 37
Joined: Wed Jun 08, 2016 11:18 am

Re: Unable to see second host in Nagios server

Post by jim »

Moderator, Please close this thread. Problem identified and resolved. Closing brace in hosts.cfg was missing which caused it not to detect. There is another issue but I would investigate that separately.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Unable to see second host in Nagios server

Post by mcapra »

Thanks for sharing your solution! Closing this.
Former Nagios employee
https://www.mcapra.com/
Locked