Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
Community Edition, Professional Edition
-
Ubuntu 20.04 LTS with Python3
Description
The nginx script for linux system on Python3 (default on Ubuntu 20.04) returns several errors regarding the deprecation of some functions / libraries.
On python3, urllib2 is not used in favor of urlib.request
On python3, print "" is not used in favor of print()
To fix this and allow compatibility, adding a "try" for the lib and change the fetch function could allow python2 and python3 requests.
try: |
from urllib.request import urlopen < python3 |
except ImportError:
|
from urllib2 import urlopen < the fall back to python2 |
When using urllib, because of the next part of the code, we need to add '.decode('utf8')'
data = urlopen('http://localhost/nginx-status').read().decode('utf-8') |
Attachments
Activity
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Pending Response [ 10000 ] | New: Resolved [ 5 ] |
Comment |
[ Please make and attach additional information about the device: * full snmp dump from device: {noformat} snmpwalk -v2c -c <community> --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk {noformat} _If device not support SNMP version 2c, replace -v2c with -v1._ * If you have problems with discovery or poller processes, please do and attach these debugs: {noformat} ./discovery.php -d -h <device> ./poller.php -d -h <device> {noformat} * additionally attach device and/or vendor specific MIB files {color:#505F79}_Note, this comment is added automatically._{color} ] |
Status | Original: Open [ 1 ] | New: Pending Response [ 10000 ] |
Tnx, fixed in r10806.