Page 1 of 2

Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Thu Jan 31, 2019 6:10 pm
by ep7network
Hi there,

My Nagios server is running on CentOS 7. I decided to upgrade Nagios Core 4.3.2 to Nagios Core 4.4.1.
I followed every command from https://support.nagios.com/kb/article/n ... e-797.html
and when I run systemctl status nagios.service I get nagios.service failed. I will upload screenshot to view error message.

During install I did encounter an issue. When I attempted to Start Service / Daemon by entering systemctl start nagios.service, I received error message "nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" When I entered systemctl status nagios.service it said it could not locate nagios.cfg in "/usr/local/nagios/etc/nagios.cfg".
When I navigated to directory /usr/local/nagios/etc/nagios.cfg file nagios.cfg was not there.

I think that might be an issue because during the installation phase the document indicated to enter "sed -i 's/^lock_file=.*/lock_file=\/var\/run\/nagios.lock/g' /usr/local/nagios/etc/nagios.cfg" but i entered /etc/nagios/nagios.cfg instead of /usr/local/nagios/etc/nagios.cfg. I did that because my nagios.cfg is located in /etc/nagios/ directory.

I then copied nagios.cfg into /usr/local/nagios/etc/nagios.cfg directory and ran systemctl start nagios.service and command worked.
My next step I wanted to confirm Nagios is running by entering systemctl status nagios.service and I receive error message nagios.service failed.

What can I do to make Nagios 4.4.1 work? Any assistance is greatly appreciated. Thank you in advance.

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Fri Feb 01, 2019 3:15 pm
by benjaminsmith
Hello @ep7network,

In order to fix security CVE's, the location of the lock file has changed ( see: https://support.nagios.com/kb/article/n ... s-796.html ), and I believe this is the issue your having.

What is the output of the following:

Code: Select all

cat /usr/local/nagios/etc/nagios.cfg | grep lock_file

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Fri Feb 01, 2019 4:54 pm
by ep7network
Hi @benjaminsmith,

Thanks for taking the time to help me.

I ran all commands from (https://support.nagios.com/kb/article/n ... s-796.html) link you sent, and all commands ran successful but nagios web interface is still down.

When I enter cat /etc/local/nagios/etc/nagios.cfg | grep lock_file I receive output lock_file=/run/nagios.lock.

I attached screenshot.

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Fri Feb 01, 2019 5:00 pm
by scottwilkerson
You need to edit this file as it should be /var/run/nagios.lock

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Fri Feb 01, 2019 5:40 pm
by ep7network
Hello @scottwilkerson,

What file do I need to edit and enter

Code: Select all

/var/run/nagios.lock
?

When I go to vi /var/run/nagios.lock there is only a numerical value inside of file nagios.lock. I attached pic to show you what I see inside of nagios.lock.

I'm not sure what file I need to edit.

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Sat Feb 02, 2019 8:02 pm
by ep7network
Thank you @scottwilkerson.

I edited nagios.cfg file with /var/run/nagios.lock and ran systemctl stop nagios.service, systemctl start nagios.service, and then systemctl status nagios.service and confirmed that Nagios is running. I also confirmed version and output is Nagios Core 4.4.3.

When I access Nagios web interface at "http://x.x.x.x/nagios/" I get Unable to get process status, and Nagios Core version is 4.3.2.I'll attached pic.

I also ran a systemctl daemon-reload and attempted to access Nagios web interface and received Unable to get process status.
I killed existing Nagios processes and restarted Nagios and continue to receive Unable to get process status.

What is the reason why Daemon can't find new PID number?

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Sat Feb 02, 2019 8:35 pm
by ep7network
I was able to get Nagios web interface running by rebooting server. From (CentOS) CLI I entered reboot.
But now, all my Linux servers and Windows servers are no longer showing up on Nagios interface :?

Is there any way I can import all my server CFG files into a working directory?

Thanks for all your help 8-)

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Mon Feb 04, 2019 1:27 pm
by scottwilkerson
This actually looks like your CGI location was different than the location between versions.

Did you initially install nagios with an RPM or package instead of installing from source, and are not trying to upgrade via source upgrade?

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Mon Feb 04, 2019 3:48 pm
by ep7network
Hello @scottwilkerson,

That's correct my CGI location is different and I verified that by going to vi /etc/nagios/cgi.cfg and noticed Nagios version is 4.3.2.
But when I go to /usr/local/nagios/etc/nagios and I vi cgi.cfg I see Nagios version 4.4.3.
Also when I access Nagios web interface by entering server IP, I see Nagios Core 4.4.3 running.

When I performed Nagios upgrade I used source document. This is the link I used https://support.nagios.com/kb/article/n ... e-797.html.

When I first installed Nagios Core 4.3.2. If I remember correctly I think I used yum install nagios nagios-plugins-all nagios-plugins-nrpe nrpe or yum --enablerepo=epel!

Is there any way this can be fixed?

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Posted: Mon Feb 04, 2019 4:52 pm
by scottwilkerson
Honestly, when you install via RPM, you need to update using the same

Code: Select all

yum --enablerepo=epel update nagios