wernerfred / check_synology

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

Zero Division Error with mode Storage & Docker Container Volumes #5

Closed Byolock closed 4 years ago

Byolock commented 4 years ago

I have got a ZeroDivisionError with the storage check : File "/etc/icinga2/scripts/check_synology.py", line 149, in <module> storage_used_percent = int(storage_used * 100 / storage_size) ZeroDivisionError: integer division or modulo by zero

I was able to trace it back to the following volume : STRING: "/volume2/@docker/containers/782c5829828d901c73d57e223e84300ea4f95bf0005024912aea33de85e618f7/mounts/shm" So its apparently some kind of docker configuration which is able to create a volume with size 0. Disabling checks for Volumes with storage_size 0 would be an easy fix i guess? I don't know python but i will try to implement a fix myself when i got some spare time. If anybody else would provide a fix, that would be much appreciated.