Question
SQL queries for custom reports
Offline

im not a SQL query guy. has anyone pulled out their own custom reports directly from the WUG DB that could kick me in the right direction? Firstly, i am looking to pull the disk usage for a device.
does anyone have examples?
-----
- 1,152 views
- 1 version
- 10 replies
- 3 followers
- Post Date:
- August 11, 2011
- Posted By:
- Colin Stewart
About this forum
- 144k views
- 2234 topics
- 55 followers
Post questions and find answers for all things related to the Standard and Premium Editions of WhatsUp gold.
Viewed 1,152 times
Page Options
10 Replies
It is not that difficult to pull data from the database however the formatting of the data is where you will need major help. Since the database is relational you would need to pull data from multiple tables to get all of the information you need. You would also need to do some calculations to present the data in a usable format. Below is a query that returns the statistics on a the TOP 10 rows in the table.
If you run this query you will see that you will need to determine what the device name is and get more information about the disk.
What exactly are you trying to accomplish?
SELECT
TOP10 [nStatisticalDiskID],[dPollTime]
,[sType],[nSize],[nUsed_Avg],[nUsed_Min],[nUsed_Max],[nTimeDelta],[nDataType],[nStatisticalDiskIdentificationID]FROM [WhatsUp].[dbo].[StatisticalDisk]
Thanks James,
I'm trying to pull data so we can trend growth, usage, etc. on a scheduled basis, exporting the data into CSV so we can create charts in excel..that kind of thing. the WUG scheduled reporting isn't nearly robust enough only sending you a link to the HTML report page. So for instance:
- report on the disk usage of a device over the past 7 days, export that data (and email it maybe). same kind of thing for CPU, memory, rdp sessions for our terminal servers.
thanks for any guidance.
I understand your issue. Reporting is still one of those things that is difficult even in v15. You can set it up to export reports via text, pdf, and excel. It would be nice to see a reporting interface that is more robust but I think it would difficult. One thing you could do it purchase a reporting tool like Crystal Reports or similar and use it to generate the reports. It would be nice to see WUG integrated with Crystal Reports. There is a database relationship diagram/list out here somewhere but I cannot find it at the moment. It shows quite a bit of information you could use.
You can ping support for the diagram/list. From what I can tell you are looking at pulling data from at least 5 tables and then formatting that data. Then you have to look at how to keep up with the dynamic aspect of the system. If you delete a device and add it again it will be a totally different query for that device.
Sorry for not providing detailed help but I am just trying to let you know how much work it would be.
No problem. Thanks anyways. i do have the database dictionary, i guess ill just give it to our dev team to figure out.
If you have a dev team I would definitely give it to them. I would submit a feature request for better reporting. I am sure they are working on something as this has always been a hot topic.
yeah, i have been added to the existing request. considering they just recently released v15, im suprised it hasn't been implemented....at least the ability to attach csv to those scheduled reports.
Colin,
Adding CSV and text formats to the existing scheduled reports is an excellent idea. You should put an entry in the product ideas section.
As for better report abilities, James is absolutely right that this has been a hot topic for a while. He is also correct in that it is not an easy task to tackle. I can say that there have been many discussions internally about intergrating with a reporting engine like Crystal Reports.
I am in need of the database diagram to map the data and schedule such reports to export to CSV. How do I obtain it?
If you are running v15 you will need to contact our tech support department to obtain the db schema. If you are on an older version let me know which one and I should be able to get it for you.
Would you like to comment?
You must be a member. Sign In if you are already a member.