CHAT_OUTPUT_BEGIN
COMMAND_ID=HOMELAB-SKLADCHIK-MONITOR-COOKIE-CONTRACT-AUDIT-385
STATUS=FAIL
RC=1
HOST=pve01
MODE=read-only
COMPONENT=cluster-audit
REFERENCE_REGISTER_CHECK=OK
REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e
ERROR_REGISTER_CHECK=OK
ERROR_REGISTER_SHA256=08b3a769b8e38eaa1acec915352fb328180d70caa7ff6cd9d1ec0da426262752
COMMAND_SHA256=8d86e9fa0ca4dbc0c7168504ca39d6f89f8514b4a3086e19417978e994901da1
DUPLICATE_FAILED_COMMAND_BLOCKED=false
EXECUTION_STARTED=true
CHANGES_MADE=false
SANITIZED=yes
SECRETS_INCLUDED=no
PRIVATE_ADDRESSES_INCLUDED=no
RAW_EVIDENCE_SHA256=f30a130cb16c9c0ddc2a8ca5bf99c1def8683ef0304b7caea324a6b0d7caea86
SANITIZED_OUTPUT_SHA256=f30a130cb16c9c0ddc2a8ca5bf99c1def8683ef0304b7caea324a6b0d7caea86
OUTPUT_BEGIN
DETAIL=INTEGRITY_FILE=/usr/local/sbin/homelab-chat-run-linked|SHA256=5e8725e129fd2055b36fe2fae13fc95fc4b3271074a0e0d4bb7347e7b2f270a1
DETAIL=INTEGRITY_FILE=/usr/local/sbin/homelab-reader-result-publish|SHA256=9cb8f7f1e9f300176a87f1abc8a9c51c92aeb9bea3514c7a9d9019ec400d4fd7
DETAIL=INTEGRITY_FILE=/usr/local/sbin/skladchik-reports-monitor-supervisor|SHA256=35c68ae0929ff3795be2bde40de334fc8e26413a3d8a620a137be90d1f2c164e
DETAIL=INTEGRITY_FILE=/usr/local/sbin/skladchik-reports-monitor-status|SHA256=f902a61109efbac5918360f2235c2523bd10704ac484a4e8591e8a1c490faf5a
DETAIL=INTEGRITY_FILE=/root/.skladchik-cookie-header-372.pending|SHA256=3c260f0622999b94e1c3b45d5042532fe001b8118dff0d326636b2ad8609d8c4
DETAIL=PENDING_COOKIE_CONTRACT=PASS|FORMAT=RAW_COOKIE_VALUE|PAIR_COUNT=5|SECRET_OUTPUT=NONE
DETAIL=SERVICE_LOADSTATE=loaded
DETAIL=SERVICE_ACTIVESTATE=failed
DETAIL=SERVICE_SUBSTATE=failed
DETAIL=SERVICE_RESULT=exit-code
DETAIL=SERVICE_EXECMAINSTATUS=1
DETAIL=SERVICE_FRAGMENTPATH=/etc/systemd/system/skladchik-reports-monitor-supervisor.service
DETAIL=SERVICE_USER=
DETAIL=SERVICE_GROUP=
DETAIL=SERVICE_WORKINGDIRECTORY=
DETAIL=COOKIE_SOURCE=/usr/local/sbin/skladchik-reports-monitor-supervisor|META=0:0|755|20463|regular file|SHA256=35c68ae0929ff3795be2bde40de334fc8e26413a3d8a620a137be90d1f2c164e
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|124|test -s /opt/skladchik-reports-monitor/monitor.py && echo monitor_py=yes || echo monitor_py=no
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|125|test -s /etc/skladchik-reports-monitor/config.ini && echo config_ini=yes || echo config_ini=no
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|126|test -s /etc/skladchik-reports-monitor/secrets.env && echo secrets_env=yes || echo secrets_env=no
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|127|test -s /var/lib/skladchik-reports-monitor/cookies.jar && echo cookies_jar=yes || echo cookies_jar=no
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|128|[ -s /var/lib/skladchik-reports-monitor/cookies.jar ] && echo cookies_jar_bytes=$(stat -c %s /var/lib/skladchik-reports-monitor/cookies.jar 2>/dev/null) || echo cookies_jar_bytes=0
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|129|test -s /opt/skladchik-reports-monitor/operational_digest.py && echo operational_digest_py=yes || echo operational_digest_py=no
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|130|test -s /opt/skladchik-reports-monitor/event-selftest-runner.py && echo event_selftest_runner_py=yes || echo event_selftest_runner_py=no
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|131|test -s /opt/skladchik-reports-monitor/event-selftest-core && echo event_selftest_core=yes || echo event_selftest_core=no
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|150|    facts["monitor_open"] = mon.get("open", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|151|    facts["monitor_resolved"] = mon.get("resolved", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|152|    facts["monitor_smtp_configured"] = mon.get("smtp_configured", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|153|    facts["session_keepalive"] = mon.get("session_keepalive", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|154|    facts["cookie_jar"] = mon.get("cookie_jar", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|155|    facts["cookie_jar_bytes"] = mon.get("cookie_jar_bytes", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|156|    facts["cookie_expiry_status"] = mon.get("cookie_expiry_status", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|157|    facts["cookie_expiry_utc"] = mon.get("cookie_expiry_utc", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|158|    facts["cookie_expires_in_seconds"] = mon.get("cookie_expires_in_seconds", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|165|        problems.append("monitor_health_stale")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|166|    if mon.get("reports") in ("", "0"):
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|167|        problems.append("monitor_reports_zero_or_missing")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|168|    if mon.get("session_keepalive") != "persistent_cookie_jar":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|169|        problems.append("session_keepalive_not_persistent")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|170|    if mon.get("cookie_jar") not in ("yes", "empty"):
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|171|        problems.append("monitor_cookie_jar_bad")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|172|    expiry_status = mon.get("cookie_expiry_status", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|173|    try:
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|174|        expires_in = int(mon.get("cookie_expires_in_seconds", ""))
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|175|    except Exception:
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|176|        expires_in = None
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|177|    if expiry_status in ("", "NO_COOKIE_JAR", "NO_PERSISTENT_COOKIE", "ERROR"):
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|178|        problems.append("cookie_expiry_missing")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|179|    elif expiry_status == "EXPIRED" or (expires_in is not None and expires_in <= 0):
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|180|        problems.append("cookie_expiry_expired")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|210|    facts["backup_run_id"] = backup.get("RUN_ID", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|211|    facts["backup_size_bytes"] = backup.get("SIZE_BYTES", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|212|    facts["backup_version"] = backup.get("BACKUP_VERSION", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|213|    facts["backup_cookie_jar_backed_up"] = backup.get("COOKIE_JAR_BACKED_UP", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|214|    facts["backup_extension_health_files_backed_up"] = backup.get("EXTENSION_HEALTH_FILES_BACKED_UP", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|215|    facts["backup_title_in_email_subject"] = backup.get("TITLE_IN_EMAIL_SUBJECT", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|216|    facts["backup_health_age_seconds"] = str(age_seconds_from_ts(backup.get("TS")))
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|217|    if backup.get("STATUS") != "OK":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|218|        problems.append("backup_status_not_ok")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|219|    if backup.get("COOKIE_JAR_BACKED_UP") != "yes":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|220|        problems.append("backup_cookie_jar_not_marked")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|221|    if backup.get("BACKUP_VERSION") != "4":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|222|        problems.append("backup_version_not_4")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|223|    if backup.get("EXTENSION_HEALTH_FILES_BACKED_UP") != "yes":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|236|    facts["restore_status"] = restore.get("STATUS", "MISSING")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|237|    facts["restore_run_id"] = restore.get("RUN_ID", "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|238|    facts["restore_health_age_seconds"] = str(age_seconds_from_ts(restore.get("TS")))
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|239|    for key in ["CLOUD_1_STATUS", "CLOUD_2_STATUS", "SHA256_OK", "TAR_OK", "REQUIRED_FILES_OK", "COOKIE_JAR_OK", "EXTENSION_HEALTH_FILES_OK", "EXTENSION_SCRIPTS_OK", "EXTENSION_UNITS_OK", "SQLITE_OK", "PY_COMPILE_OK"]:
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|240|        facts[key.lower()] = restore.get(key, "")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|241|    if restore.get("STATUS") != "OK":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|242|        problems.append("restore_status_not_ok")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|245|    for key in ["CLOUD_1_STATUS", "CLOUD_2_STATUS"]:
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|246|        if restore.get(key) != "OK":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|247|            problems.append(key.lower() + "_bad")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|248|    for key in ["SHA256_OK", "TAR_OK", "REQUIRED_FILES_OK", "COOKIE_JAR_OK", "EXTENSION_HEALTH_FILES_OK", "EXTENSION_SCRIPTS_OK", "EXTENSION_UNITS_OK", "SQLITE_OK", "PY_COMPILE_OK"]:
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|249|        if restore.get(key) != "yes":
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|250|            problems.append(key.lower() + "_bad")
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|251|
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|282|        f"- открытые/назначенные: {facts.get('monitor_open')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|283|        f"- закрытые: {facts.get('monitor_resolved')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|284|        f"- возраст health, сек: {facts.get('monitor_health_age_seconds')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|285|        f"- автопродление авторизации: {facts.get('session_keepalive')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|286|        f"- cookie jar: {facts.get('cookie_jar')} / {facts.get('cookie_jar_bytes')} байт",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|287|        f"- постоянная cookie действует до UTC: {facts.get('cookie_expiry_utc') or 'не определено'}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|288|        f"- осталось дней по cookie: <redacted> or 'не определено'}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|289|        f"- статус срока cookie: <redacted> or 'не определено'}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|290|        f"- NetBird route: {facts.get('netbird_route')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|291|        "",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|292|        "Бэкап:",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|293|        f"- статус: {facts.get('backup_status')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|294|        f"- последний RUN_ID: {facts.get('backup_run_id')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|295|        f"- размер архива, байт: {facts.get('backup_size_bytes')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|296|        f"- cookie jar в бэкапе: {facts.get('backup_cookie_jar_backed_up')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|297|        f"- health-файлы расширений в бэкапе: {facts.get('backup_extension_health_files_backed_up')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|298|        f"- название жалобы в теме письма: {facts.get('backup_title_in_email_subject')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|299|        f"- возраст health, сек: {facts.get('backup_health_age_seconds')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|302|        f"- статус: {facts.get('restore_status')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|303|        f"- последний RUN_ID: {facts.get('restore_run_id')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|304|        f"- cloud1/cloud2: {facts.get('cloud_1_status')}/{facts.get('cloud_2_status')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|305|        f"- sha256/tar/cookie/sqlite/python: {facts.get('sha256_ok')}/{facts.get('tar_ok')}/{facts.get('cookie_jar_ok')}/{facts.get('sqlite_ok')}/{facts.get('py_compile_ok')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|306|        f"- health/scripts/units расширений: {facts.get('extension_health_files_ok')}/{facts.get('extension_scripts_ok')}/{facts.get('extension_units_ok')}",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|307|        "",
DETAIL=COOKIE_SOURCE_LINE=/usr/local/sbin/skladchik-reports-monitor-supervisor|308|        "Проблемы:",
DETAIL=COOKIE_TARGET_REFERENCE=/tar/cookie/sqlite/python:|STATE=ABSENT
DETAIL=COOKIE_TARGET_REFERENCE=/var/lib/skladchik-reports-monitor/cookies.jar|STATE=ABSENT
FAILURE_REASON=COOKIE_TARGET_PARENT_INVALID

OUTPUT_END
CHAT_OUTPUT_END
