I've successfully set up a Nagios Server with the Nagios Core and Nagios Plugins but I'm struggling to see a new host I've added (other than the localhost) in the web interface.
I've trawled the web to find a solution and have tried everything there is but starting to run out of things to try to get this working.
I can access the web interface and view all the pages in the navigation (no authorised access errors showing). I've set up the server with Nginx and PHP-FPM, running on Ubuntu 14.04. I've added the server IP address in the allowed_hosts and only_from configuration files (both on this server and the remote host). It's also worth noting the nrpe service is running via xinetd. And I have used comma separated values for the allowed_hosts and space separated values for only_from.
I can run a nrpe check on the server (when SSHd in) which would suggest the Nagios server is speaking to the client (I've changed the actual IP address to xxx values):
Code: Select all
root@server:/# /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xxx.xxx
NRPE v2.13Code: Select all
root@server:/# /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xxx.xxx -c check_load
OK - load average: 0.60, 0.60, 0.52|load1=0.600;13.000;20.000;0; load5=0.600;13.000;20.000;0; load15=0.520;13.000;20.000;0;I also see the following results when running a configuration check:
Code: Select all
root@server:/# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 16 services.
Checked 2 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 25 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
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 checkAfter every configuration change I restart both nrpe and nagios like so:
Code: Select all
sudo service xinetd restart
sudo service nagios restartI have also checked the number of processes running (to ensure there aren't two instances of Nagios running):
Code: Select all
root@server:/# ps aux | grep nagios
nagios 4473 0.0 0.1 31720 10912 ? Ss 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios -d /etc/nagios/nagios.cfg
nagios 4474 0.0 0.0 10828 2432 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4475 0.0 0.0 10828 2472 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4476 0.0 0.0 10828 2436 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4477 0.0 0.0 10828 2336 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4478 0.0 0.0 10828 2468 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4479 0.0 0.0 10828 2488 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4480 0.0 0.0 10828 2424 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4481 0.0 0.0 10828 2496 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4482 0.0 0.0 10828 2392 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4483 0.0 0.0 10828 2348 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4484 0.0 0.0 10828 2440 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4485 0.0 0.0 10828 2360 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 4486 0.0 0.0 31204 1592 ? S 10:12 0:00 /usr/local/nagios-4.1.1/bin/nagios -d /etc/nagios/nagios.cfg
root 5382 0.0 0.0 11756 2328 pts/0 S+ 11:04 0:00 grep --color=auto nagiosCode: Select all
define host {
use linux-server
host_name iguana
alias Iguana
address xxx.xxx.xxx.xxx
}Code: Select all
define service {
use generic-service
host_name iguana
service_description CPU Load
check_command check_nrpe!check_load
}
define service {
use generic-service
host_name iguana
service_description Total Processes
check_command check_nrpe!check_total_procs
}
define service {
use generic-service
host_name iguana
service_description Current Users
check_command check_nrpe!check_users
}
define service {
use generic-service
host_name iguana
service_description SSH Monitoring
check_command check_nrpe!check_ssh
}
define service {
use generic-service
host_name iguana
service_description FTP Monitoring
check_command check_nrpe!check_ftp
}Code: Select all
# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
# New configuration files added here:
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/services.cfg
The part I'm confused about is the configuration check shows it's picked up the host and the NRPE check shows the Nagios Sever can indeed speak to the client and return a result. If that's all successful, how come it's not showing up in the web interface? Is there any other checks I can do? There's nothing obvious from what I can see anywhere else and there's nothing in the logs about not being able to communicate with the external server.
Any ideas?