Dropping support for PHP 7.1 and Python 2

The 1.64 release will require PHP 7.2 and Python 3. Both PHP 7.1 and Python 2 are no longer supported upstream. LibreNMS 1.64 is due to be released May 31. For those using the daily release, this may be sooner.

If you do not meet the requirements, LibreNMS will cease updates so that it continues to work. This means you will no longer receive security and bug fixes.

Steps you can take to prevent this.

  1. Update your PHP version. Minimum 7.2.5, but 7.3 or newer is recommended.
  2. Make sure at least Python 3.4 is available, if not install it and pip3.
  3. Install the python requirements with pip3 install -r requirements.txt or via your distribution packages.
  4. If using distributed polling via the wrappers, make sure to install Python 3 python-memcached pip3 install python-memcached

You do NOT need to set the python binary to point to python3. If python3 --version is >= 3.4 you are ready.

4 Likes

I have heard that polling via cronjob is deprecated in this release. What is the rationale for that?

It is not, but no one has completed the port to of the wrappers Python 3 yet. Any help here would be appreciated. https://github.com/librenms/librenms/pull/10759

Hi Murrant. I took a look at this and in referencing this file:

cat /opt/librenms/requirements.txt

PyMySQL
python-dotenv
redis>=3.0

Did this on a CentOS 7 machine:

yum -y install python36 python36-PyMySQL.noarch

I looked for python-dotenv as a package in CentOS 7 with EPEL etc, but couldn’t find anything like that.

For redis, I don’t have it installed on the LibreNMS server. Is it needed?

@micoots requirements.txt are meant to be installed via pip3.

So you just need yum install python36 python36-pip, then pip3 install -r requirements.txt

thanks for the heads up - I now have 7.4.5 php running

1 Like

Not sure if these steps were all really required, but this is how I upgraded my Ubuntu 18.04 Nginx install up to the recommended php 7.3 (was at v7.2.24 prior)… Python was already at 3.6.9 so just had to install pip3.

apt update
apt upgrade
apt install software-properties-common
add-apt-repository ppa:ondrej/php
add-apt-repository ppa:ondrej/nginx-mainline
apt update
apt upgrade
apt autoremove
apt install php7.3-cli php7.3-curl php7.3-fpm php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-snmp php7.3-xml php7.3-zip python3-pip
cd /opt/librenms/
pip3 install -r requirements.txt

# Set "date.timezone = Etc/UTC" in below php.ini files
vi /etc/php/7.3/fpm/php.ini
vi /etc/php/7.3/cli/php.ini

systemctl restart php7.3-fpm
systemctl restart nginx
3 Likes

A post was split to a new topic: Debian 10 still has requirements error after install

This is exactly what I needed to confirm my changes. One question though, after these changes, validate php does not work. I get the following error…

404 Gateway Timeout
nginx/1/17/10

Any thoughts?
Thank you.

I didn’t run into any issues with nginx after upgrading to php 7.3 on Ubuntu 18, so not sure what would be causing that. This is what I get when I run validate.php. I have fixed some errors in the arbos files in my local install so ignore the git warnings.

netnms02:/opt/librenms# ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.61
DB Schema | 2020_02_10_223323_create_alert_location_map_table (159)
PHP       | 7.3.18-1+ubuntu18.04.1+deb.sury.org+1
MySQL     | 10.1.44-MariaDB-0ubuntu0.18.04.1
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.10.6
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[WARN]  Your local git contains modified files, this could prevent automatic updates.
        [FIX]:
        You can fix this with ./scripts/github-remove
        Modified Files:
         includes/definitions/arbos.yaml
         tests/snmpsim/arbos.snmprec

netnms02:/var/log# php -v
PHP 7.3.18-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: May 14 2020 10:34:44) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.18, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.18-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

And what are you waiting to open a pull request with those changes? :wink:

And what are you waiting to open a pull request with those changes? :wink:

Thanks for the reminder. Pull request #11708 created.

I have the following with LibreNMS on Ubuntu 18.04.3 LTS on Apache

:~# python -V
Python 2.7.17

:~# php -v
PHP 7.2.24-0ubuntu0.18.04.6 (cli) (built: May 26 2020 13:09:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.6, Copyright (c) 1999-2018, by Zend Technologies

However I notice that on my GUI it shows this:

Im seeing Error: Python requirements not met. Any help will be really apprecaited

Try

pip3 install -r requirements.txt
1 Like

Thanks. Works now

PHP 7.2.5 Is required, But 7.3 strongly recommended?
Official guide https://docs.librenms.org/Installation/Installation-Ubuntu-1804-Nginx/
Explains how to install 7.2 which ends up being 7.2.24 (this is the same as in one of your official vm images)
No warnings (or issues that I have seen) appears when using 7.2.24 tho.

So, you might either revise the requirement, or update official image, and documentation for how to do this install properly. Also information on how to upgrade the official image would be great.
Thanks!

7.2.24 is just fine. Just keep in mind it will stop receiving patches in 5 months. Also, new install docs are out.

1 Like

Hi!

Just upgraded my distributed system from 1.63 to 1.64, already installed php 7.2.31 and python3 dependency.
This is the output of one of my poller (yes, we disable the automatic update :slight_smile: )

user@librepoll1:/opt/librenms# ./validate.php -g distributedpoller
====================================
Component | Version
--------- | -------
LibreNMS | 1.64.1
DB Schema | 2020_04_06_001048_the_great_index_rename (165)
PHP | 7.2.31-1+ubuntu18.04.1+deb.sury.org+1
Python | 3.6.9
MySQL | 10.1.44-MariaDB-0ubuntu0.18.04.1
RRDTool | 1.7.0
SNMP | NET-SNMP 5.7.3
====================================
[OK] Composer Version: 1.10.8
[OK] Dependencies up-to-date.
Checking distributedpoller:^[[A OK
[OK] Connection to memcached is ok
user@librepoll1:/opt/librenms# ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 1.64.1
DB Schema | 2020_04_06_001048_the_great_index_rename (165)
PHP | 7.2.31-1+ubuntu18.04.1+deb.sury.org+1
Python | 3.6.9
MySQL | 10.1.44-MariaDB-0ubuntu0.18.04.1
RRDTool | 1.7.0
SNMP | NET-SNMP 5.7.3
====================================
[OK] Composer Version: 1.10.8
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Your install is over 24 hours out of date, last update: Mon, 01 Jun 2020 16:24:49 +0000
[FIX]:
Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[WARN] Your local git branch is not master, this will prevent automatic updates.
[FIX]:
You can switch back to master with git checkout master

after upgrade graph become intermittent
image

any suggest?

I’ve seen this happen for people that have InfluxDB enabled, but the InfluxDB server isn’t running.

Please make sure that isn’t the case. You can also run ./poller.php manually and check for errors.