Feature request: Support python3 for poller-wrapper + others

[email protected]:/opt/librenms# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux testing (stretch)
Release: testing
Codename: stretch

[email protected]:/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:

[email protected]:/etc# python -V
Python 2.7.13

[email protected]:/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

[email protected]:/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.
[email protected]:/opt/observium# rm -f /usr/bin/python
[email protected]:/opt/observium# ln -s python3.5 /usr/bin/python
r
[email protected]:/opt/observium# python -V
Python 3.5.3rc1

[email protected]:/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:
[email protected]:/opt/librenms# python -V
Python 2.7.13

[email protected]:/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

[email protected]:/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.
[email protected]:/opt/librenms# rm -f /usr/bin/python
[email protected]:/opt/librenms# ln -s python3.5 /usr/bin/python

[email protected]:/opt/librenms# python -V
Python 3.5.3rc1

[email protected]:/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.