Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-1302

Explicitly use python2 for poller-wrapper.py

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Poller
    • Various

    Description

      Currently the "interpreter" for the poller-wrapper.py is "python". Since more and more distros use python3 as default and this wrapper is not (yet) python3-compatible, this leads poller to stop working.

      So as long as poller-wrapper.py is not python3 compatible (it is not only that print-command is not in braces, it's also using no longer existing mysql-bindings) it might be a good idea to actually use

      #! /usr/bin/env python2

      as firstline, as this symlink should exist always (at least as long as there is a python2-interpreter installed).

      BR
      Jens

      Attachments

        Issue Links

          Activity

            [OBS-1302] Explicitly use python2 for poller-wrapper.py

            Fixed in r6417.

            Now use poller-wrapper.py

            landy Mike Stupalov added a comment - Fixed in r6417. Now use poller-wrapper.py
            opteamax Jens Ott added a comment -

            Works like a charm! Excellent work !!!
            THANK YOU VERY MUCH!

            opteamax Jens Ott added a comment - Works like a charm! Excellent work !!! THANK YOU VERY MUCH!
            opteamax Jens Ott added a comment -

            I'm at a customer on-site atm, will try hopefully later today ...

            opteamax Jens Ott added a comment - I'm at a customer on-site atm, will try hopefully later today ...

            Any comments, you tried to use new wrapper?

            landy Mike Stupalov added a comment - Any comments, you tried to use new wrapper?

            In r6412 added python3 compatible wrapper (separated): poller-wrapper3.py
            Try to use it (replace in crontab).

            Required additional python module:

            sudo apt-get install python3-setuptools
            sudo easy_install3 pip
            sudo pip3 install PyMySQL
            

            landy Mike Stupalov added a comment - In r6412 added python3 compatible wrapper (separated): poller-wrapper3.py Try to use it (replace in crontab). Required additional python module: sudo apt-get install python3-setuptools sudo easy_install3 pip sudo pip3 install PyMySQL
            opteamax Jens Ott added a comment -

            Ok, as said, maybe the customers ubuntu has symlink to /usr/bin/python => /usr/bin/python3 for some other packages/needs.

            On ArchLinux the default points to:

            $ /usr/bin/env python -V
            Python 3.4.3
            

            and I think more and more distros are going to default to 3.X soon

            opteamax Jens Ott added a comment - Ok, as said, maybe the customers ubuntu has symlink to /usr/bin/python => /usr/bin/python3 for some other packages/needs. On ArchLinux the default points to: $ /usr/bin/env python -V Python 3.4.3 and I think more and more distros are going to default to 3.X soon

            Ok, I correctly understand for your system by default used python 3 as symlink to python:

            $ /usr/bin/env python -V
            Python 3.x.x
            

            for info on ubuntu 14.04 by default still 2.7:

            $ /srv/observium/scripts/distro 
            Linux|3.13.0-30-generic|amd64|Ubuntu|14.04
             
            $ /usr/bin/env python -V
            Python 2.7.6
            

            landy Mike Stupalov added a comment - Ok, I correctly understand for your system by default used python 3 as symlink to python: $ /usr/bin/env python -V Python 3.x.x for info on ubuntu 14.04 by default still 2.7: $ /srv/observium/scripts/distro Linux|3.13.0-30-generic|amd64|Ubuntu|14.04   $ /usr/bin/env python -V Python 2.7.6
            opteamax Jens Ott added a comment -

            Me personally I am running Observium 0.15.5.6411 (rolling) on ArchLinux (rolling), but this can be ignored.

            Had the same stuff on customers installation on Ubuntu 14.04.

            Not 100% sure if the "defaulting" to python3 instead of python2 comes from upstream or from any other package which is running on the node.

            Anyway, if a python2.X is installed (which is required for the wrapper) the /usr/bin/python2 symlink always exists on all distros I have seen so far, so changing this should be a minor issue and prevent failures if python3 becomes default.

            BR
            JEns

            opteamax Jens Ott added a comment - Me personally I am running Observium 0.15.5.6411 (rolling) on ArchLinux (rolling), but this can be ignored. Had the same stuff on customers installation on Ubuntu 14.04. Not 100% sure if the "defaulting" to python3 instead of python2 comes from upstream or from any other package which is running on the node. Anyway, if a python2.X is installed (which is required for the wrapper) the /usr/bin/python2 symlink always exists on all distros I have seen so far, so changing this should be a minor issue and prevent failures if python3 becomes default. BR JEns

            On what os/version you tried to run wrapper?

            landy Mike Stupalov added a comment - On what os/version you tried to run wrapper?

            People

              landy Mike Stupalov
              opteamax Jens Ott
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: