NetBurner 3.5.0
PDF Version
 
Diagnostics (DIAG) System

Classes

class  DiagItemClass
 Diagnostics item. More...
 
class  DiagCallBack
 Call back and generate the specific diagnostic element when requested. More...
 
class  DiagVarMon
 Report the value of some numeric type. More...
 
class  DiagStrMon
 Report the value of a string. More...
 
class  DiagPtrMon
 Report the value of a pointer. More...
 

Functions

bool SendDiagReport (const char *pUrl, const char *pUser=0, const char *pPass=0)
 Set up to send the diagnostic report as a JSON blob to some external URL.
 
bool SendDiagReport (ParsedURI &uri, const char *pUser=0, const char *pPass=0)
 Set up to send the diagnostic report as a JSON blob to some external URL.
 

Detailed Description

#include< diagnostics.h >

The functions in this header are used to add diagnostic reports to the diagnostics tab under the config page when diagnostics.h is included and EnableSystemDiagnostics() is called.

The resulting JSON blob can be accessed directly (replace 10.1.1.100 with your IP or dns name) http://10.1.1.100:20034/DIAG

You can also access subgroups directly from the diagnostics: http://10.1.1.100:20034/DIAG/Buffers or http://10.1.1.100:20034/DIAG/Tasks

Examples
If I have a uint32_t called myVar I want to monitor:
DiagVarMon MyVarMon("MyVarName", myVar);
Report the value of some numeric type.
Definition diagnostics.h:83
If I have char buffer holding the name opf the current mode:
DiagStrMon MyStrMon("CurMode", cur_mode);
Report the value of a string.
Definition diagnostics.h:216
If I want to output a complex JSON object for a custom report, I can write a routine that outputs this object to an fd:
void MyCustomReport(int fd);
DiagCallBack MyReporter("MyReportName", MyCustomReport);
Call back and generate the specific diagnostic element when requested.
Definition diagnostics.h:72

Function Documentation

◆ SendDiagReport()

bool SendDiagReport ( ParsedURI & uri,
const char * pUser = 0,
const char * pPass = 0 )

#include <diagnostics.h>

Set up to send the diagnostic report as a JSON blob to some external URL.