Nagios unable to get version after Apache and PHP Upgrade

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.
ewatts25
Posts: 6
Joined: Mon Mar 26, 2018 12:02 pm

Nagios unable to get version after Apache and PHP Upgrade

Post by ewatts25 »

Hello,

Due to a compliance issue we had to upgrade apache and PHP. I was able to get Nagios functioning again afterwards, however it now no longer gets the version.

The main page shows : Unable to get Process Status
The Check for upgrade page shows: Your installation of Nagios Core <?php echo $this_version; ?> is outdated and should be upgraded.

I'm running PHP version 5.4.16
I'm running Apache version 2.4.29

Thanks!!
ewatts25
Posts: 6
Joined: Mon Mar 26, 2018 12:02 pm

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by ewatts25 »

I've since upgraded to PHP 7.2.3. Nagios still runs fine, but the same version error exists.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by scottwilkerson »

this appears that php is not enabled in the apache you have installed

Depending on your OS you likely need to install mod-php for apache

something like this

Code: Select all

sudo apt install apache2 libapache2-mod-php7.2
Then restart apache
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ewatts25
Posts: 6
Joined: Mon Mar 26, 2018 12:02 pm

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by ewatts25 »

Thanks! Would you happen to know what the yum packages are for CentOS 7? I'll investigate on my own as well.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by scottwilkerson »

it may depend on the repo you installed out of.

could be mod_php72w in webtatic, but also depends on if you used fpm or not....

Here's the article as this isn't Nagios specific
https://webtatic.com/packages/php72/
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ewatts25
Posts: 6
Joined: Mon Mar 26, 2018 12:02 pm

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by ewatts25 »

It's a remi repo, so looks like php72-php according to this: https://blog.remirepo.net/post/2017/04/ ... Collection

Now to figure out how to unload php7_module and load only the 72 module.

I post when I solve it.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by scottwilkerson »

you should be able to find the config for the old version here

Code: Select all

grep php /etc/httpd/conf.modules.d/*
might be

Code: Select all

/etc/httpd/conf.modules.d/10-php.conf
This is the file to edit

and find the name of the new one here

Code: Select all

ls -al /etc/httpd/modules/|grep php
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ewatts25
Posts: 6
Joined: Mon Mar 26, 2018 12:02 pm

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by ewatts25 »

Thanks for that info. I was able to determine what modules were loaded, and it looks tike the PHP72 module for apache is in fact loading. I've verified other php functionality on apache to be sure.

Could it possibly be something else?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by scottwilkerson »

Maybe but not sure what it is, Maybe check the httpd error_log

This
The Check for upgrade page shows: Your installation of Nagios Core <?php echo $this_version; ?> is outdated and should be upgraded.
is what lead me to believe that php was not being processed, because you should never have
<?php echo $this_version; ?>
in a page
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ewatts25
Posts: 6
Joined: Mon Mar 26, 2018 12:02 pm

Re: Nagios unable to get version after Apache and PHP Upgrad

Post by ewatts25 »

I agree with you and was headed in the same direction. httpd/error_log as well as messages is clean.

Quite puzzling.

Is there a command line I can run that is similar to what the http code is attempting to do to see if I can get some more verbose information about the error?

Thanks!
Locked