Health status: unknown

19 views
Skip to first unread message

Michele Salerno

unread,
Jul 27, 2026, 8:50:59 AMJul 27
to OpenWISP

Hi,
I deactivated a router from OpenWISP and then reactivated it, but the Health status is showing as ‘unknown’.
I’ve tried making some changes and they’re being applied, but the status hasn’t changed.
Why is that?

Best regards,

Michele.


OpenWISP Version: 25.10.2

Installed OpenWISP Modules

  • openwisp-controller: 1.2.3
  • openwisp-firmware-upgrader: 1.2.1
  • openwisp-ipam: 1.2.1
  • openwisp-monitoring: 1.2.1
  • openwisp-network-topology: 1.2
  • openwisp-notifications: 1.2.3
  • openwisp-radius: 1.2.2
  • openwisp-users: 1.2.2
  • openwisp-utils: 1.2.2
  • netdiff: 1.2
  • netjsonconfig: 1.2.1

OS Information

OS version: Debian GNU/Linux 13 (trixie)

Kernel version: 6.12.96+deb13

Hardware platform: x86_64


Federico Capoano

unread,
Jul 27, 2026, 11:42:45 AMJul 27
to open...@googlegroups.com
Is it sending monitoring data?
Is management IP set?
Are ping checks working and generating the ping chart?

Federico


--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/openwisp/77b9008a-ddb8-4617-8724-d8bc16bf49e4%40gmail.com.

Michele Salerno

unread,
Jul 27, 2026, 12:03:50 PMJul 27
to 'Federico Capoano' via OpenWISP
Thanks, Federico,
Yes, everything works apart from the status.
I’ve exported the charts (attached).
It’s also a router on the same LAN as the OpenWisp server.


config controller 'http'
    option url 'https://openwisp.ninux-nnxx.it'
    option interval '120'
    option management_interval '10'
    option verify_ssl '1'
    option management_interface 'br-lan'
    option test_retries '8'
    option uuid 'fae04f1YYYYYYYY'
    option key 'dd5aXXXXXXXXXX'

Server 10.27.22.18

AP: 10.27.22.253


Best regards.

Michele


Il 27/07/26 17:42, 'Federico Capoano' via OpenWISP ha scritto:
> Is it sending monitoring data?
> Is management IP set?
> Are ping checks working and generating the ping chart?

--
Informativa Privacy - Ai sensi del D. Lgs n. 196/2003 (Codice Privacy) si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.

Privacy Information - This message, for the D. Lgs n. 196/2003 (Privacy Code), may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
data.csv

f.capoano

unread,
Aug 11, 2026, 7:19:05 PM (11 days ago) Aug 11
to OpenWISP
I guess you're using the development version?

Michele Salerno

unread,
Aug 18, 2026, 6:35:45 PM (4 days ago) Aug 18
to open...@googlegroups.com

I use:

OpenWISP Version: 25.10.2

Installed OpenWISP Modules

  • openwisp-controller: 1.2.3
  • openwisp-firmware-upgrader: 1.2.1
  • openwisp-ipam: 1.2.1
  • openwisp-monitoring: 1.2.1
  • openwisp-network-topology: 1.2
  • openwisp-notifications: 1.2.3
  • openwisp-radius: 1.2.2
  • openwisp-users: 1.2.2
  • openwisp-utils: 1.2.2
  • netdiff: 1.2
  • netjsonconfig: 1.2.1

OS Information

OS version: Debian GNU/Linux 13 (trixie)

Kernel version: 6.12.101+deb13

Hardware platform: x86_64



Il 12/08/26 01:19, 'f.capoano' via OpenWISP ha scritto:
--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.

Michele Salerno

unread,
Aug 18, 2026, 6:36:21 PM (4 days ago) Aug 18
to open...@googlegroups.com

Hi Federico,

I found the solution with Claude:


