Skip to content

How Get-PrtgSensorHistoricData should operate #3

@sandersjds

Description

@sandersjds

This cmdlet operates against the historicdata.xml API call, which takes the following input options:

  • id: ID of the specific sensor; integer value
  • sdate: Start of the time span (date and time); yyyy-mm-dd-hh-mm-ss
  • edate: End of the time span (date and time); yyyy-mm-dd-hh-mm-ss
  • avg: Average interval in seconds; use 0 to download raw data (= results of all single - monitoring requests); integer value

As well as a pair of graph-generation options that we're going to ignore. As of right now, in order to simplify the parameters, I've made one of the input parameters "HistoryInDays" which simply converts an integer value (i.e., 2) into a negative timespan starting from now and going back that many days.

It would be nice if the cmdlet could use this simplified format as well as a more fine-grained input format.

The current output of the cmdlet only returns a list of data with a header of the specified channel name.

Hit list for fixes

  • build an input switch that allows "HistoryInDays" or a pair of datetime objects.
  • add a parameter to handle the "avg" value
  • "channelname" should be an optional param
  • construct output to be an array of objects, and each object (row) contains a datetime object and columns for each of the channels

That last item (building the array of objects) is going to require some XSLT/XML gymnastics.

The interim goal as a use model for this cmdlet is for the History Database Monitor sensor to have an option that allows it to query the API (against itself) to report how long the database can be allowed to grow (given current space and growth numbers) without filling the disk containing the database.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions