Upgrade nagios 3.5.1 to 4.3.2

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.
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Upgrade nagios 3.5.1 to 4.3.2

Post 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?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Upgrade nagios 3.5.1 to 4.3.2

Post 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?
Former Nagios employee
https://www.mcapra.com/
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade nagios 3.5.1 to 4.3.2

Post by tgriep »

Thanks @mcapra for the help, @pintu if you have any further questions, let us know.
Be sure to check out our Knowledgebase for helpful articles and solutions!
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Upgrade nagios 3.5.1 to 4.3.2

Post 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?
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Upgrade nagios 3.5.1 to 4.3.2

Post 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?
Attachments
nagios.JPG
nagios.JPG (14.76 KiB) Viewed 3166 times
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Upgrade nagios 3.5.1 to 4.3.2

Post by pintu »

I found a solution https://support.nagios.com/forum/viewto ... =7&t=30236, but I have debian not centos
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade nagios 3.5.1 to 4.3.2

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Upgrade nagios 3.5.1 to 4.3.2

Post by pintu »

But the problem was not solved
Nobody has an idea? So why would you want to close the post?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Upgrade nagios 3.5.1 to 4.3.2

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Upgrade nagios 3.5.1 to 4.3.2

Post 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
Attachments
nagios.txt
(221.99 KiB) Downloaded 304 times
Locked