wernerfred / check_synology

This plugin will check a lot of different values on your Synology DiskStation.
MIT License
17 stars 25 forks source link

Install on a container drops with errors: ERROR: For req: check-synology==1.0.0. #48

Open linuxmail opened 1 year ago

linuxmail commented 1 year ago

Hello,

I want to add the check on a container, based on Icinga/icinga2 image with something like this:

but if gives me:

...
Building wheels for collected packages: check-synology
  Building wheel for check-synology (setup.py): started
  Building wheel for check-synology (setup.py): finished with status 'done'
  Created wheel for check-synology: filename=check_synology-1.0.0-py3-none-any.whl size=8176 sha256=f2f1cf3d04bd4484081d705530aed3cb0a0188667e1fca7fe46793d881267fd2
  Stored in directory: /tmp/pip-ephem-wheel-cache-nfvqtxp6/wheels/9e/5c/da/0bc31cf4a7ae73363ff391329abd3040ee651168e9307ddaa3
Successfully built check-synology
Installing collected packages: easysnmp, check-synology
ERROR: For req: check-synology==1.0.0. Invalid script entry point: <ExportEntry check_synology = check_synology:None []> - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.
The command '/bin/sh -c pip install git+https://github.com/wernerfred/check_synology' returned a non-zero code: 1
...

it seems, that .. If I do this on an interactive shell .. the command itself works:

root@home:/# chmod +x  /usr/local/lib/python3.9/dist-packages/check_synology.py
root@home:/#   /usr/local/lib/python3.9/dist-packages/check_synology.py
usage: check_synology.py [-h] [-w W] [-c C] [-p PORT] [-t T] [-r R] hostname username authkey privkey {load,memory,disk,storage,update,status}
check_synology.py: error: the following arguments are required: hostname, username, authkey, privkey, mode

also, if I try to install v0.3.1

root@home:/# pip install git+https://github.com/wernerfred/check_synology.git@v0.3.1
Collecting git+https://github.com/wernerfred/check_synology.git@v0.3.1
  Cloning https://github.com/wernerfred/check_synology.git (to revision v0.3.1) to /tmp/pip-req-build-lyo9y90o
  Running command git clone -q https://github.com/wernerfred/check_synology.git /tmp/pip-req-build-lyo9y90o
  Running command git checkout -q 888097f25519f460d50b2a099d0e2a04827be527
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-lyo9y90o/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-lyo9y90o/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-hdyion9b
         cwd: /tmp/pip-req-build-lyo9y90o/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.9/tokenize.py", line 392, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-lyo9y90o/setup.py'
    ----------------------------------------
WARNING: Discarding git+https://github.com/wernerfred/check_synology.git@v0.3.1. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

is there maybe something, I miss ?

cu denny

HoRaX1804 commented 1 year ago

I have the same issue. Im running Icinga2 on an Ubuntu VM.

root@monitor:~# pip install git+https://github.com/wernerfred/check_synology Collecting git+https://github.com/wernerfred/check_synology Cloning https://github.com/wernerfred/check_synology to /tmp/pip-req-build-9fjfuili Running command git clone --filter=blob:none --quiet https://github.com/wernerfred/check_synology /tmp/pip-req-build-9fjfuili Resolved https://github.com/wernerfred/check_synology to commit d9029c7fe4e0408c7d31d1a8a32b9ec114e335ab Preparing metadata (setup.py) ... done Collecting easysnmp<1,>=0.2.6 Downloading easysnmp-0.2.6-cp310-cp310-manylinux_2_24_x86_64.whl (1.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 863.4 kB/s eta 0:00:00 Building wheels for collected packages: check-synology Building wheel for check-synology (setup.py) ... done Created wheel for check-synology: filename=check_synology-1.0.0-py3-none-any.whl size=8190 sha256=d27a92d9c84faed67cdef5e27af7fbeaf8f1ce89ac7a03c3f2f6b799d3ce407f Stored in directory: /tmp/pip-ephem-wheel-cache-l4cy3dk7/wheels/bd/c6/dc/1a9de5574019dee3bc45c6089d41f1eec244754f10b69eedb6 Successfully built check-synology Installing collected packages: easysnmp, check-synology ERROR: For req: check-synology==1.0.0. Invalid script entry point: <ExportEntry check_synology = check_synology:None []> - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.

tried like Denny did:

root@monitor:/usr/local/lib/python3.10/dist-packages# pip install git+https://github.com/wernerfred/check_synology.git@v0.3.1 Collecting git+https://github.com/wernerfred/check_synology.git@v0.3.1 Cloning https://github.com/wernerfred/check_synology.git (to revision v0.3.1) to /tmp/pip-req-build-tn62dtf4 Running command git clone --filter=blob:none --quiet https://github.com/wernerfred/check_synology.git /tmp/pip-req-build-tn62dtf4 Running command git checkout -q 888097f25519f460d50b2a099d0e2a04827be527 Resolved https://github.com/wernerfred/check_synology.git to commit 888097f25519f460d50b2a099d0e2a04827be527 ERROR: git+https://github.com/wernerfred/check_synology.git@v0.3.1 does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

but on CLI it looks like it would work

root@monitor:/usr/local/lib/python3.10/dist-packages# ./check_synology.py usage: check_synology.py [-h] [-w W] [-c C] [-p PORT] [-t T] [-r R] hostname username authkey privkey {load,memory,disk,storage,update,status} check_synology.py: error: the following arguments are required: hostname, username, authkey, privkey, mode

Any Ideas?

Regards Mario

fibberblank commented 1 year ago

You need to update setup.py script. Take a look at my pull request #49

Regards, Jack