APT check & Linux image

Hallo,

neuerdings habe ich Probleme mit dem APT-Check. Symptome sind ein “UNKN - Item not found in agent output” und ein “WARN - no unmonitored services found, 1 vanished services (apt:1)WARN, no new host labels”. Wenn ich den Agent manuell ausführe sehe ich:

<<apt:sep(0):cached(1603184653,900)>>
Inst linux-image-4.19.0-12-amd64 (4.19.152-1 Debian-Security:10/stable [amd64])
Inst linux-image-amd64 [4.19+105+deb10u6] (4.19+105+deb10u7 Debian-Security:10/stable [amd64])
Inst linux-libc-dev [4.19.146-1] (4.19.152-1 Debian-Security:10/stable [amd64])

Dieses Problem tritt reproduzierbar immer dann auf, wenn Linux-Image-Updates dabei sind.

Wie lässt sich das fixen?

TIA
Matthias

Hi,
das Linux Paket an erster Stelle hat ein anderes Format als die anderen Pakete. Hier fehlt die Versionsnummer in [].
Man müsste im apt check eine alternative einbauen, die das abfängt.

def apt_valid_info(info):
    if not info:
        return False

    first_line = info[0]
    if len(first_line) != 1:
        return False

    if first_line[0] == NOTHING_PENDING_FOR_INSTALLATION:
        return True

    parts = first_line[0].split()
    if len(parts) < 3:
        return False

    action = parts[0]
    
    if parts[2].startswith("("):
        version = "[" + part[2].split()[0][1:] + "]"
    else: 
        version = parts[2]
    return action in ('Inst', 'Remv') and version.startswith("[") and version.endswith("]")

Also den apt check nach ~/local/share/check_mk/checks kopieren und die Anpassungen machen, dann sollte es funktionieren.

Cheers,
Christian

Danke, also ein Bug, da das gängig und nichts aussergewöhnliches ist :slight_smile:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.