Upgraded Nagios to 4.4.1 and Nagios not Working

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

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

Upgraded Nagios to 4.4.1 and Nagios not Working

Postby ep7network » Thu Jan 31, 2019 6:10 pm

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.
Attachments
nagiosError.JPG
ep7network
 
Posts: 47
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby benjaminsmith » Fri Feb 01, 2019 3:15 pm

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benjaminsmith
 
Posts: 491
Joined: Wed Aug 22, 2018 4:39 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby ep7network » Fri Feb 01, 2019 4:54 pm

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.
Attachments
nagiosError.JPG
ep7network
 
Posts: 47
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby scottwilkerson » Fri Feb 01, 2019 5:00 pm

You need to edit this file as it should be /var/run/nagios.lock
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 13476
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby ep7network » Fri Feb 01, 2019 5:40 pm

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.
Attachments
nagiosError001.JPG
nagiosError001.JPG (8.27 KiB) Viewed 200 times
ep7network
 
Posts: 47
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby ep7network » Sat Feb 02, 2019 8:02 pm

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?
Attachments
NagiosWebsite.PNG
NagiosWebsite.PNG (17.98 KiB) Viewed 182 times
ep7network
 
Posts: 47
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby ep7network » Sat Feb 02, 2019 8:35 pm

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-)
ep7network
 
Posts: 47
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby scottwilkerson » Mon Feb 04, 2019 1:27 pm

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 13476
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby ep7network » Mon Feb 04, 2019 3:48 pm

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?
ep7network
 
Posts: 47
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Postby scottwilkerson » Mon Feb 04, 2019 4:52 pm

Honestly, when you install via RPM, you need to update using the same
Code: Select all
yum --enablerepo=epel update nagios
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 13476
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 37 guests