|
NetBurner 3.5.8
PDF Version |
Example Path: examples/SystemDiagnostics
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:
int counter that increments once per secondTwo pieces of the API do the work:
EnableSystemDiagnostics() turns on the built-in diagnostic data feed.DiagVarMon (numeric) and a DiagStrMon (string) monitor each take a label and a reference to one of your variables, registering it for display:Declaring the monitors at file scope is all that is required — no per-loop work is needed to publish the values.
The application serves a small landing page on port 80 that links over to the diagnostics:
http://<device-ip>/).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.
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.
EnableSystemDiagnostics() exposes internal device information. Consider removing it, or gating access, in production firmware.