I'm using the following API command to get a list of newly created devices/sensors:
/api/table.csv?content=messages&columns=objid,datetime,type,name,device,status,message&filter_status=501
Is there a way to specify a date range (I see sdate and edate are used in the API for specific objects), but this doesn't seem to work for my command. (I know it'll only list the most recent 500 which can be altered)
Thanks!
Article Comments
There are two ways the date can be specified
1. With an sdate/edate
filter_dend=2019-04-12-20-24-35&filter_dstart=2019-04-11-20-24-35
2. With a time period
filter_drel=yesterday
Possible values for filter_drel include today, yesterday, 7days, 30days, 12months, 6months
You can also do this way easier via PrtgAPI using PowerShell
C:\> Get-ObjectLog -Status Created -Start (Get-Date).AddDays(-1) -End (Get-Date).AddDays(-7)
DateTime Id Name Device Status Message
-------- -- ---- ------ ------ -------
11/04/2019 10:28:10 PM 2091 exch-1 exch-1 Created See history for details.
11/04/2019 10:22:38 PM 2090 dc-1 dc-1 Created See history for details.
For more information on using Get-ObjectLog, see the wiki.
Regards,
lordmilko
Apr, 2019 - Permalink
God, I love that library :) Thanks, @lordmilko!
Apr, 2019 - Permalink
Perfect! Thanks lordmilko :)
Apr, 2019 - Permalink
There are two ways the date can be specified
1. With an sdate/edate
2. With a time period
Possible values for filter_drel include today, yesterday, 7days, 30days, 12months, 6months
You can also do this way easier via PrtgAPI using PowerShell
For more information on using Get-ObjectLog, see the wiki.
Regards,
lordmilko
Apr, 2019 - Permalink