Hi All,

We have a set up where we have many probes. Each probe is a different customer as we are a service provider.

We would like some way to output a report of usuage in terms of how many devices under each probe and also how many sensors.

A report to CSV or to the billing tool would be ideal.

Has anyone had a luck doing this with the API.


Article Comments

Dear Danny,

regarding the API, you can do this:

  • Generate a list of devices per probe
/api/table.csv?id=1content=devices&columns=objid,name,host,status,message,comments&count=*

id=1 refers to the local probe. Use the according IDs for other probes.

  • Now iterate over each objid for each device to query its sensors:
/api/table.csv?id=40&content=sensors&columns=objid,device=text,sensor=htmllong,status,message,lastvalue,comments&count=*

id=40 points to the probe device of the local probe. If you use IDs for other devices, you get the respective sensors.

The raw output included in the CSV can be omitted with adding the parameter &noraw=1 however some properties, like messages, are available only in the raw version of the property.


Nov, 2018 - Permalink

Hi Arne,

This is great thank you. The second command gives me what i'm after .

I might have to create a database to query the data into a nicer form and to calculate automatically.

I have see the billing too but i am totally baffled by the scripts haha.

Is there plans for any sort of service provider portal to do such tasks in he future.

Thanks


Nov, 2018 - Permalink

Hi Danny,

Currently there are no plans for such a portal.

Kind regards,

Erhard


Nov, 2018 - Permalink