SnejPro / check_synology

Icinga2 script for Synology Diskstation
0 stars 3 forks source link

Memory and Storage ValueError #15

Closed ghost closed 1 year ago

ghost commented 1 year ago

The script works fine except for the modes "memory" and "storage"... Both give me a ValueError

Memory:

ValueError: invalid literal for int() with base 10: '1871636 kB'

Storage:

ValueError: invalid literal for int() with base 10: '8192 Bytes'
ghost commented 1 year ago

To specify: I use SNMPv3 on a Synology DiskStation DS418play

SnejPro commented 1 year ago

Could you please post the complete traceback and the command you entered.

ghost commented 1 year ago

I used the following command (IP and login credentials redacted): ./check_synology.py -H 10.0.1.*** -v 3 -u ***** -a ***** --auth_prot SHA -p ***** --priv_prot AES -m memory This works fine for all modes except memory and storage (and thus, 'all' isn't working, too)

The tracebacks are: memory:

Traceback (most recent call last):
  File "./check_synology_orig.py", line 496, in <module>
    render("Memory - Total", "memory-total", True, int(queue_result[0]["data"]['1.3.6.1.4.1.2021.4.5.0'])*1000, unit="B")
ValueError: invalid literal for int() with base 10: '1795540 kB'

storage:

Traceback (most recent call last):
  File "./check_synology_orig.py", line 523, in <module>
    size = int(queue_result[0]["data"]['1.3.6.1.2.1.25.2.3.1.4.'+str(num)])*float(queue_result[0]["data"]['1.3.6.1.2.1.25.2.3.1.5.'+str(num)])
ValueError: invalid literal for int() with base 10: '16384 Bytes'
SnejPro commented 1 year ago

Fixed with https://github.com/SnejPro/check_synology/pull/17