Outdated Resource Warning!

This is documentation for legacy version 0.x releases. If you are using 1.x see the wiki.
<< XML and JavaScript APIContentsAPI Output Example >>

API Query Types



node

Outputs all fields from fnnode and some additional data for the nodeid passed in param

Parameters param[x]=nodeid (required)

Example: query[x]=node&param[x]=NODEID

Example XML Output

<node nodeid="NODEID" query="X">

... for every field Z ...
<FIELD-NAME>VALUE</FIELD-NAME>

</node>


Example JavaScript Output

data[x]=new Array;

... for every field Z ...
data[x][Z]=new Array;
data[x][Z][0]=FIELD-NAME;
data[x][Z][1]=VALUE;


Data Provided

All the fields of fnnode are provided in the data along with some additional computed fields but their index (Z in the above example) cannot be guarenteed so types should always be checked. You should have a manual look at the output to see what fields are precisely available but notable fields include:

alertlevel - numeric reprensentation of last status
alerttext - textual string for the same
lastrundt - string datetime the last time the node was tested
lastrunago - string in the form HH:MM:SS showing how long ago the node was last tested






test

Outputs all fields from relevant test table (i.e. fnlocaltest) and some additional data for the testid passed in param. Will optionally output average test values and output over the period if a range is specified in param1 and param2.

Parameters param[x]=testid (required)

Optional Time Period Parameters:
param1[x]=STARTX (optional)
param2[x]=FINISHX (optional)

STARTX and FINISHX can either be positive numbers which are treated as UNIXTIME (seconds since the epoch), 0 meaning now or a negative number which is the number of seconds ago to run. For example a STARTX of -3600 and a FINISHX of 0 would refer to the period from an hour ago (3600 seconds) to now.

Example: query[x]=test&param[x]=TESTID&param1[x]=STARTX&param2[x]=FINISHX

Example XML Output

<test testid="TESTID" query="X">

... for every field Z ...
<FIELD-NAME>VALUE</FIELD-NAME>

</test>


Example JavaScript Output

data[x]=new Array;

... for every field Z ...
data[x][Z]=new Array;
data[x][Z][0]=FIELD-NAME;
data[x][Z][1]=VALUE;


Data Provided

All the fields of the relevant test table are provided in the data along with some additional computed fields but their index (Z in the above example) cannot be guarenteed so types should always be checked. You should have a manual look at the output to see what fields are precisely available but notable fields include:

alertlevel - numeric reprensentation of last status
alerttext - textual string for the same
lastrundt - string datetime the last time the node was tested
lastrunago - string in the form HH:MM:SS showing how long ago the node was last tested lastvalue - last value recorded by the test

If you have provided a time range in param1 and 2 then you will have the following fields available:

period.tested - number of test records for the period
period.passed - number passed
period.failed - number failed
period.untested - number untested (scheduling etc)
period.warning - number of warnings
period.average - average value of passed (and warned) tests






testdata

Outputs recorded data for the test specified over the period given

Parameters param[x]=testid (required)
param1[x]=STARTX (required)
param2[x]=FINISHX (required)

STARTX and FINISHX have the same function as for the "test" query above.

Example: query[x]=testdata&param[x]=TESTID&param1[x]=STARTX&param2[x]=FINISHX

Example XML Output

<testdata testid="TESTID" query="X" counter="NUM_ROWS">

... for every record Z ...
<record recordx="RECORDX" alertlevel="ALERTLEVEL">VALUE</record>

</testdata>


Example JavaScript Output

data[x]=new Array;

... for every record Z ...
data[x][Z]=new Array;
data[x][Z][0]=RECORDX;
data[x][Z][1]=VALUE;
data[x][Z][2]=ALERTLEVEL;


Data Provided

Data is provided in rows in the format described above






group

Outputs all fields from the fngroup table and some additional data for the groupid passed in param.

Parameters param[x]=groupid (required)


Example: query[x]=group&param[x]=GROUPID

Example XML Output

<group testid="GROUPID" query="X">

... for every field Z ...
<FIELD-NAME>VALUE</FIELD-NAME>

</group>


Example JavaScript Output

data[x]=new Array;

... for every field Z ...
data[x][Z]=new Array;
data[x][Z][0]=FIELD-NAME;
data[x][Z][1]=VALUE;


Data Provided

All the fields of the group table are provided in the data along with some additional computed fields but their index (Z in the above example) cannot be guarenteed so types should always be checked. You should have a manual look at the output to see what fields are precisely available but notable fields include:

alertlevel - numeric reprensentation of last status
alerttext - textual string for the same
groupname - name of the group
groupdesc - description of the group






alerts

Outputs all currently alerting nodes

Parameters No parameters

Example: query[x]=alerts

Example XML Output

<alerts count="NUM_ALERTS" query="X">

... for every alerting node ...
<node nodeid="NODEID" alertlevel="ALERTLEVEL">NODEID</node>

</alerts>


Example JavaScript Output

data[x]=new Array;

... for every alerting node ...
data[x][Z]=NODEID;


Data Provided

All alerting nodes are provided. The number of alerts can be simply checked with the count attribute (XML) or checking the length of the array (JS).





<< XML and JavaScript APIContentsAPI Output Example >>