I want to export the monitoring data of PRTG to a CSV or XML file on a daily basis. Like this, I can analyse the data in my own software or import it to e.g. Microsoft Excel.
3 Replies
This article applies to PRTG Network Monitor Version 7.2 or later
HowTo: Automatically Exporting PRTG's Raw Monitoring Data Into Daily CSV or XML Files
With PRTG Network Monitor, you can analyze your sensor data in various ways. Exhaustive reports for your whole network can be generated as well as historic data reports for single sensors. Still, there are people who just need the data of a sensor in a convenient format to do their own statistics in external programs or to use Excel to do additional computations based on the monitoring data. That is why we have included a XML and CSV export function in PRTG.
This function of the web interface is handy to export data every few days. But if you need daily data for one or more sensors an automatic solution is more comfortable. With the CSVExport command line tool finally there is a way to export data of many PRTG sensors with one single line of script! You can use it as an on-demand tool or combine it with Windows task scheduler. Don't be confused by the name - CSVExport is capable of both XML and CSV data export!
Getting Started
To try it out, download CSVExport from the PRTG7 add-ons website (on Google Code at http://code.google.com/p/prtg-addons/wiki/PTF_Custom_Sensors ) and unpack it.
To run the tool you must supply following command line parameters:
- PRTG username (option -pu).
- PRTG password (option -pp).
- The IP address or hostname of the PRTG web interface (option -ps).
- The sensor ID (or a list of IDs) of the sensor(s) you want to export the data for (option -s). You can look up a sensor's ID under its detail overview page from within the PRTG web interface. The ID is the number written in parentheses behind the sensor name. By the way, the ID is also part of the sensor's webpage URL.
For example, a simple call may look like this:
csvexport -pu=prtgadmin -pp=prtgadmin -ps=192.168.0.10 -s=1001
This command line writes yesterday's data of the sensor "Probe Health" (ID 1001) into a CSV file in the directory where CSVExport is started. If a file already exists, it is not overwritten, but a number is appended to the file name. If you run this command once every day using scheduled tasks you will get a daily CSV file for the sensor 1001.
A big advantage of this tool is that you can export the data of many sensors with one single call. To do so, you only have to look up the IDs and enter them - separated by commas - behind the "-s" parameter. In this case, you will get a separate file for each sensor.
Advanced Options
With optional parameters, you can define a start and end date of the data you want to export or enter a different target file location and credentials, if necessary. You can also change file format to XML and even combine the data of multiple sensors into one file. Please see the manual that comes with the tool's download for a good description of all advanced options.
Notes
This tool was written by Gerard Feijth. Thanks, Gerard, for sharing it with the community! All Google Code tools have not been created and published by Paessler AG, so we are not able to support them officially.
More
If you have trouble opening the CSV files in Excel, please see The Comma and Semicolon Issue in Excel Due to Regional Settings for Europe
Created on Feb 3, 2010 9:31:56 AM by
Daniel Zobel [Paessler Support]
(21,383)
●3
●3
Last change on Mar 14, 2011 4:26:32 PM by
Patrick Hutter [Paessler Support]
(6,074)
●3
●3
Hi,
I keep getting this error when I run this tool against our PRTG instance:
C:\My Documents\Downloads\PTF.CSVExport>CSVExport.exe -pu=<hidden> -pp=<hidden> -ps=http :<ip address hidden>:8080 -s=4544 -f:C:\Tools
Processing sensor 4544 Getting data for sensor 4544 0:The remote server returned an error: (404) Not Found.
Press any key to continue
Can you please let me know how can I fix this problem? I am able to hit this server through browser without any problem.
Thanks, Amar
Created on Jul 9, 2010 11:04:22 PM by
amargoradia
(0)
●1
Last change on May 10, 2012 12:27:16 PM by
Manischa Mittal [Paessler Support]
(0)
●1
Yes, I do know is somewhat late for you, but it may help others.
I first tried CSVExport.exe -pu=prtgadmin -pp=prtgadmin -ps=xx.xx.xx.xx -s=1003 I got a 404 too
At Home / PRTG Status in System Settings, it stated: web server url: xx.xx.xx.xx web server IPs: xx.xx.xx.xx web server ports: 8081 I suppose that 8081 is because I have a WSUS (using port 80)
I then tried CSVExport.exe -pu=prtgadmin -pp=prtgadmin -ps=xx.xx.xx.xx:8081 -s=1003 I don't get a 404 but a "Cannot connect with remote server". And just the same with -ps= xx.xx.xx.xx:8081
At last, I repeated the address wich appears when I click "PRTG Network Monitor" (web GUI) CSVExport.exe -pu=prtgadmin -pp=prtgadmin -ps=xx.xx.xx.xx -s=1003 (with HTTPS) and _success_ ! :-)
HIH somebody
RØ
Created on Oct 26, 2010 5:41:18 PM by
rodeca
(0)
Last change on May 10, 2012 12:26:34 PM by
Manischa Mittal [Paessler Support]
(0)
●1
Please log in or register to enter your reply.
Add comment