Qnap_volumes liefert falschen Wert

Einmal was vorweg - die QNAP Checks bis auf den QNAP Disk Check gehören nicht zu CMK direkt, dass ist ein installiertes MKP. Bitte mal schauen ob es da ein Update vielleicht gibt.

Warum dein zweites Volume Rot ist hab ich jetzt auch gefunden :slight_smile: der Check hat einfach einen Programmierfehler.

Bitte mal den Code hier prüfen

Original

def check_qnap_volumes(item, _no_params, info):
    for volid, volstate, fstype, arrayinfo in info:
        arrayinfo = arrayinfo.lstrip("[")
        arrayinfo = arrayinfo.rstrip("]")
        infotext = " Volume state is %s, Filesystem type is %s, %s" % (volstate, fstype, arrayinfo)
        if volid == item:
            if volstate == "Ready":
                return (0, "OK - " + infotext )
            elif volstate == "Rebuilding...":
                return (1, "Warning - " + infotext )
        else:
                return (2, "Critical - " + infotext)
    return (3, "UNKNOWN - Volume")

Änderung

def check_qnap_volumes(item, _no_params, info):
    for volid, volstate, fstype, arrayinfo in info:
        if volid == item:
            arrayinfo = arrayinfo.lstrip("[")
            arrayinfo = arrayinfo.rstrip("]")
            infotext = " Volume state is %s, Filesystem type is %s, %s" % (volstate, fstype, arrayinfo)
            if volstate == "Ready":
                return (0, "OK - " + infotext )
            elif volstate == "Rebuilding...":
                return (1, "Warning - " + infotext )
            else:
                return (2, "Critical - " + infotext)
    return (3, "UNKNOWN - Volume")

Damit sollte der Check wieder richtig funktionieren.

Alles was nach dem Filesystem Typ kommt, kommt direkt von der NAS als Beschreibung des Volumes.