Nagios web interface isn't using the configuration files

This forum is intended for the discussion of Nagios Core development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagios-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Nagios web interface isn't using the configuration files

Postby Frodogus » Sun Jan 21, 2018 9:14 am

I want put my own configuration in the Nagios Core 4.3.4.

I have the following setting in Nagios:

    /usr/local/nagios/etc/nagios.cfg
cfg_file=/usr/local/nagios/etc/objects/newhost.cfg
cfg_dir=/usr/local/nagios/etc/servers


    /usr/local/nagios/etc/servers/ubuntu_host.cfg
define host {
use linux-server
host_name ubuntu_host
alias Ubuntu Host
address 192.168.1.10
register 1
}


    /usr/local/nagios/etc/objects/newhost.cfg
# Define a host for the local machine
define host{
use linux-server
host_name google.com
alias google.com
address http://www.google.com
}

# Define a service to "ping" the local machine
define service{
use generic-service
host_name google.com
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}

define service{
use generic-service
host_name google.com
service_description HTTP
check_command check_http
notifications_enabled 0
}


    The configuration validation is OK and it display 3 hosts:
Running pre-flight check on configuration data...
Checking objects...
Checked 7 services.
Checked 3 hosts.
Checked 0 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 3 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


I restarted nrpe service, nargios service and httpd service.

But Nargios Web Interface display the same information.
Image
Image
Frodogus
 
Posts: 2
Joined: Sat Jan 20, 2018 3:47 pm

Re: Nagios web interface isn't using the configuration files

Postby dwhitfield » Mon Jan 22, 2018 11:30 am

What's the output of
Code: Select all
find / -name nagios
find / -name nagios*
find / -name *nagios
find / -name *nagios*


I'm suspicious you have more than one nagios install.
dwhitfield
Former Nagios Staff
 
Posts: 4568
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN

Re: Nagios web interface isn't using the configuration files

Postby Frodogus » Tue Jan 23, 2018 10:09 am

I tried the first command:
[root]# find / -name nagios
/etc/rc.d/init.d/nagios
/etc/logrotate.d/nagios
/etc/nagios
/var/lock/subsys/nagios
/var/run/nagios
/var/spool/nagios
/var/spool/mail/nagios
/var/log/nagios
/usr/share/nagios
/usr/lib64/nagios
/usr/local/nagios
/usr/local/nagios/bin/nagios
/usr/sbin/nagios
/home/nagios

Today I restarted all components and Nagios interface not work.

I will reinstall Nagios because it's better.
Frodogus
 
Posts: 2
Joined: Sat Jan 20, 2018 3:47 pm

Re: Nagios web interface isn't using the configuration files

Postby tgriep » Wed Jan 24, 2018 10:15 am

From the output of the find command, it does look like there are 2 copies of Nagios is installed on your server.
You could be editing the files for one install but the other install is running the other config files and the changes are not there.
The nagios binary looks to be installed in these locations.
Code: Select all
/usr/local/nagios/bin/nagios
/usr/sbin/nagios


You could remove both copies from the server and reinstall Nagios.
The following link is the instructions for installing Nagios using the source files.
https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source-96.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 6447
Joined: Thu Oct 30, 2014 9:02 am


Return to Nagios Core Development

Who is online

Users browsing this forum: No registered users and 3 guests