Remote Host Does Not Appear in Web Interface

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
tcicirello
Posts: 7
Joined: Thu Jan 20, 2011 5:36 pm

Remote Host Does Not Appear in Web Interface

Post by tcicirello »

I am new to Nagios and am having difficulty getting a remote host to display in the web interface. The local host and preconfigured services display just fine. My monitoring server is running Open SUSE 11.3 with Nagios installed from the distribution media and the machine is patched current. The remote host is also an Open SUSE 11.3 machine with NRPE and NRPE Plug-ins installed.

I follwoed the manuals for installing NAgios and NRPE and the manual checks run fine. The check of configuration for Nagios yields this output:
# nagios -v ../nagios.cfg

Nagios Core 3.2.1
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-09-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Checked 8 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 25 commands.
Checking time periods...
Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

A manual check of the remote host yields this output:
# /usr/lib/nagios/plugins/check_nrpe -H target -c check_users
USERS OK - 3 users currently logged in |users=3;5;10;0

Commands.cfg was modified thusly:
# 'check_nrpe' command definition
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

I created a template file for monitoring Linux hosts using the pattern in templates.cfg Its contents are:
define host{
name linux-template ; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
check_interval 5 ; Actively check the host every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute intervals
max_check_attempts 10 ; Check each Linux host 10 times (max)
check_command check-host-alive ; Default command to check Linux hosts
notification_period 24x7 ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contact_groups admins ; Notifications get sent to the admins by default
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

I also created a cfg file for the remote host named target. (Not original but functional anyway.)
# Define monitored host
define host{
use linux-template ;Inherit default valuses from Linux template
host_name target ;Server to be monitored
alias target
address 10.1.10.10
register 1
}

# Define services to be monitored
# CPU Load service definition
define service{
use generic-service ;Service provided as part of nrpe.cfg
host_name target
service_description CPU Load
check_command check_nrpe!check_load
}

# Current Users service definitions
define service{
use generic-service
host_name target
service_descriptiom Current Users
check_command check_nrpe!check_users
}


# Total Processes service definitions
define service{
use generic-service
host_name target
service_descriptiom Total Processes
check_command check_nrpe!check_total_procs
}

Any help would be appreciated.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Remote Host Does Not Appear in Web Interface

Post by mguthrie »

Nagios needs to be restarted anytime you want to change the configuration. Did you restart the nagios daemon after verifying?
tcicirello
Posts: 7
Joined: Thu Jan 20, 2011 5:36 pm

Re: Remote Host Does Not Appear in Web Interface

Post by tcicirello »

Yes, I did. I found that I hadn't added the new config files to nagios.cfg and that fixed the problem. Thanks. ;)
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Remote Host Does Not Appear in Web Interface

Post by mguthrie »

Good deal. You can also include directories instead of individual files, and I would recommend creating a "hosts" and a "services" directory for all of your new configs, and then including those directories in the main nagios.cfg. That way you don't have to manually add each file every time you add a new host or service.
Locked