NetBurner 3.5.8
PDF Version
System Diagnostics

Example Path: examples/SystemDiagnostics

System Diagnostics Example

Overview

The NetBurner Configuration Server hosts a built-in Diagnostics page that reports device health (task list, stack usage, network counters, and more). This example shows how an application can add its own variables to that page so they appear alongside the system data.

It registers two monitored variables and updates one of them continuously while the app runs:

  • My Int — an int counter that increments once per second
  • My String — a fixed string value

How it works

Two pieces of the API do the work:

  1. EnableSystemDiagnostics() turns on the built-in diagnostic data feed.
  2. A DiagVarMon (numeric) and a DiagStrMon (string) monitor each take a label and a reference to one of your variables, registering it for display:
int myInt;
char myString[80];
static DiagVarMon MyIntMon("My Int", myInt); // numeric monitor
static DiagStrMon MyStrMon("My String", myString); // string monitor
Monitor and report string values.
Definition diagnostics.h:242
Monitor and report the value of numeric variables.
Definition diagnostics.h:97

Declaring the monitors at file scope is all that is required — no per-loop work is needed to publish the values.

Viewing the diagnostics

The application serves a small landing page on port 80 that links over to the diagnostics:

  1. Browse to the device's IP address (http://<device-ip>/).
  2. Click Open Configuration Server (the Configuration Server runs on port 20034).
  3. Choose Diagnostics to see the system data plus this example's My Int / My String.

Web page

The landing page in html/ uses the shared NetBurner example styling — a self-contained stylesheet (style.css, plain CSS with no framework or CDN) and logo.png.

Related examples

The Diagnostics page is part of the Configuration Server. To customize the rest of that web interface, see the Configuration/Web examples — BasicWebConfig and CustomWebConfig.

Production note

EnableSystemDiagnostics() exposes internal device information. Consider removing it, or gating access, in production firmware.