What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Getting a consistent error when trying to extract data.

Votes:

0

Hi I am getting a consistent error when trying to extract data using powershell. I have gone through the history of the sensor and can not find the value the is being reported as an error. Do you now of a way of making powershell ignore the error and continue to pull the rest of the data?

Many thanks

David

data-extract error powershell

Created on Jun 19, 2020 10:25:14 AM



14 Replies

Votes:

1

David,

What script are you using?

Benjamin Day
[Paessler Support]

Created on Jun 19, 2020 10:08:23 PM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

Hi Benjamin I am using the following script:-

Get-Sensor "Total Draw" | Get-SensorHistory -Average 3000 -startdate 31/03/2020 -enddate 01/03/2020 | Export-Csv -path C:\Temp\TD1.csv -NoTypeInformation I get 773240 rows of data then get a duplicate value mismatch error part way through one of the sensors.

Many thanks

David

Created on Jun 22, 2020 7:13:16 AM



Votes:

1

David,

Where did you get this PowerShell script? I need to see what these switches do.

Benjamin Day
[Paessler Support]

Created on Jun 22, 2020 5:56:23 PM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

Hi Benjamin I got most of it from the web and amended it until it worked to the point I have it now. I have got info from your knowledge base, github and a file I found that I opened in code writer can't remember where.

Sorry I can't be of more help

Thanks

David

Created on Jun 23, 2020 7:39:49 AM



Votes:

0

David,

Without knowing the switches, or having any reference, I'm afraid I can't be much help here.

Anything you can remember about it can help me.

Benjamin Day
[Paessler Support]

Created on Jun 23, 2020 7:19:59 PM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

Hi Benjamin I used the info in this\PTF. PrtgAPI-master\README.md from https://github.com/lordmilko/PrtgAPI I believe this person works for your organisation. We have used other bits of script fro other knowledge base articles. I do not know anything about the code so have just been trying to cobble this together to get the result I want which is:- a list of all total draw sensors with their values over a month. Exported to an excel file. This I will need to do every month. I can then use a pivot table to get the max draw and we can charge our customer accordingly

If you can recommend something that would be very helpful.

Thanks

David

Created on Jun 24, 2020 10:32:53 AM



Votes:

0

Hi Benjamin Is it possible to send you the PRTGAPI master file where some of the info is?

Thanks

David

Created on Jun 24, 2020 1:55:48 PM



Votes:

1

David,

Can you try running this command?

Get-Sensor "Total Draw" | Get-SensorHistory -Average 3000 -startdate 01/03/2020 -enddate 31/03/2020 | Export-Csv -path C:\Temp\TD1.csv -NoTypeInformation

I just want to make sure this isn't because the dates were swapped around.

Benjamin Day
[Paessler Support]]

Created on Jun 24, 2020 5:10:59 PM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

Hi Ben
I have tried the command as you asked and I brought back this error
Get-SensorHistory : PRTG was unable to complete the request. The server responded with the following error: Not enough monitoring data.

At line:1 char:27
+ ... tal Draw" | Get-SensorHistory -Average 3000 -startdate 01/03/2020 -en ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-SensorHistory], PrtgRequestException
    + FullyQualifiedErrorId : PrtgRequestException,PrtgAPI.PowerShell.Cmdlets.GetSensorHistory

this error kept continuing until I canceled the command. I believe the dates have to be the way they were as we tried other ways and it didn't work.

Thanks

David

Created on Jun 26, 2020 7:11:34 AM

Last change on Jun 26, 2020 3:51:33 PM by  Birk Guttmann [Paessler Support]



Votes:

0

David,

Does this sensor have history for the month of March? How much of the month of March is populated?

Benjamin Day
[Paessler Support]

Created on Jun 26, 2020 4:05:02 PM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

Hi Ben Yes the sensor has data with the start and end dates in the format we were using we were getting data. With the date in the format in your command string we get no data. The issue I am trying to resolve is why the report would stop at 770K lines of data. If you would like to do a team viewer session i can show you.

Hope this helps

Thanks

David

Created on Jun 26, 2020 4:49:29 PM



Votes:

0

Hi Ben Yes all the sensors have data they are polled every ten minutes.

Thanks

David

Created on Jun 29, 2020 1:38:32 PM



Votes:

0

David,

Are you running the latest stable release of PRTG? The latest stable is 20.2.59.

Please update to this version if you aren't currently running it.

Benjamin Day
[Paessler Support]

Created on Jun 29, 2020 5:28:49 PM by  Benjamin Day [Paessler Support] (1,441) 2 1



Votes:

0

Hi Ben we are running 20.0.58 I will request that the software be updated and come back to you when it has been done.

Many Thanks

David

Created on Jun 30, 2020 7:25:11 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.