itmicus / zabbix

Zabbix Templates
GNU General Public License v3.0
155 stars 264 forks source link

File "./website_metrics.py", line 47, in <module> #58

Closed alext1859 closed 3 years ago

alext1859 commented 3 years ago

Добрый день. При запуске команды ./website_metrics.py --discoverydomain "https://google.com" --debug "True"

Вылазит ошибка

./website_metrics.py --discoverydomain "https://google.com" --debug "True" Traceback (most recent call last): File "./website_metrics.py", line 47, in HTTPResponse = requests.packages.urllib3.response.HTTPResponse #python2/3 AttributeError: 'module' object has no attribute 'packages'

Так же в вэб интерфейсе пишет что Итем - Not supported с ошибкой

Preprocessing failed for: Traceback (most recent call last):. File "/usr/lib/zabbix/externalscripts/website_metrics.py", l...

  1. Failed: cannot extract value from json by path "$.test_time": cannot parse as a valid JSON object: invalid object format, expected opening character '{' or '[' at: 'Traceback (most recent call last): File "/usr/lib/zabbix/externalscripts/website_metrics.py", line 47, in HTTPResponse = requests.packag

Подскажите с чем может быть проблема. CentOS Linux 7

wmorgue commented 3 years ago

Привет @alext1859

Покажи выхлоп от следующих команд:

python -V

# С помощью какой версии `pip` были установлены зависимости(библиотеки)?
pip -V
pip3 -V
alext1859 commented 3 years ago

Спасибо что ответили, решение уже нашлось.

https://github.com/certbot/certbot/issues/5104

The problems in this thread are usually caused by having a broken Python installation caused by packages installed from pip conflicting with the ones installed from yum. Removing the packages you've installed through pip should solve the problem.

Помогло это:

pip uninstall requests pip uninstall urllib3 yum remove python-urllib3 yum remove python-requests yum install python-urllib3 yum install python-requests