Upgraded Nagios to 4.4.1 and Nagios not Working

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

Upgraded Nagios to 4.4.1 and Nagios not Working

Post 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.
Attachments
nagiosError.JPG
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

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

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Post 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.
Attachments
nagiosError.JPG
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Post by scottwilkerson »

You need to edit this file as it should be /var/run/nagios.lock
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

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

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

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

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Post 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-)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Post 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?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgraded Nagios to 4.4.1 and Nagios not Working

Post by scottwilkerson »

Honestly, when you install via RPM, you need to update using the same

Code: Select all

yum --enablerepo=epel update nagios
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked