Page 1 of 2

Upgrade nagios 3.5.1 to 4.3.2

Posted: Fri Jun 09, 2017 6:36 am
by pintu
Where is the nagios configuration file?
I have upgraded from 3.5.1 to 4.3.2 and nagios uses nagios3 configuration files that are located in a different directory than /usr/local/nagios/
The apache directory is /usr/local/nagios/share/, but nagios uses old configuration files in another directory
Where to change the location to the nagios configuration file?

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Fri Jun 09, 2017 11:27 am
by mcapra
Where Nagios Core looks for configuration objects depends on the main nagios.cfg file. Mine is found here and contains the following directives to point to some configuration objects:

Code: Select all

[root@nagios ~]# cat /usr/local/nagios/etc/nagios.cfg | grep cfg_
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
cfg_file=/usr/local/nagios/etc/objects/hostgroups.cfg
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
#cfg_file=/usr/local/nagios/etc/objects/switch.cfg
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg
# extension) in a particular directory by using the cfg_dir
cfg_dir=/usr/local/nagios/etc/hosts
cfg_dir=/usr/local/nagios/etc/services
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers
# object configuration files (see the cfg_file and cfg_dir options above).
So if all my configuration files were located somewhere else, I would need to change all my cfg_file and cfg_dir values. Or create symlinks. Probably best to just update the main nagios.cfg file.

Unless i'm misunderstanding what you're looking for. If I am, could you please clarify?

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Fri Jun 09, 2017 1:14 pm
by tgriep
Thanks @mcapra for the help, @pintu if you have any further questions, let us know.

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Mon Jun 12, 2017 7:14 am
by pintu
I installed nagios from repositories
The configuration of the hosts is in the directory /etc/nagios3/
Then I upgraded nagios to version 4.3.2 and the configuration files of this version 4.3.2 are in the /usr/local/nagios/
but nagios continues to use the old configuration (/etc/nagios3/ not /usr/local/nagios/)
Do you understand my question?

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Mon Jun 12, 2017 7:22 am
by pintu
And as I go to the nagios page I have a message:
unable to get process status [\b] (attachment)
Is this also the error associated with the above?

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Mon Jun 12, 2017 7:26 am
by pintu
I found a solution https://support.nagios.com/forum/viewto ... =7&t=30236, but I have debian not centos

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Mon Jun 12, 2017 9:43 am
by tgriep
Just to confirm but is the Nagios system running for you now?
If you don't have anymore questions, shall I close and lock the post for you?

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Tue Jun 13, 2017 2:37 am
by pintu
But the problem was not solved
Nobody has an idea? So why would you want to close the post?

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Tue Jun 13, 2017 10:52 am
by lmiltchev
How did you upgrade nagios to version 4.3.2? What document/guide/tutorial did you follow?

Run the following command:

Code: Select all

locate nagios > nagios.txt
then post the nagios.txt file on the forum, that was created by the above command in you current working directory.

Also, run:

Code: Select all

ps -ef | grep [n]agios
and show the output.

Re: Upgrade nagios 3.5.1 to 4.3.2

Posted: Wed Jun 14, 2017 7:58 am
by pintu
lmiltchev wrote:How did you upgrade nagios to version 4.3.2? What document/guide/tutorial did you follow?
https://assets.nagios.com/downloads/nag ... ading.html
lmiltchev wrote:

Code: Select all

locate nagios > nagios.txt
in attachment
lmiltchev wrote:

Code: Select all

ps -ef | grep [n]agios
and show the output.

Code: Select all

nagios     587     1  0 maj31 ?        00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
nagios     874     1  0 maj31 ?        01:11:14 /usr/sbin/nagios3 -d /etc/nagios3/nagios.cfg