Device stuck on Health status: "unknown" after being deactivated and reactivated

  Symptom
  A device that was deactivated and then reactivated stays on Health status: unknown, even though it's perfectly reachable. All checks are green:
  - Ping → reachable, 0% loss
  - Configuration Applied → ok
  - Monitoring Data Collected → data_collected = 1
  - is_deactivated = False

  Cause
  In openwisp-monitoring, the device health status is only updated when a metric crosses a threshold (the threshold_crossed signal). On reactivation, the
  handle_activated_device signal resets it:
  cls.objects.filter(device_id=instance.id).update(status="unknown")
  From then on, if the metrics stay consistently healthy, there's no crossing → no event → the status stays stuck on unknown even though the device is ok. Same thing
  happens if you disable/re-enable an organization, or remove a critical check.

  Fix
  Recompute the status once with OpenWISP's own logic (update_status): ok if no critical metric is unhealthy, otherwise problem/critical. update_status() is idempotent
  (no-op if the status is already correct) and skips deactivated devices. Here's a reusable script:

  #!/bin/sh
  # =============================================================================
  # fix-monitoring-status.sh — recompute the health status in openwisp-monitoring
  #
  # In openwisp-monitoring a device's status is only updated when a metric crosses
  # a threshold (threshold_crossed signal). If the status gets reset to 'unknown'
  # (device deactivated->reactivated, organization disabled, critical check
  # removed) and the metrics then stay consistently healthy, there is no crossing
  # and the status stays stuck on 'unknown' even though the device is fine.
  # This script recomputes the status with the SAME logic openwisp uses:
  # 'ok' if no critical metric is unhealthy, otherwise 'problem'/'critical'.
  # update_status() is a no-op if the status is already correct.
  #
  # Run it ON THE SERVER where OpenWISP runs (default /opt/openwisp2).
  #
  # Usage:
  #   ./fix-monitoring-status.sh                 # fix ALL 'unknown' devices
  #   ./fix-monitoring-status.sh "Device Name"   # fix a single device
  #   DEVICE="Device Name" ./fix-monitoring-status.sh
  #
  # Env vars: OPENWISP_DIR (default /opt/openwisp2).
  # =============================================================================
  set -e

  OWDIR="${OPENWISP_DIR:-/opt/openwisp2}"
  DEV="${1:-${DEVICE:-}}"

  if [ ! -x "$OWDIR/env/bin/python" ]; then
      echo "ERROR: OpenWISP not found in $OWDIR (set OPENWISP_DIR)" >&2
      exit 1
  fi
  cd "$OWDIR"

  DEVICE="$DEV" ./env/bin/python manage.py shell <<'PY'
  import os
  from openwisp_monitoring.device.models import DeviceMonitoring
  from openwisp_monitoring.device import settings as app_settings


  def recompute(dm):
      if dm.status == "deactivated":
          print(f"{dm.device.name}: deactivated (skipped)")
          return
      status, crit = "ok", 0
      for m in dm.related_metrics.filter(is_healthy=False):
          status = "problem"
          if dm.is_metric_critical(m):
              crit += 1
      if crit == len(app_settings.CRITICAL_DEVICE_METRICS):
          status = "critical"
      old = dm.status
      dm.update_status(status)
      dm.refresh_from_db()
      flag = "" if old == dm.status else "  <-- changed"
      print(f"{dm.device.name}: {old} -> {dm.status}{flag}")


  name = (os.environ.get("DEVICE") or "").strip()
  if name:
      qs = DeviceMonitoring.objects.filter(device__name=name)
      if not qs:
          raise SystemExit(f"Device '{name}' not found")
  else:
      qs = DeviceMonitoring.objects.filter(status="unknown")
      print(f"Recomputing {qs.count()} device(s) in 'unknown' state...")

  for dm in qs:
      recompute(dm)
  PY

  Run it:
  # fix all 'unknown' devices at once
  ./fix-monitoring-status.sh

  # or a single device
  DEVICE="my-device" ./fix-monitoring-status.sh

  # remotely, piping it to the server over SSH
  ssh user@server 'sh -s' < fix-monitoring-status.sh
  ssh user@server 'DEVICE="my-device" sh -s' < fix-monitoring-status.sh

  This doesn't blindly force ok — a genuinely unhealthy device becomes problem/critical; it just re-evaluates the state that never got recomputed because no threshold was
  crossed.





Il 27/07/26 17:42, 'Federico Capoano' via OpenWISP ha scritto:
Is it sending monitoring data?

Federico Capoano

unread,
Aug 18, 2026, 6:38:10 PM (4 days ago) Aug 18
to open...@googlegroups.com
It turns out this was not a new bug in the dev version but it also affected previous versions.


F.
Reply all
Reply to author
Forward
0 new messages