Feature request: Support python3 for poller-wrapper + others

root@thor-odd:/opt/librenms# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux testing (stretch)
Release: testing
Codename: stretch

root@thor-odd:/opt/librenms# pip freeze
chardet==2.3.0
fail2ban==0.9.6
httplib2==0.9.2
pycurl==7.43.0
pygobject==3.22.0
pyinotify==0.9.6
PyMySQL==0.7.9
python-apt==1.1.0b5
python-debian==0.1.29
python-debianbts==2.6.1
reportbug==7.1.2
requests==2.12.4
six==1.10.0
systemd-python==233
unattended-upgrades==0.1
urllib3==1.19.1

OBSERVIUM:

root@thor-odd:/etc# python -V
Python 2.7.13

root@thor-odd:/opt/observium# ./poller-wrapper.py
ERROR: missing python module: MySQLdb
On Ubuntu: apt-get install python-mysqldb
On RHEL/CentOS: yum install MySQL-python
On FreeBSD: cd /usr/ports/*/py-MySQLdb && make install clean

root@thor-odd:/opt/observium# sudo apt-get install python3
Reading package lists… Done
Building dependency tree
Reading state information… Done
python3 is already the newest version (3.5.1-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@thor-odd:/opt/observium# rm -f /usr/bin/python
root@thor-odd:/opt/observium# ln -s python3.5 /usr/bin/python
r
oot@thor-odd:/opt/observium# python -V
Python 3.5.3rc1

root@thor-odd:/opt/observium# ./poller-wrapper.py
INFO: starting the poller at 2017/01/16 00:33:59 with 16 threads, slowest devices first
INFO starting alerter.php for 8
INFO finished alerter.php for 8
INFO starting alerter.php for 9
INFO finished alerter.php for 9
INFO: worker Thread-13 finished device 9 in 20 seconds
INFO: worker Thread-12 finished device 8 in 20 seconds

LibreNMS:
root@thor-odd:/opt/librenms# python -V
Python 2.7.13

root@thor-odd:/opt/librenms# ./poller-wrapper.py
ERROR: missing the mysql python module:
On ubuntu: apt-get install python-mysqldb
On FreeBSD: cd /usr/ports/*/py-MySQLdb && make install clean

root@thor-odd:/opt/librenms# sudo apt-get install python3
Reading package lists… Done
Building dependency tree
Reading state information… Done
python3 is already the newest version (3.5.1-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@thor-odd:/opt/librenms# rm -f /usr/bin/python
root@thor-odd:/opt/librenms# ln -s python3.5 /usr/bin/python

root@thor-odd:/opt/librenms# python -V
Python 3.5.3rc1

root@thor-odd:/opt/librenms# ./poller-wrapper.py
ERROR: missing the mysql python module:
On ubuntu: apt-get install python-mysqldb
On FreeBSD: cd /usr/ports/*/py-MySQLdb && make install clean

1 Like

Just did a fresh install of LibreNMS (17a804659) on Ubuntu 20.04 LTS and experienced the exact same issue. Wriedel’s hack seems to work fine.

Yep, here also - thanks! No more Python 2.7 on Ubuntu 20.04.